Welcome, Guest. Please login or register.
Did you miss your activation email?
September 02, 2010, 06:03:57 pm
advanced search




Pages: [1] 2 3
  Print  
Author Topic: Dirty Racers  (Read 7227 times)
perick
Full Member
***
Offline Offline

Posts: 346

Thinking in JMonkey


View Profile
« on: September 10, 2007, 07:15:18 pm »

OK Guys, I'll present the reason I'm in debt with Tank Battles (the programming game I talked about). It's called Dirty Racers and it's a fast racing and combat game that I subscribed to a indie game contest that will be part of the Brazilian Simposium on Games (SBGames) this year. I've been replacing my sleeping nights with a LOT of jME and jMEPhysics2 programming and tweeking. From the lessons learnt I will be posting a TestCar.java (with related classes) any time soon for those interested in vehicle simulations.

By this time I'm using only fixed function (aka no shaders). The performance is quite nice: 250+ fps with 4 cars (9 physics dynamic objects each), per triangle collision for the terrain mesh.

Some highlights:
- Effects are only particle systems;
- Dome implemented from the SkyDome example from the wiki;
- TerrainPage with procedural splatting only;
- Each car has a different driving feeling (4wd vs. front vs. rear traction; acceleration, speed, handling);
- Physics by JMEPhysics 2 with dynamic obstacles spread on the tracks;
- Each track has its own feel because of the different physics material for the terrain;
- Joystick supported (and recomended for 2 players split screen);
- Splitscreen mode for versus race.

Some screenshots:

Main Menu with demo in the background:


In game on the Desert track:


Another track:


...and another:


Next I plan to use some reflection and lighting shader on the cars and a different one for the terrain with some bumpmapping, as well as applying a shadow pass.
« Last Edit: September 10, 2007, 07:48:27 pm by perick » Logged

GNU is not Unix & JMonkey is not a monkey
irrisor
Champion
Hero Member
*
Offline Offline

Posts: 3253



View Profile WWW
« Reply #1 on: September 10, 2007, 07:54:36 pm »

Wow this reads and looks really great cool

