When/where does the AI separate groups?

embryodead

Caliph
Joined
Jan 1, 2003
Messages
5,179
Location
basement
Recently I've been working on Unit & Group AI a lot but it's rather convoluted and I find it difficult to grasp some things. Particularly I'm interested in the way the AI makes decisions what to do with the units in a group.

I know that technically every unit has a group, and every group moves by the leading unit (head unit). Non-head members of the group don't do anything and just follow the head unit, and attack when it attacks. Apart from that the only thing that can happen to them is separation from the group. I know of two cases when this happens: AI_ejectBestDefender (if a defender is needed) and AI_makeForceSeparate (which is called when boarding transports). This seems like little for what I've observed, which is AI liberally grouping and ungrouping units all the time. The AI groups units a lot but these groups are gone quickly. Anyone knows how does this work? (I'm talking talking about default behaviour).

EDIT: I see that the AI also drops non-matching UNITAI units from UNITAI_ATTACK_CITY stacks when in cities, though that's still not it.
 
Back
Top Bottom