Unit Avoidance in RTS

Hello guys,

I am makig an RTS game.
I currently have a* pathfinding implemented as well as the RVO2 library for unit avoidance.
While it does work, it seems to me that the RVO 2 library library isnt very suitable for my game because it often forces other units to move away when about to collide, rather than to drive around the other unit that it is about to collide with.
Normally, this isnt necessarily bad at all, but in the case of an RTS game it isnt practical because one could mess up enemy unit formations and whatnot.

Is there anyone who has experience in this matter and could advise a substitute for the RVO library?
Ive looked into unitysteer but found it hard to get into to because there is absolutely no documentation about it whatsoever. Also, i need it to be compatible with the a* pathfinding module.

1 Answer

1

I’m not using A* but I’ve solved this by implementing a waypoint system for my units and an independent steering algo as well. So when units are too close they will try to stay away from each other, but they also always will try to get to their waypoint.

In order to keep a “formation” they also try to stay close to each other. Those things are the fundamentals of flocking. Read up on that algo.

http://wiki.unity3d.com/index.php?title=Flocking