How to predict collision before it happens
Hi, I am using some algorithms for collision response for my group behavior simulation. But My problem is that it is not very realistic, because I just detect the collision, when the bounding sphere of my bot collides with the wall, and I apply a steering force away from the collision point.
I would like to know what AI Games use to predict collisions and modify the direction before it happens, to make my bots more intelligent .
I had thought about waypoints in some areas located near the obstacles, but I should check all the time the distance between my bots and the waypoints and it would cost too many cpu cycles, any suggestion ??. ( I don't use grids either because of the memory cost).
Ah!! Another question, Is there any software to create scenes and navigation information files such as height maps ?? What software is used to generate the terrain information for navigation such as waypoints or height maps ???
Thank you very much for your help
I would have the bot "think ahead" a few (dozen) frames (or seconds). If you have a velocity of v, you know that at time t you'll have travelled distance d. If your bot looks ahead two or three timeslices you'll be able to see that "a collision will happen in 4 seconds if i keep going at this velocity" and then adjust accordingly.
Great resource for all things steering and obstacle avoidance related.
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play
"Reducing the world to mathematical equations!"
Since you're already using steering behaviours, a brief notion of 'intelligent looking' collision avoidance is as follows: Assuming you're using message passing between objects, then if the separation between two objects drops below a given threshold, have one send the other a message to avoid it (so this turns on the collision avoidance behaviour in the receiver). The easiest way to do this is to pass the distance to target and its bounding box radius as a parameter of the message and convert this into an appropriate steering force for the receiver.
Obviously if one target is stationary, it should emit the message. If both are moving, choose one at random.
To add a little variety to this, don't use a hard threshold distance. Rather, use a fuzzy classification of the distance and relative velocity of the two objects. This also does the check for you of the likelihood of a collision given distance and velocity.
[Edited by - Timkin on February 1, 2007 11:46:06 PM]
Obviously if one target is stationary, it should emit the message. If both are moving, choose one at random.
To add a little variety to this, don't use a hard threshold distance. Rather, use a fuzzy classification of the distance and relative velocity of the two objects. This also does the check for you of the likelihood of a collision given distance and velocity.
[Edited by - Timkin on February 1, 2007 11:46:06 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement