RTS Smarter Group Movement.

Monkey Forums/Monkey Code/RTS Smarter Group Movement.

Pakz(Posted 2015) [#1]
I coded group movement before but that was very simple. The units moved in a straight line into the direction of the target and would stop if they got close or if there was something in the way.
I had the idea that if I would move the unit into -90 degrees or +90 degrees direction if that spot was free. It seemed to work allright. They wait if all directions are occupied.

This code might show you or can be modified to be used in rts games. Also maybe as group ai for monsters that move towards you.

Here a video of the code with 150 units moving towards random destinations.


Tinypic did not work so no screenshot.