fheroes2 icon indicating copy to clipboard operation
fheroes2 copied to clipboard

Crash when forcing an expansion map to work with only original map assets, for example w/ Demo version

Open zenseii opened this issue 2 years ago • 18 comments

Preliminary checks

Platform

Other

Describe the bug

A streamer found a crash when trying to pick up what I presume is an artifact on the map, but it looks to be hidden beneath some stones.

The stream was in Russian so maybe someone who speaks it will be able to understand better what might have caused it. It happened shortly after 2h21m15s: https://www.twitch.tv/videos/1634826358?t=02h21m15s

They are using the demo and the map is a downloaded one. It is possible to see the name of the map later in the video.

I'm not sure what OS they are using and I'm not entirely sure what fheroes2 version this is.

Save file

I asked the streamer if they could share a save file here or on Discord.

Additional info

No response

zenseii avatar Oct 26 '22 13:10 zenseii

Looking at 02:22:55. The name seems to be "01 Dраконы".

zenseii avatar Oct 26 '22 13:10 zenseii

@zenseii , it looks like not the original map coming with the game.

ihhub avatar Oct 26 '22 13:10 ihhub

@zenseii , it looks like not the original map coming with the game.

I see. In the video it is also noticeable how there is a hero with no portrait. The streamer had many experimental options enabled - castle guardian, mine guardian and possibly more, but I'm not sure this would explain such a behavior. My biggest guess is that there is some kind of bug carried over from the map editor in this map.

zenseii avatar Oct 26 '22 13:10 zenseii

@zenseii , the hero picked a Magic Book artifact which must not be present at the map. I assume this is a modified by hex editor map. The crash is due to an assertion. I think we can reproduce this.

ihhub avatar Oct 26 '22 13:10 ihhub

Ah well that is probably the reason for the crash. I thought maybe it was the Book of Elements when the streamer said book, but he did right click it so that would show what it was exactly. Luckily he had the scouting experimental option enabled.

zenseii avatar Oct 26 '22 13:10 zenseii

@zenseii , my bad, it is Ultimate Book of Knowledge actually.

ihhub avatar Oct 26 '22 14:10 ihhub

@zenseii , ultimate artifacts do not have any sprites so fading operation leads to a crash.

ihhub avatar Oct 26 '22 14:10 ihhub

It should not be possible to place ultimate artifacts on the map with the editor so presumably the map creator hacked the map to make it possible.

I'm curious about how the original game would behave in this situation, but I'm not able to find this map.

zenseii avatar Oct 26 '22 14:10 zenseii

@ihhub this is how the item appears in the original game: image

I found the map in the MYP map pack in the Russian folder.

zenseii avatar Oct 26 '22 14:10 zenseii

It turns out this item is the Battle Garb of Anduran and so it should be an expansion map. It should not be possible to load it in the Demo version because that is an expansion artifact.

zenseii avatar Oct 26 '22 14:10 zenseii

The map file name is "01_Drago.mx2". It is possible with the map creator to place the Battle Garb of Anduran so this is something wrong with the fheroes2 code.

I will have a look at what item appears with expansion assets in fheroes2.

EDIT: In fheroes2 with the expansion assets it behaves as the Battle Garb of Anduran, in other words it behaves as it should.

zenseii avatar Oct 26 '22 14:10 zenseii

Hi, @zenseii It's an ultimate book of knowledge. UAs couldn't be placed on adventure map. This map is definitely not normal.

Branikolog avatar Oct 26 '22 14:10 Branikolog

Hi, @zenseii It's an ultimate book of knowledge. UAs couldn't be placed on adventure map. This map is definitely not normal.

Hi, @Branikolog. I found out that this map is perfectly fine, but it is an expansion map with the artifact Battle Garb of Anduran placed there, which is completely possible to do in the original map editor.

So the problem here is that they loaded up an expansion map without the expansion assets.

zenseii avatar Oct 26 '22 14:10 zenseii

@zenseii Oh. Can you confirm, that streamer had only SW(or demo) installed?

Branikolog avatar Oct 26 '22 16:10 Branikolog

@zenseii Oh. Can you confirm, that streamer had only SW(or demo) installed?

Yes I confirmed this from the stream where they have the campaign button disabled.

This is their main menu. image

zenseii avatar Oct 26 '22 16:10 zenseii

So the problem here is that they loaded up an expansion map without the expansion assets.

It's hard to say how he was able to do this, because MX2 maps should be filtered out if there is no HEROES2X.AGG file in the DATA folder:

https://github.com/ihhub/fheroes2/blob/9179618f5b80a2d66dbd55bc81788f991683486d/src/fheroes2/maps/maps_fileinfo.cpp#L572-L575

I just tried to load MX2 map with OG assets from demo version (naturally, SW-only assets) and was unable to load it, because it was filtered out from the map list, just like it should be.

oleg-derevenetz avatar Oct 26 '22 19:10 oleg-derevenetz

@oleg-derevenetz, I just tested with the exact map file too and as predicted it did not show up. My only guess is that this user or someone else renamed the file to the .mp2 extension and that made it show up and possible to run. I did test this and it works and would explain how this user accomplished this. There is nothing we can nor should do if a user does this as far as I'm concerned, unless we want to implement more checks that a map file is indeed only intended for the game with expansion.

zenseii avatar Oct 28 '22 07:10 zenseii

I'm lowering down the priority for this issue as this is clearly a hack from a streamer to abuse an absence of purchased copy of the original game.

ihhub avatar Nov 05 '22 17:11 ihhub

I am closing this issue as we made certain changes in the past to prevent abusing demo version to play PoL maps. I hope that these changes are enough.

ihhub avatar Mar 21 '23 15:03 ihhub