Hello, I'm working a bit on reviewing formation code in hope to make them at least useable. Before trying to implement changes I'd like to know how formations should work.
From my point of view formations are linked to stances and can be divided in two groups: pre-battle formations and in-battle formations.
Pre-battle formations are used to set up a battle. Like moving melee on front line, support on back-line and cavalery on flanks, everyone arriving at the same time before going to the real mess. When close if aggressive, attacking or defensive units will leave formation to run in battle, if hold ground, they will wait in line for incoming ennemies. These are most of the formations, including travel-column formation.
In-battle formation are advanced military manuvres to keep formation while fighting, like phalanx. Attackers will always keep formation and fight from it. The tight formation allows multiple melee rows to fight at once. and advance like a bulldozer (or crushing wall to be more antic-friendly).
Civil tasks ignore formation. No point to lose time to rearrange to go cutting some trees, building, repairing and so. Women can't go in formation, workers would have the same behaviour.
There is also some code to handle picking targets in formations (that is attacking a formation instead of a precise unit). That is attack order should distribute target more or less randomly for more efficiency (pick the guy in front of you for example), less running to target while being assaulted from everywhere.
An other thing making formations usefull requires reviewing units speed and range to require some time to prepare your assault/defense for a line not to be flanked in 2 seconds. We set a few units, maybe 200 units for big battle, where there were line of thousands of men.
So in short:
- Ignore formations for civil tasks
- Most formations are used to place units more effectively before running a battle, take advantage upon unprepared units (macro-strategy)
- Some formations are kept while fighting, maximizing effect
Watch this for pre-battle and in-battle fromations (warning, very violent video)
https://youtu.be/jYchCMe5btI?t=9m53s