Digging through the code responsible for executing battle plans is like the proverbial yak shaving. But one thing I've already noticed is that it throws almost everything it does out the window in the final step: spreading attacks.

This is how the Italian AI draws its first offensive line in northern Ethiopia; let's assume this is a reasonable plan. To faithfully execute it, the unit controller correctly identifies that the northern-most mountain province is most important. It is among the furthest away from the offensive line, capturing it does not lengthen the frontline and it can be attacked from three directions. Nice!
Then the shooting starts:

Four divisions attack the central province, three the western one, and one is still in transit. As soon as some division target the central mountain province, its score tanks -- alot. A single division targeting a province divides its score by 13*, two divisions by 26 etc. After two or three divisions the remaining scores are zero and further assignments are essentially random. I think this is why AI attacks feel like a horde of orcs smashing against Helm's Deep.
* 00_defines.lua: NMilitary.PLAN_SPREAD_ATTACK_WEIGHT
This is how the Italian AI draws its first offensive line in northern Ethiopia; let's assume this is a reasonable plan. To faithfully execute it, the unit controller correctly identifies that the northern-most mountain province is most important. It is among the furthest away from the offensive line, capturing it does not lengthen the frontline and it can be attacked from three directions. Nice!
Then the shooting starts:
Four divisions attack the central province, three the western one, and one is still in transit. As soon as some division target the central mountain province, its score tanks -- alot. A single division targeting a province divides its score by 13*, two divisions by 26 etc. After two or three divisions the remaining scores are zero and further assignments are essentially random. I think this is why AI attacks feel like a horde of orcs smashing against Helm's Deep.
* 00_defines.lua: NMilitary.PLAN_SPREAD_ATTACK_WEIGHT
Last edited:
- 2