Space flight navigation - anticollision AI

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Rabid Mantis
Posts: 61
Joined: Sun May 08, 2005 11:30 am

Space flight navigation - anticollision AI

Post 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.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post 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.
Image Image Image
dhenton9000
Posts: 395
Joined: Fri Apr 08, 2005 8:46 pm

Post by dhenton9000 »

you might what to take a look at opensteer.
Rabid Mantis
Posts: 61
Joined: Sun May 08, 2005 11:30 am

Post 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.
Post Reply