AI for racing car
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!
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.
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.
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement