Advertisement

What kind of AI system should I use for my game?

Started by September 09, 2000 03:04 AM
11 comments, last by James LeGroove 24 years, 2 months ago
I''m actually working on a car racing game and I''d like to know what are the most commonly used AI systems and wich one is the best for this type of game? Thanks OoOoOoOoOoOoOoOoOoOoOoO oO LeGroove Oo OoOoOoOoOoOoOoOoOoOoOoO
OoOoOoOoOoOoOoOoOoOoOoO oO LeGroove OoOoOoOoOoOoOoOoOoOoOoOoO
The most common racing AI is based on placing splines down to denote the track and have cars follow them around while performing reactive collision avoidance. i.e. Spline the racing line and have each car choose an offset from that racing line so that they don''t intersect with other cars.

Is this a normal GT style racing game or a Driver style racing game. I have a lot more experience with the latter.

Mike
Advertisement
quote: Original post by MikeD

The most common racing AI is based on placing splines down to denote the track and have cars follow them around while performing reactive collision avoidance. i.e. Spline the racing line and have each car choose an offset from that racing line so that they don''t intersect with other cars.

Is this a normal GT style racing game or a Driver style racing game. I have a lot more experience with the latter.

Mike


I''m also doing racing game AI at the moment.

In your experience, did you ever consider having the cars use the edges of the track and radius of the curves and the locations of the other cars to determine where they should be within that section of the track, as opposed to following a pre-determined splined racing line?

Eric
Well I''ve decided for a spline network so enemy cars can access shortcuts or get in a stand when needed.

Thanks for the suggestions
OoOoOoOoOoOoOoOoOoOoOoO oO LeGroove OoOoOoOoOoOoOoOoOoOoOoOoO
The racing games I was working on (which has just been canned btw, Fox Interactive are B*STARDS) was a city racing game, most of the AI worked off heuristics for choosing lanes which included sidewalks and oncoming traffic lanes. So, if you consider that each lane is a distance in the y (consider x being down the path y being across it) then the cars chose a y position based on different heuristics of the path and each lane on it. I did wonder if you made the path have a hundred lanes all 10 cm wide would that work for a Gran Turismo style racing game. Personally I think there are better ways of doing it but it''s an option (especially if you have a system that works that way already).
A better way would be having the racing line as a weight for the y position and have obstacles in the track affect the y almost like spheres of influences.
Then you just have to worry about working out the optimal speed i.e. should you stop or not if there''s a severe blockage.

Hope that clarifies my thoughts for you.

Mike
quote: Original post by MikeD

The racing games I was working on (which has just been canned btw, Fox Interactive are B*STARDS) was a city racing game, most of the AI worked off heuristics for choosing lanes which included sidewalks and oncoming traffic lanes. So, if you consider that each lane is a distance in the y (consider x being down the path y being across it) then the cars chose a y position based on different heuristics of the path and each lane on it. I did wonder if you made the path have a hundred lanes all 10 cm wide would that work for a Gran Turismo style racing game. Personally I think there are better ways of doing it but it''s an option (especially if you have a system that works that way already).
A better way would be having the racing line as a weight for the y position and have obstacles in the track affect the y almost like spheres of influences.
Then you just have to worry about working out the optimal speed i.e. should you stop or not if there''s a severe blockage.

Hope that clarifies my thoughts for you.

Mike


So basically, each "lane" defined a path within the overall
driving area?

That still sounds like a predetermined spline pathway to me.
Not that such is a bad approach (it is not) but that it is
predetermined (with obvious variance off the spline).

What I tried (it worked but costs lots of CPU) was to consider
the actual edges of the driving area, the type of area the car
was in at the time and the area (areas == sectors) it was going
to be entering, and the other cars around and then figure out
where the car should be (no predefined spline path involved).

I''ve also replaced that with a spline path following approach
because the spline is so much less CPU overhead.

I was just wondering if anyone else tried the "non-path" method
that I did and what they thought of it.

Eric
Advertisement
Oh it is a predetermined spline path in the end. The cars chose a lane then constructed it''s own spline based on which lane it wanted to be in involving generating curves (all based on circles) for the next three spline points based on the route it was taking. I had to use this method as the city I was dealing with involved motorways with slip roads, roads that changed between 2 to 4 lanes on the same strip and the like.

How did you decide the speed a car wanted to be driving at with your splineless system? Were corners and curves marked out on the route? Also how did the cars decide where to be at any given moments due to the curves in the track?
With splines I simply had a target point, which varied in distance from the front of the car, which the car had to adjust it''s steering to follow. Did knowledge of the angles of the oncoming curves allow you to determine, heuristically, the best y to hit the curve at?

Mike
I don''t know, I''m not sure that for a racing game it''s really useful to implement a non-path AI system (even if it''s an interesting issue). Maybe for a deathrace where cars can use weapons, there would be enough parameters to justify working it out. Then you could use some kind of a "sector" AI like they use in FPS games.
OoOoOoOoOoOoOoOoOoOoOoO oO LeGroove OoOoOoOoOoOoOoOoOoOoOoOoO
I think Chris Crawford document on Autonomouse Agents Steering Behaviour would be damn useful here ... you would use maybe the flow field to influence how the cars should move around the tracks. I guess really, using splines is in the same vein, but that''s just me.
youpla :-P
-----------------------------Sancte Isidore ora pro nobis !
The easiest and yet very good approach (i wonder why no one suggested it here yet):
You don't have to use spline. Just place ordered points (point 1,2,3...) at corners of the track and a small box around them. Then just start moving towards the first point and after the car is inside the bounding box around that point, you'll start heading for the next point. So easy!

To make the cars slow down in sharp turns, just check the angle between car's current moving vector and the vector from the waypoint you are heading to the next waypoint. If the angle is 180 degrees (well of course you never will turn 180 degrees in a game), you gotta go really slow, it it's 90 degrees, you don't have to slow the speed down that much.


-Hans

Edited by - Hans on September 12, 2000 3:54:45 PM

This topic is closed to new replies.

Advertisement