Advertisement

AI for racing car

Started by January 12, 2005 04:36 PM
5 comments, last by johdex 19 years, 10 months ago
Hello, I'm looking for a simple AI for a racing car games. Do you kwno wehre can i find an articles on this subject? Or where can i find code sample. Thanks.
Go to your local library, or bookstore, and read the AI racing articles in AI Game Programming Gems I and II. All your questions will be answered!
Advertisement
Thanks, but can you know website wich treat of this subject :) ?
I hate advertising my own site, but I wrote a basic article on what I saw on Mario Kart: DOUBLE DASH!! AI, which can be applied to probably all racing game AIs.

You can read it here.
I would imagine that AI for a racing game shouldnt be entirely too difficult. The trickiest part is to recalculate proper lines for when cars are passing or whenever a car loses control etc. Otherwise have them follow a racing line but depending on the skill of the driver you can apply a random offset to certain things at different points such as.

Braking time and pressure coming into a corner.
Angles of cornering.
Speed of cornering.
Point of acceleration when coming out of a corner.

The racing line should be determined by a physics algorithm to find the best way to handle each corner for each driver. And then the drivers skill would determine their margin of error from that line. You just make a random number within that margin of error to figure how well the drivers actually do.


Actually thinking of the algorithms to make those lines is a bit trickier though of course. But with a bit of toying you should be able to think of a system that would cover all the different conditions a driver will need to account for.

"Never have a battle of wits with an unarmed man. He will surely attempt to disarm you as well"~Vendayan
Thanks visage.
Advertisement
I don't know what they are worth, but you can look at RARS: http://rars.sourceforge.net/
and TORCS:
http://torcs.sourceforge.net/

Both include robots, source code and some kind of tutorials.
-- Top10 Racing Simulation needs more developers!http://www.top10-racing.org

This topic is closed to new replies.

Advertisement