In Starcraft 2, unit formations are created when a "group" is generated from a command. Generally, the rules for a group are:
- All units in the group are in the same spatial "clump".
- All units in the group were given the same move command.
- If any unit in the move command is not in the clump, the group is broken and units move towards the destination individually.
How do I define a clump programmatically and detect in a unit is not in the clump?