Upgraded the script, now it only issues the order every second if more than half of a troop's units are idle.
I'm copy-pasting my post with the old results for its structure, but I'm updating the values.
When meeting the requirement, each troop is ordered to attack the farthest enemy troop flag holder every second (to prevent situations where troops would just stare at each other because the survivors were too far from the enemy to automatically engage)
The test took place in r6619 (current RC3)
Test 1
Team 1: 2522 Corn if their equipment and Gold were bought at the Market
- 52 Axe Fighters
- 51 Crossbowmen (placed right behind the Axe Fighters)
Team 2: 2520Corn if their equipment and Gold were bought at the Market
- 45 Sword Fighters
- 45 Bowmen (placed right behind the Sword Fighters)
100 battles:
- team 1 (Axe Fighters+Crossbowmen) won 13 of them.
- team 2 (Sword Fighters+Bowmen) won 87 of them.
Test 2
Team 1: 2520 Corn if their equipment and Gold were bought at the Market
- 42 Axe Fighters
- 42 Sword Fighters (same position as the Crossbowmen in test 1)
Team 2: 2520 Corn if their equipment and Gold were bought at the Market
- 45 Sword Fighters
- 45 Bowmen
100 battles:
- team 1 (Axe Fighters+Sword Fighters) won 18 of them.
- team 2 (Sword Fighters+Bowmen) won 82 of them.
Test 3
Team 1: 2520 Corn if their equipment and Gold were bought at the Market
- 42 Sword Fighters
- 42 Axe Fighters (positions switched from those in test 2)
Team 2: 2520 Corn if their equipment and Gold were bought at the Market
- 45 Sword Fighters
- 45 Bowmen
100 battles:
- team 1 (Sword Fighters+Axe Fighters) won 43 of them.
- team 2 (Sword Fighters+Bowmen) won 57 of them.
Test 4
Team 1: 1889 Corn if their equipment and Gold were bought at the Market
- 94 Militia
- 45 Bowmen (placed right behind the Militia units)
Team 2: 1890 Corn if their equipment and Gold were bought at the Market
- 45 Axe Fighters
- 45 Bowmen (placed right behind the Axe Fighters)
100 battles:
- team 1 (Militia+Bowmen) won 78 of them.
- team 2 (Axe Fighters+Bowmen) won 22 of them.
Conclusion
Unless there's something that I'm missing (or unless I made some other scripting error), there actually seems to be a problem... even a full melee army, which should hard counter the Bowmen+Sword Fighters combo (thanks to the shield bonus), at best stands a fair 50% chance to win against it.
(I didn't really do the proper math here, but 43% shouldn't be really statistically different from 50%, considering the better but still not very large pool of data...)
You do not have the required permissions to view the files attached to this post.
Just when you think you know something, you have to look at it in another way, even though it may seem silly or wrong. You must try! - John Keating, "Dead Poets Society"