fheroes2 icon indicating copy to clipboard operation
fheroes2 copied to clipboard

Fix placing "Month of" monsters on the map to avoid Events removing

Open Districh-ru opened this issue 6 months ago • 3 comments

The issue is posted by @zenseii here https://github.com/ihhub/fheroes2/pull/9888#pullrequestreview-2913306004 and here https://github.com/ihhub/fheroes2/pull/9888#issuecomment-2959143434

This PR make the "spawning" algorithm to skip tiles with event so the monster will not "overwrite" it.

It also updates initialization of excludeTiles set for Heroes, Castles and Monsters to exclude extra checks in isTileBlockedForSettingMonster(). It was done to avoid placing monster right near the hero when findSuitableNeighbouringTile() checks the bottom and left tiles (that were not previously checked to place them in excludeTiles).

Now all the map is checked for Heroes, Castles and Monsters first and only then the suitable tiles are found in the next loop.

Districh-ru avatar Jun 10 '25 15:06 Districh-ru

@Districh-ru, my first question is whether we know that event bubbles in the original game made it impossible for creatures to spawn on that tile. This might be tricky to test...

zenseii avatar Jun 10 '25 19:06 zenseii

@Districh-ru, my first question is whether we know that event bubbles in the original game made it impossible for creatures to spawn on that tile. This might be tricky to test...

@zenseii, I'll try to test it later today with GOG version. But most likely the OG do not place monsters above events (or have the same rare bug).

EDIT: And it is really hard to trigger "Month of" monster when it is needed... :(

And the OG has 50 events limit.. :(

Districh-ru avatar Jun 11 '25 06:06 Districh-ru

@zenseii, I've tried to make a map to get monsters "of month" spawning, but in the original game it was very rare. I mean if it is a Month of monster then only in rare times one monster is spawned. So I cannot certainly say that that is I place event and there are no monsters spawned that it is because of event. I give up for now (it needs a lot of time for testing) and leave a TODO... :(

Districh-ru avatar Jun 11 '25 15:06 Districh-ru

@Districh-ru , thank you so much for this fix!

ihhub avatar Jun 17 '25 00:06 ihhub