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

Capitulation logic #8772

Closed fheroes2bugs closed 4 months ago

fheroes2bugs commented 4 months ago

Preliminary checks

Describe the problem requiring a solution

Computer is capitulating while defending the castle, but not asking me do I agree with the price.

https://github.com/ihhub/fheroes2/assets/145407420/ff033d1e-c19f-4172-a015-0351212d14a2

If we want to make AI to behave like human, if the battle is not defending town/castle - just hero1 (strong) vs hero2 (weak) and hero2 that wants to capitulate, he needs to make offer to hero1 "win you let me out for 275 gold?" and hero1 may accept it or not. At the moment there is no offer, hero2 just capitulates.

Describe the possible solution

Save the logic from original game.

Additional info

version 1.1.0 capitulation.zip

zenseii commented 4 months ago

The way surrendering works in fheroes2 is how it worked originally, just check in a multiplayer game and you will see that you are not asked if you agree to the ransom.

ihhub commented 4 months ago

Closing this based on @zenseii explanation.