Jump to content
• ### What is your GameDev Story?

• Advertisement

#### Archived

This topic is now archived and is closed to further replies.

# AI Vehicle control

This topic is 5365 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

## Recommended Posts

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!

#### Share this post

##### Share on other sites
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.

#### Share this post

##### Share on other sites
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]

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement
• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

(You must login to your GameDev.net account.)

• ### Popular Now

• 13
• 9
• 9
• 15
• 14
• Advertisement
• ### Forum Statistics

• Total Topics
634070
• Total Posts
3015335
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!