We can loose less troops if we just attack boars first, so computer will not have next turn (archers from castle will not attack, hero will not use arrow).
It could be just 14 goblins and 4 halfings:
Also, I have noticed, that computer is using "slow" on gargoyle - that makes no sense, orcs attack griffons and die, dealing no damage... Instead, computer could use "arrow" and kill more my troops.
Preliminary checks
Describe the problem requiring a solution
Computer is rushing and loosing 19 goblins and 21 halfings:
https://github.com/ihhub/fheroes2/assets/145407420/27d568fe-0b5d-439a-a5c0-12fc81714a51
We can loose less troops if we just attack boars first, so computer will not have next turn (archers from castle will not attack, hero will not use arrow). It could be just 14 goblins and 4 halfings:
https://github.com/ihhub/fheroes2/assets/145407420/2a672e6c-0b26-47b1-a8ee-0dc4623c02ee
Describe the possible solution
Make computer analyze which strategy is more profitable: attack ranged units or attack the fastest units.
Additional info
version 1.1.0
improve castle attacking.zip