fheroes2
fheroes2 copied to clipboard
Crash when forcing an expansion map to work with only original map assets, for example w/ Demo version
Preliminary checks
- [X] I've checked that there aren't other open issues on the same topic.
- [X] I've checked that this issue is reproducible on the latest snapshot build.
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
Looking at 02:22:55. The name seems to be "01 Dраконы".
@zenseii , it looks like not the original map coming with the game.
@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 , 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.
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 , my bad, it is Ultimate Book of Knowledge
actually.
@zenseii , ultimate artifacts do not have any sprites so fading operation leads to a crash.
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.
@ihhub this is how the item appears in the original game:
I found the map in the MYP map pack in the Russian folder.
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.
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.
Hi, @zenseii It's an ultimate book of knowledge. UAs couldn't be placed on adventure map. This map is definitely not normal.
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 Oh. Can you confirm, that streamer had only SW(or demo) installed?
@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.
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, 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.
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.
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.