Auto-translated
In the game, a situation often arises where several powerful units are dealing with ranged neutral creatures. For example, when playing as Swamp, a hero with 2 Wyverns attacks a group of Lizardmen. The Lizardmen split into several stacks, but we managed to block all the ranged attackers with two units after maneuvering. As a result, each Wyvern is surrounded by several stacks. In what order should the neutral stacks be attacked to minimize the damage they inflict? (This also makes sense in a situation, for example, when 2 Wyverns are surrounded by stacks of Centaur Captains, or one Bear is surrounded by a group of Faeries, i.e., the difference in speed and the lack of magic prevent effective maneuvering).
1. For simplicity, let's consider a situation where one of our units destroys exactly one neutral unit per attack. This means the battle will last (total number of neutrals) / 2 rounds. In each round, 2 units will die. During the neutral creatures' turn, our unit receives the same amount of damage, but the retaliatory damage is different. Since the battle lasts the same number of rounds in any case, we need to minimize the retaliatory damage – therefore, the most optimal strategy is to attack the stack with the fewest units.
Check: for example, one of our units attacks 2 neutral stacks, one with 7 units and the other with 3. The battle lasts 5 rounds. Our unit goes first, and the neutral stack with seven units goes first. Let's calculate the retaliatory damage if we attack the largest stack: (6+4+2+0+1)*x = 13x (x is the damage of one enemy unit; for simplicity, let's assume it is fixed). If we attack the smallest stack: (2+0+4+2+0)*x = 8x. The damage inflicted by the neutrals during their turn: (9+7+5+3+1)*x = 25*x. The total difference in damage is 20%!
As a result, we get the following general rule: if several neutral stacks have a different number of units, attack the stacks with the fewest units first. If several stacks have the same number of units, attack the one that goes last (using the same scheme, you can calculate the total damage).
2. In reality, of course, we don't have fixed damage, but then you can take the average damage as a basis; the overall result does not change.
3. If the damage inflicted by our unit is less than the health of the enemy unit, then all the calculations remain valid.
4. If our unit destroys more than 1 unit per attack, it may be more profitable not to finish off a stack, for example, one with a single unit, but to attack a larger one. This depends on whether the lost damage when attacking the smallest stack will offset the difference in retaliatory damage if that damage had destroyed several units from another stack.
For example: we have one unit that destroys exactly 5 neutral units. There are 2 neutral stacks, one with 8 units and the other with three. How is it more effective to attack? The battle lasts 2 rounds. Let's calculate the total damage: if we attack the stack of eight, we receive 3x in response + 6x during the neutral creatures' turn = 9x (x is the damage of one neutral unit); if we attack the stack of three, we receive only 8x damage.
Therefore, in this case, it is more profitable to attack the stack of three units first.
5. If our unit has a retaliatory-free attack, it doesn't matter in what order to attack the neutrals (only here you need to avoid wasting damage when small stacks remain).
6. If a battle occurs where one of our powerful units runs ahead, and we have ranged support behind, then the ranged units should destroy the largest neutral stacks.
P.S. I don't think there was such a topic on the forum, as I wouldn't want to repeat myself.