Formations reorganize when restarting task?

Master Ben

New member
Scenario: After a formation task has completed, the units are grouped into the formation they ended with. Moving the target and restarting the task causes the units to reorganize and swap places, just to form the exact same formation again before moving towards the target.

Am I using these assets wrong?
It doesn't seem like the formation task is meant to be kept alive if the formation isn't moving, although that would solve the problem.

I can partially fix the problem for the "columns" formation by removing a unit that is replaced by another unit from the formation and re-adding them after (the problem seemed to lie in the positioning part of StartListeningForOrders), but this change breaks nearly all other formations.

This problem makes formations unusable for me, and the code seems brittle when making any changes (probably because I have no documentation on FormationGroup and what information is flying around. A lifecycle diagram or documentation on leaders vs followers would also be a huge help.)
 
Last edited:
I was able to reproduce what you are seeing. I am planning on a major restructuring of the formations pack to add more flexibility such as for situations like this.

The agents should be added to the group based on how far away they are from the closest position (within FormationGroup.StartListeningForOrders). It doesn't look like that is correctly happening in all cases.

The Formations Pack works because of leaders and followers. The followers follow the leader with an offset to form the formation, while the leader does the actual movement to the destination. In my refactored update I am planning on having a manager determine all of the positions for me instead of having the concept of leaders and followers.
 
Top