Page 1 of 1

Space flight navigation - anticollision AI

Posted: Sun Apr 09, 2006 9:50 pm
by Rabid Mantis
I've got a bunch of ships flying around in 3d space and its time for me now to keep them from running into each other. Right now the ships just fly from point a to b (either a location or target ship), with realistic drift and maneuverability factored in. I know how to use the collision manager but i was wondering if anyone knows of an efficient method to make all these collision tests and steer the ships properly so that they dont collide with one another. I've come up with a few ideas but havent quite hit the nail on the head yet. I'm sure I'll eventually figure it out through a lot of trial and error, but i was hoping that someone who's done this before could give me some pointers or a link to some good example code.

thanks.

Posted: Sun Apr 09, 2006 10:26 pm
by JP
Maybe you could use range data to obsticles, using the collision manager, casting a ray out from the front of the ship (maybe in a few directions) and then you know how far away the nearest obsticle is and can do something out it if it's too close.

Posted: Mon Apr 10, 2006 12:06 am
by dhenton9000
you might what to take a look at opensteer.

Posted: Mon Apr 10, 2006 8:26 am
by Rabid Mantis
JP wrote:Maybe you could use range data to obsticles, using the collision manager, casting a ray out from the front of the ship (maybe in a few directions) and then you know how far away the nearest obsticle is and can do something out it if it's too close.
well, yeah thats the basics. It gets a little more involved when theres a hundred ships all buzzing around in different directions though. For example I might have two ships dodging the same obstacle and I have to make sure those two ships dont dodge straight into each other, or two ships flying straight at each other... i have to make sure they dont dodge in the same direction.

I'm looking at opensteer right now. I'd rather not use another library if I can avoid it though.