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.65k stars 371 forks source link

Battle: improve defence of ranged units #7952

Open fheroes2bugs opened 10 months ago

fheroes2bugs commented 10 months ago

Preliminary checks

Describe the problem requiring a solution

If a 2-cell creature (i.e. wolf, champion, cavalry, unicorn, hydra, griffin, roc, medusa, nomad) wants to defend a ranged unit from a 2-cell attacking creature (i.e. dragon, phoenix, cyplop) he is standing not in front of ranged creature. Example: Starting postion: image

Phoenix wants to defend druids: image

That was a mistake, druids die from dragons attack: image

https://github.com/ihhub/fheroes2/assets/145407420/a6644d3a-95f8-4bba-b3dd-8205c5f13ab7

Describe the possible solution

When playing against a 2-cell attacking creature (i.e. dragon, phoenix, cyplop) make a 2-cell creature (i.e. wolf, champion, cavalry, unicorn, hydra, griffin, roc, medusa, nomad) stay in front of ranged unit, so a dragon would not attack both of 2 units in one turn.

image

Additional info

version 1.09 save: defence dragon.zip

ihhub commented 4 months ago

Hi @oleg-derevenetz , I believe you improved this behavior some time ago, didn't you?

oleg-derevenetz commented 4 months ago

Hi @ihhub

I believe you improved this behavior some time ago, didn't you?

Yes, but the current implementation doesn't take into account abilities of the enemy units.

fheroes2bugs commented 3 months ago

At version 1.1.0 unicorns try to defend druids, but druids still get killed: image

Also I want to metion, that in this battle phoenix does 0 damage to dragons. Phoenix want to defend elfs, but elfs die after dragons attack: image

The battle:

https://github.com/ihhub/fheroes2/assets/145407420/60095537-ea1a-4d91-8dde-083c960ab265