AI Vehicle control

Started by
1 comment, last by MGB 19 years, 12 months ago
Not really AI, more a design question: How do people here implement the control of AI vehicles to stay within the bounds of the vehicle''s manouevreability parameters (e.g. turn rate, simulated inertia/turn rate delta), for example the turning of a boat? I''ve tried two approaches: a) Fake it basically: calc heading change from current hdg and target position. Cons: Rather complex to keep within the manouevreability bounds! b) Send an input message through the same code path as user input (e.g. fake left cursor input). Cons: Hard to stop the vehicle overshooting the correct target heading, esp with large inertia!
Advertisement
Normally I *try* to go for option 2 wherever possible - it yields a more "fair" game if the AI is using the same vehicles the player uses. The math usually isn''t TOO icky with inertia - you can probably fake the calculus close enough with approximations so you can ignore integrals.

Another thing that CAN work if you are careful is a hybrid of the two approaches. This works best if the player can''t strictly compare the performance of his (identical) vehicle with the AI''s. Let the AI get as close to the desired results as possible through standard inputs, but apply a small "fudge" factor to keep it within a desired window of behavior. That can make up for small deficiencies in the AI, but don''t use it to cover over gross errors.
Hmm yes - I'm thinking (b) will be easier so far.
Tweakage required as usual

[edited by - aph3x on May 11, 2004 7:18:48 AM]

This topic is closed to new replies.

Advertisement