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

Game crashes when starting mission 3 from "The Good" original campaign #7821

Closed PhilippKilian closed 1 year ago

PhilippKilian commented 1 year ago

Preliminary checks

Platform

Linux

Describe the bug

steps to reproduce

Save file

Don't know how to provide this file (couldn't figure out the location of this file). Would provide it when given a hint, where I can find it...

~/Games/fheroes2 » ls
anim/
data/
extract_homm2_resources.sh
files/
maps/
README.txt
changelog.txt
download_demo_version.sh
fheroes2
LICENSE
music/
script/

Additional info

when using the release file 1.0.8:

~/Games/fheroes2 » ./fheroes2        
fheroes2 engine, version: 1.0.8
fheroes2: ../fheroes2/maps/maps_tiles.cpp:515: void Maps::Tiles::Init(int32_t, const MP2::mp2tile_t&): Assertion `( ( ( mp2.quantity2 << 8 ) + mp2.quantity1 ) >> 3 ) == 0' failed.
[1]    12445 IOT instruction (core dumped)  ./fheroes2

when using the last develop file (still version 1.0.8):

~/Games/fheroes2 » ./fheroes2                                134 ↵
fheroes2 engine, version: 1.0.8
fheroes2: ../fheroes2/maps/maps_tiles.cpp:491: void Maps::Tiles::Init(int32_t, const MP2::mp2tile_t&): Assertion `_metadata[0] == 0' failed.
[1]    12652 IOT instruction (core dumped)  ./fheroes2
ihhub commented 1 year ago

Hi @PhilippKilian , it seems that this map is corrupted or has invalid map format. The assertion was made exactly to catch this issue and we tested literally several hundreds official maps for this check.

Could you please tell us where did you get this version of the game?

PhilippKilian commented 1 year ago

@ihhub It's the Version from gog.com

To check if a map was corrupted or invalid, i backup my maps folder and replaced the files with the ones from the original download. Now the Mission starts normally:

grafik

ihhub commented 1 year ago

@PhilippKilian , was it a German version you were using before?

PhilippKilian commented 1 year ago

@PhilippKilian , was it a German version you were using before?

@ihhub It's still the German version. But some mission start text boxes are in english. Don't know why everything else is in german.

ihhub commented 1 year ago

This is definitely the problem with map format:

******* Tile info *******
Tile index      : 1837, point: (37, 25)
UID             : 0
MP2 object type : 20 (Dragon City)
ICN object type : 0 (UNKNOWN)
image index     : 255
layer type      : 0 - Object layer
region          : 10
ground          : Snow (isRoad: 0)
ground img index: 136, image flags: 0
shadow          : false
passable from   : center, top, top-right, right, bottom-right, bottom, bottom-left, left, top-left
metadata value 1: 0
metadata value 2: 0
metadata value 3: 0
--------- Level 2 --------
UID             : 1820
ICN object type : 41 (OBJNMUL2.ICN)
image index     : 34
layer type      : 0 - Object layer
is shadow       : yes
--- Extra information ---
*************************

There is no object at this tile. The same structure for the 'fixed' map.