This patch allows some basic support for battalions-like groups:
- One can create its own battalion from alike-entities. (Minimal size is 2 entities.)
- Forming a battalion switches units to battle formation when possible.
- Hovering over one entity of a battalion highlights the whole battalion.
- Selecting one entity of a battalion selects the whole battalion.
- Battalions can be manually disbanded and are also disbanded when there are no entities left in them.
But why a seperate component and not in the formation.js, you ask? Well, good question! A formation may exist of multiple battalions. E.g. I have two groups of melee infantry and one group of ranged infantry. I want them to engage in a nice battle formation, but when the horses charge around my melee units, I do not want to select the archers as well when sending my melee back.
This is just to reduce micromanagement, nothing more, nothing less. But it could well be extended and used beyond that! I hope people can use this as a base if they want battalions.
ToDo:
- Give some practical use for this, for now it is only visual.- Properly update when entities die and probably also when changing owners.
- Do we want only one type of units in a battalion?
- Automatically move into a preferred formation (from template (not battle formation).ate?)?
- Allow battalion training from structures. (Batch training is battalion training?) One could create a menu option for that. (Automatically train batches as battalions.)
- Allow a force single select option? E.g. ctrl-alt-click removes the entity from the battalion or selects just that entity, regardless whether it is part of a battalion.
- Test.
Many thanks to @Angen en @Yves for their mods with battalions, I got much information from those :)