Preventing enemies from bunching up?

Started by
2 comments, last by EJH 15 years, 2 months ago
Hey all, I'm working on a 2d dogfighting game (flash game playable here) and am having an issue with the enemies just bunching up on top of each other. The end result looks pretty ridiculous. Implementing some sort of flocking behaviour seems like a little bit of overkill but is it the best / only solution? Anyone have any ideas on a better way to more realistically have enemies attacking you from all angles? Thanks guys!
Advertisement
Yeah, some sort of flocking behaviour.

To put it simply, you can surround your enemies with a sphere (to be more accurate, an area around them giving them personal space), and when they get within a radius, push them apart (slowly) to make sure they aren't bunching up.

http://www.red3d.com/cwr/steer/

Everything is better with Metal.

A while back I wrote a journal entry here about flocking behaviors that may be interesting to you. </shameless self promotion>
In my current project we solved that exact problem just as Oliii desribes above. Using those algorithms from red3d.com as well.

This topic is closed to new replies.

Advertisement