Advertisement

Dirt bike racing AI

Started by June 29, 2007 04:19 AM
2 comments, last by Pheonixx1980 17 years, 4 months ago
Hi all, i am making AI for dirt bike racing game. i have complete the spline based AI where AI is moving according to spline(not on spline but it take turn accordingly ) .. but i am not satisfy with result as the AI motion is linear and don't have any idea how to improve it... any idea or resources from u guy will be very helpful. i want my AI bike to be smart so it can take sharp turn and behave realistic ......
You could have two lines for the ai to follow.

A Best line = fastest and an overtaking line.

You could then test each bike to see how close it is to the other bikes and take action accordingly. If the bike being tested is too close to the bike in front then you can tell it to change to the overtaking line and back to the original best line again when it has no bikes in front of it.

You could also have the bikes aim not directly at the best line but either to one side or the other by some random amount. This would give the illusion of the bikes ducking and diving as they drove around the course.

You could also have slight random variations in each bikes handling. Some bikes slightly faster than others, some bikes better at cornering ect. Just adding some small variations in each bike.


KJM
Advertisement
Thanks KJM, i will try this..
one method is to embed the track with data that the AI can use.

what is the desired vector and magnitude for where I am currently at?

the track is telling me I can go all out and I should be heading in a x.xx,y.yy,z.zz vector

now the track is telling me I should be going about 45kph and heading in a x.xx,y.yy,z.zz vector

i am not facing the desired vector, I need to slow down and turn!

it's kind of like flying by wire. each section of track pretty much tells the AI how fast it should be going and in what direction, that way if it is bumped off course, it can easily say... this is what I should be doing, do what I have to do to get there, be it accelerate, brake, turn.

if you design your track pieces to have a width and a desired line, you can combine that with the vector/magnitude (also called a 4D vector) to really give your AI the tools it needs to know where it is at.
Ausukusa Development Studios

This topic is closed to new replies.

Advertisement