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.6k stars 365 forks source link

Adventure map, enemy hero managed to enter player's castle #5606

Closed Branikolog closed 1 year ago

Branikolog commented 2 years ago

Preliminary checks

Platform

Windows

Describe the bug

image Green hero in purple castle. We can even manage his options. Another bug of "garrison experimental feature"...

Save file

Green spy in a castle.zip

Additional info

No response

oleg-derevenetz commented 2 years ago

Hi @Branikolog was this castle empty when it was occupied by the AI or there was a guest or guardian hero (or may be both)?

P.S. Do you (accidentally) have a save file for the previous turn? I tried different variants and still cannot reproduce this yet. Was the path to the castle also blocked by your hero at the end of the previous turn?

Branikolog commented 2 years ago

Hi @Branikolog was this castle empty when it was occupied by the AI or there was a guest or guardian hero (or may be both)?

P.S. Do you (accidentally) have a save file for the previous turn? I tried different variants and still cannot reproduce this yet. Was the path to the castle also blocked by your hero at the end of the previous turn?

Hi, @oleg-derevenetz

Unfortunately the issue was found by one of our players. He don't have save file for previous turn. Is it possible for AI to place a hero into castle garrison during his turn? I mean do AI has some code, allowing him such actions?

oleg-derevenetz commented 2 years ago

Unfortunately the issue was found by one of our players. He don't have save file for previous turn.

Maybe this player can tell the backstory in his own words? Did he (or she) notice how the hero arrived in this castle?

Is it possible for AI to place a hero into castle garrison during his turn?

If you mean setting the hero as a guardian - then no, AI cannot do that. AI heroes can enter castles only as guests. This hero is a castle guest too (occupies the bottom line in the castle).

Branikolog commented 2 years ago

Hi, @oleg-derevenetz Is it possible, that AI could hire new hero, while another is in the castle, so it appears in the garrison row., and then left there, after player captured the castle.

oleg-derevenetz commented 2 years ago

@Branikolog as I can see, AI shouldn't use castle to recruit a hero if there is already a guest hero in the castle, this is specifically checked when choosing a castle to hire a hero.

Branikolog commented 2 years ago

@Branikolog as I can see, AI shouldn't use castle to recruit a hero if there is already a guest hero in the castle, this is specifically checked when choosing a castle to hire a hero.

The player, that found an issue, thinks, that the hero was already in garrison, when he captured the castle.

oleg-derevenetz commented 2 years ago

@Branikolog Hmm, but AFAIK there is no way to capture the castle without fighting ALL heroes in the castle. So even if AI somehow managed to hire a guardian, this guardian should be defeated first, and only then the castle can be captured.

ihhub commented 1 year ago

So this is the problem with castle: allow guardians option and specifically with void AIToCastle() function where an AI hero kills a defender (guest) and then claims the castle.

This option is not properly implemented in many places like army strength evaluation or AI actions. As of now we are going to remove it.

oleg-derevenetz commented 1 year ago

As of now we are going to remove it.

Sad, it was a funny option.

ihhub commented 1 year ago

@oleg-derevenetz . if you would like to fix all cases and the mess with the code then we can keep it :)

zenseii commented 1 year ago

Since we want to remove the experimental options dialog, would it make the process quicker if we could move these options to only be present in the fheroes2.cfg file? I'm thinking about other options which are highly contested like increased knowledge skill in Arena, Wait, Spell book from Shrines etc.

It might be an OK compromise for those that want these, @ihhub?

ihhub commented 1 year ago

Hi @zenseii , I think we should rewrite at least the system for storing these options. They shouldn't be a part of the fheroes2.cfg file but something else. I am sure many people in the future are going to add more options so we need to have a flexible way to support this.

oleg-derevenetz commented 1 year ago

@ihhub Honestly I still don't know how this issue happened. I looked through the code and didn't understand how this could happen, and I was unable to reproduce this.

@zenseii The issue with experimental option is mainly that they are rarely taken into account when developing improvements, because few people use them. Also we can't store them just in fheroes2.cfg, because they affect the game balance. These options should be stored inside the savefile.

ihhub commented 1 year ago

@oleg-derevenetz , to make this option really good we should make both heroes which are in the castle join the battle :)

zenseii commented 1 year ago

@zenseii The issue with experimental option is mainly that they are rarely taken into account when developing improvements, because few people use them.

Yes. I do see streamers like AbsoluteZero use such features like Scouting giving extended info according to level. I honestly don't know how many use these features, and I also want to avoid lengthy discussions about whether or not they should be there by default.

Personally I prefer to keep the core gameplay to be as close to the original as possible.

They shouldn't be a part of the fheroes2.cfg file but something else.

This works too. I'm just trying to think of the way that will take the least amount of effort because we don't know what the returns will be for working on these options.

zenseii commented 1 year ago

@oleg-derevenetz , to make this option really good we should make both heroes which are in the castle join the battle :)

Maybe we could make garrisoned heroes fire with a catapult at each other from their castles? :grinning:

oleg-derevenetz commented 1 year ago

@ihhub

to make this option really good we should make both heroes which are in the castle join the battle :)

But they do. Guest hero participates in battle first, outside the castle, and then there is a separate battle with guardian near the castle walls.

Branikolog commented 1 year ago

Hi, @oleg-derevenetz !

As of now we are going to remove it.

Sad, it was a funny option.

Since Heroes2 has a captain for defending castles, placing heroes inside garrison makes this original mechanic needless, unlike in H3, where garrison heroes came from. Defending castles shouldn't be the same to H3, since these are different games after all.

oleg-derevenetz commented 1 year ago

Hi @Branikolog

Since Heroes2 has a captain for defending castles, placing heroes inside garrison makes this original mechanic needless, unlike in H3, where garrison heroes came from. Defending castles shouldn't be the same to H3, since these are different games after all.

Captain works differently: if there is already a guest hero in the castle, captain doesn't participate in battle at all, while guardian hero always participates in battle if guest hero lost his battle before that. Also, unlike HoMM3, guardian heroes are counted in the total limit of kingdom heroes, which somewhat weakens this feature and does not replace the captains as a whole. But, of course, guardian heroes are not included in the original HoMM2 mechanics.