(and it's very nice to see jME Physics 2 is really used for something grin)

Good luck for that contest!!!
Logged

Ad: Please contribute to the jME Physics 2 Wiki Smiley
perick
Full Member
***
Offline Offline

Posts: 346

Thinking in JMonkey


View Profile
« Reply #2 on: September 10, 2007, 08:01:40 pm »

Forgot to mention some things:

- This screenshots came from a Macbook (not pro) with an ordinary Intel GMA 950 graphics, so there's no anti-alias or mipmapping applied;
- I'm using DF's StandardGame/GameStates with offline loading of assets;
- The game has lots of sound FX as well (skidding, engine, guns), everything based on physics runtime properties;
- The AI for the other cars is based on some ideas I got from some articles about the subject but it's already quite nice. It's quite hard to beat the AI in HARD mode.

And last but not least:

- I plan to make it available with full source code (unless I get hired during the conference and the job consisting of evolving it)

Since it's acctually a framework, with some XML where you can define new cars (with models and all other parameters) and tracks, it's possible to use it for creating a lot of different race games.
« Last Edit: September 10, 2007, 08:06:51 pm by perick » Logged

GNU is not Unix & JMonkey is not a monkey
renanse
Champion
Hero Member
*
Offline Offline

Posts: 5457



View Profile WWW
« Reply #3 on: September 10, 2007, 08:02:28 pm »

Nice, any chance of a demo version later?  Also, are you using the cvs version of jME?
Logged

---
next gen Ardor3d has reached 0.6!
perick
Full Member
***
Offline Offline

Posts: 346

Thinking in JMonkey


View Profile
« Reply #4 on: September 10, 2007, 08:09:15 pm »

Renanse, actually I plan to release the full source code. If not possible, a demo at least, but that I can do only after the conference, which will happen between 6 and 8 of november.

And yes, I'm using the CVS version, but I haven't updated for some time now (couple of weeks or more) because I'm feeling NearDeployDeadlineAfraidOfChangesDisease.
« Last Edit: September 10, 2007, 08:12:17 pm by perick » Logged

GNU is not Unix & JMonkey is not a monkey
duenez
Moderator
Hero Member
*
Offline Offline

Posts: 1279



View Profile WWW
« Reply #5 on: September 10, 2007, 10:53:58 pm »

Perick... it would be great to see it in action. Maybe you could post a video somewhere for us to see and enjoy. It looks extremely appealing and with lots of potential. smiley

Perhaps it would be a way to evolve it into a new kind of FlagRush tutorial  wink
Logged

Edgar
---------------------
"...the horror of Armageddon was seen as a deterrent no sane society would risk. But the nations were not sane..."
                                                  -Eon
Core-Dump
Committer
Hero Member
*
Offline Offline

Posts: 2666



View Profile WWW
« Reply #6 on: September 11, 2007, 01:20:11 am »

looks pretty awsome!
Logged

set up jme with video tutorials | irc:#jme on freenode.net | jme-demos on google code
Textures not visible ? call node.updateRenderstate()
Gentleman Hal
Full Member
***
Offline Offline

Posts: 477


Quite!


View Profile WWW
« Reply #7 on: September 11, 2007, 10:38:54 am »

Wow looks cool, would be nice to see some screen shots with anti aliasing and mipmaps applied though.  Or as others have said a video!

Keep up the good work  smiley
Logged

We're trapped in the belly of this horrible machine
And the machine is bleeding to death

The sun has fallen down
And the billboards are all leering
And the flags are all dead at the top of their poles
perick
Full Member
***
Offline Offline

Posts: 346

Thinking in JMonkey


View Profile
« Reply #8 on: September 11, 2007, 03:10:03 pm »

I can do both things, and will, as soon as I fix some issues with the SFX in Windows.

At the end of the week probably.
Logged

GNU is not Unix & JMonkey is not a monkey
nymon
Project Advocate
Hero Member
*
Offline Offline

Posts: 1255



View Profile
« Reply #9 on: September 11, 2007, 05:30:08 pm »

Can you elborate a little on your AI implementation or provide a link or two to some resources your found helpful?
Logged

Scene Monitor might help!
perick
Full Member
***
Offline Offline

Posts: 346

Thinking in JMonkey


View Profile
« Reply #10 on: September 11, 2007, 06:01:06 pm »

This link is not really what I used to implement the AI, but gave me a good overview of some trends:
http://privatewww.essex.ac.uk/~rdenar/Togelius2007Towards.pdf

This one gave me a lot of ideas about my CarDriver agent and how to implement thae tracks:
http://www.vagamelabs.com/static-bits/drivatars-an-artificial-intelligence-system-for-racing-g.htm

The last one doesn't really expose any implementation details, but is quite interesting.

My implementation is REALLY simple, but I liked the results and you'll see it in action on the video I'll post this weekend. Some things:

- For AI cars, tracks are (as in most race games) a collection of WayPoints, in my case each waypoint is a Large jME sphere (not in the scene graph, so not drawn)
- Each car has, at any time, a reference to the current waypoint it has to go to.
- I only have to test collisions of the car with its current waypoint.
- When reaching the waypoint, the car references the next one and so on.

This is the basics... How to make it work is the key. Some more considerations:
- Each car allways tries to turn towards the waypoint (unless trying to pass or avoid something else - later)
- Each waypoint has an attribute with its IDEAL speed for that point (this is really necessary for the car to make tight turns)
- Each car always acclerate to the next waypoint, and when near it brakes (proportionally to the distance) to the ideal speed.
- This is enough to make them follow the track and make very good times... Just have to calibrate the waypoint's location and speed.
- I do this calibration by recording some laps I make myself (I'm quite good at racing games - Smiley)

The style part:
- When turning towards the next waypoint, each car steers its wheels proportionally to the relactive angle (facing direction vs. where to go to -vector3f vector3f)
- This would make them DEADLY stable and fast, so I introduce a random style factor. Each car has a coeficient of agressivness, which makes it turn more than it needs... That makes it occilate more than others (and the same happens when trying to pass)

The other stuff:
Each car always tests if it'd be efficient to fire against some other in front of it. Does it when it's almost in front (so doesn't miss) and when the car is not so near, maybe staying in the way.
When near the car in front, tries to pass, to the right or left, depending on where's the next waypoint, distance to it and hows the relactive angle between the facing and the next car.

Since the physics are simulated, there's A LOT of randomness in all the races and the times vary constantly. The cars also have different behavior, because of the rear vs. front vs 4wd tractions and different max speeds and accelerations. But if I put one car alone (no fire hits) it's really fast and constant. That's what's expected from a good driver.

An example, AI car laps:
45.573s (first one, froms tart)
43.721s
44.238s

My personal record in this particular track is: 43.271s

This is the hard mode (not final calibration). For medium and easy modes I just add some speed limiter factor to apply against the ideal speed for that sector. This limiter is proportional to the position (1st has the biggest limiter), but this happens only in medium and easy difficulties. In hard mode there are no limits for the AI cars.

Next steps will be:
Make more than one available set of waypoints (different trajectories)
Making the cars get better in long races, learning from mistakes (race strategy also)
Making different CarDriver agents for each car type (parameters or some recordable learning, like neural networks)

I think this is it.
« Last Edit: September 11, 2007, 06:14:34 pm by perick » Logged

GNU is not Unix & JMonkey is not a monkey
llama
Champion
Hero Member
*
Offline Offline

Posts: 2260


A llama like no llama before


View Profile
« Reply #11 on: September 12, 2007, 12:44:50 am »

- I do this calibration by recording some laps I make myself (I'm quite good at racing games - Smiley)

Is this automated stuff? That would mean that different drivers used for callibertion could result in different AI personalities.. no? That would be cool.. You could even automatically download AI's based on other people's driving into your own game, since I reckon they won't take too much data... (kind of Spore like)
Logged
perick
Full Member
***
Offline Offline

Posts: 346

Thinking in JMonkey


View Profile
« Reply #12 on: September 12, 2007, 03:50:52 pm »

It's not this much automated, but you just gave me an idea... grin
Logged

GNU is not Unix & JMonkey is not a monkey
quixote_arg
Newbie
*
Offline Offline

Posts: 46


galletita


View Profile WWW
« Reply #13 on: October 03, 2007, 05:58:07 pm »

This looks very nice! Any updates? Can we see some source? Smiley
Logged
perick
Full Member
***
Offline Offline

Posts: 346

Thinking in JMonkey


View Profile
« Reply #14 on: October 03, 2007, 06:09:17 pm »

Not yet... Sources or the complete download only after the game contest which will happen between 7 and 9 of november.

I'm trying to find a nice video capture app for mac so I can post a video on some place.
Logged

GNU is not Unix & JMonkey is not a monkey
Tags:
Pages: [1] 2 3
  Print  
 
Jump to: