Jump to content
  • Advertisement
Sign in to follow this  
zandarina

How to predict collision before it happens

This topic is 4159 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

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!