ihhub / fheroes2

fheroes2 is a recreation of Heroes of Might and Magic II game engine.
https://ihhub.github.io/fheroes2/
GNU General Public License v2.0
2.69k stars 375 forks source link

Battle: Improve attack strategy to loose less troops #8773

Open fheroes2bugs opened 4 months ago

fheroes2bugs commented 4 months ago

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

fheroes2bugs commented 4 months ago

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.