[DONE] Best way to implement flying around / collision avoiding behaviour

Hi



In my space-shooting game I implemented an AI, but right now it is unable to fly around large objects (i.e. avoid collisions) like asteroids or other ships. I did some thinking on how to implement this, and even tried to apply the A*-Algorithm, but I have trouble initializing the graph properly.

Obviously, you can’t simply use the objects as nodes. I tried to get a graph using the BoundingBoxes for the objects and get the positions of all 8 corners (plus some additional space), and use them as nodes. Well, but how to interconnect the corners of all the other objects? You could make a really nasty thing and simply checking for all corners if there is a straight connection to all other corners (by checking if a Ray intersects and so on), but I guess that is no optimal way.

Can you think of any other efficient (and optimal) way to enable collision avoiding? Open for suggestions :slight_smile:



I just found this thread: http://www.jmonkeyengine.com/forum/index.php?topic=6835.msg55717#msg55717

What exactly is antigrav-movement? ^^"



Edit: I looked it up myself and I was able to easily implement it into my game and it works pretty well for me. Should have searched earlier I guess, sorry about that :slight_smile: