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.
Space flight navigation - anticollision AI
-
- Posts: 61
- Joined: Sun May 08, 2005 11:30 am
-
- Posts: 395
- Joined: Fri Apr 08, 2005 8:46 pm
-
- Posts: 61
- Joined: Sun May 08, 2005 11:30 am
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.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.
I'm looking at opensteer right now. I'd rather not use another library if I can avoid it though.