Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#6196 closed defect (fixed)

DREAMWEB: Corruption of inventory items

Reported by: SF/kriz1 Owned by: wjp
Priority: normal Component: Engine: Dreamweb
Version: Keywords:
Cc: Game: Dreamweb

Description

ScummVM version: 1.5.0 32bit OS: Windows 8 64bit Dreamweb Freeware CD UK

The graphics of items in my inventory seem to be steadily corrupting as I pick up new items (those that I haven't picked up yet. It doesn't occur with picking up dropped items). Some inventory items even change there name or description indicating a completely differrent item than it really is. Some items even disappear completely from inventory (the workaround for this is to drop the item that might disappear before picking up a new item). It also seems to influence certain items that have been dropped and are not neccessary in the inventory at the time. At it's peak, after picking up several dozen items, the corruption influences even parts of the game screen itself. I've attached two save files to this report. The first one demonstrates how the corruption occurs (look at the first inventory tab, then pick up the railing in front of Ryan and see what happens to the items in the inventory). The second one is just before the ending of the game and shows how corruption of items in the inventory has spread. If you want to you can also go to Ryan's appartment and see how the items that I dropped from my inventory have also been corrupted (there should some laying around on the ground in front of bed and some that I have put in to the drawers on the right).

Ticket imported from: #3591088. Ticket imported from: bugs/6196.

Attachments (5)

DREAMWEB.D02 (21.7 KB ) - added by SF/kriz1 12 years ago.
Save file before picking up the railing
DREAMWEB.D04 (19.9 KB ) - added by SF/kriz1 12 years ago.
Save file near the end of the game
Inv-Before-Railing.png (30.0 KB ) - added by digitall 12 years ago.
D02- Inventory Before Picking Up Railing
Inv-After-Railing.png (30.3 KB ) - added by digitall 12 years ago.
D02 - Inventory After Picking Up Railing
Inv-At-Endgame.png (29.3 KB ) - added by digitall 12 years ago.
D04 - Corrupted Inventory at Endgame

Download all attachments as: .zip

Change History (24)

by SF/kriz1, 12 years ago

Attachment: DREAMWEB.D02 added

Save file before picking up the railing

by SF/kriz1, 12 years ago

Attachment: DREAMWEB.D04 added

Save file near the end of the game

comment:1 by SF/kriz1, 12 years ago

Priority: normalhigh

comment:2 by wjp, 12 years ago

Priority: highnormal

comment:3 by wjp, 12 years ago

Thanks for the report, but please don't touch the priority setting :-)

comment:4 by SF/kriz1, 12 years ago

Ooops...sorry. It's my first bug report :).

comment:5 by wjp, 12 years ago

No problem. We'll try to reproduce it, and then get back to you.

comment:6 by misterhands, 12 years ago

I have noticed something odd with the inventory myself. It could be the same problem. At the beginning of the game, after you picked up the wallet sometimes 1, 2 or all 3 items inside it are missing. Unfortunately it is one of those dreaded rare and random bugs that only appear when they feel like it... And obviously I had to get this bug the very first time I tried the game so I had to start over :-)

comment:7 by digitall, 12 years ago

wjp, kriz1: I can replicate both of the described issues on Linux x86_32 using the attached savegames on the latest Git master i.e. ScummVM 1.6.0git2157-g863bbf2-dirty (Nov 29 2012 03:58:44)

It may be that the trigger for this bug is 64-bit or Windows specific. I'll see if we have any bad accesses with Valgrind loading and showing the corruption and then will look at the savestates to try to work out what is going on here.

comment:8 by digitall, 12 years ago

Attaching screenshots showing the observed corruptions.

Note that even before picking up the railing, the shades lower right side looks like it might have a minor corruption, so this may be a minor glitch that then propagates through the inventory structure in the savegames.

by digitall, 12 years ago

Attachment: Inv-Before-Railing.png added

D02- Inventory Before Picking Up Railing

by digitall, 12 years ago

Attachment: Inv-After-Railing.png added

D02 - Inventory After Picking Up Railing

by digitall, 12 years ago

Attachment: Inv-At-Endgame.png added

D04 - Corrupted Inventory at Endgame

comment:9 by digitall, 12 years ago

No memory issues observed with Valgrind... Looking at the inventory code.

comment:10 by digitall, 12 years ago

Have run git bisection on the Dreamweb engine... Testing with the savegame, this doesn't appear to be a regression.

The relevant code is in scummvm/engines/dreamweb/object.cpp, specifically the inventory items are drawn by the code in the function: void DreamWebEngine::obToInv(uint8 index, uint8 flag, uint16 x, uint16 y)... trying to trace down to the object icon drawing code.

comment:11 by digitall, 12 years ago

Hmm... The object icons appear to be cached into the _exFrames extra block of the savegame file, hence these savestates are "damaged" and thus I can replicate. This may be a problem with the void DreamWebEngine::savePosition(unsigned int slot, const char *descbuf) code in scummvm/engines/dreamweb/saveload.cpp, which mixes Serializer code around the direct OutSaveFile writing. Not sure if this is safe to do...

kriz1: Can you please try from a clean new game start, then immediately save and attach that savegame to this bug... then play the game through to the railing and attach that savegame to the bug for reference.. i.e. a) Does the bug consistly manifests (or was this a obscure issue which caused a corrupt savestate) and b) to give us an idea if this happens immediately or only progressive corruption of _exFrames block on successive save/load cycles.

comment:12 by SF/kriz1, 12 years ago

I'm not sure if it is relevant, but I've actually used the original save/load menu to save my game (that is why the save thumbnails appearing in Scummvm loading list show the save menu from the game instead of actuall area of the game).

comment:13 by wjp, 12 years ago

The corruption when picking up the railing from the D02 savegame is caused by overlapping frames in _exFrames in that savegame.

It looks like this may have been caused by inverted checks in purgeAnItem(), which can cause deleted items to be re-deleted, causing frame data corruption.

comment:14 by digitall, 12 years ago

kriz1: Looks like we have located the cause of this. wjp will look at a fix for this later, then will ask you to test the next nightly build.

comment:15 by wjp, 12 years ago

I have just committed a fix to a bug causing frame data corruption that was very likely responsible for this. Unfortunately the two save games you uploaded have already been corrupted by this bug and I see no easy way to repair existing save games.

comment:16 by wjp, 12 years ago

Owner: set to wjp
Resolution: fixed
Status: newclosed

comment:17 by SF/kriz1, 12 years ago

That's not a very big problem that you can't do anything to repair my save games, since you can probaly guess that I have already completed the game. I'm just glad that I've commited something to fix this. Should I now test the nigtly build? If so, is it safe to install it along the stable one and where can I download it?

comment:18 by digitall, 12 years ago

kriz1: You can find the nightly/daily builds from here: http://www.scummvm.org/downloads/#daily wjp has now added a sanity check has been added for exFrames corruption, so your older savegames will cause an error on loading, but feel free to test with this from a new start. It is perfectly safe to have multiple copies of ScummVM, though don't use the installer (as this will overwrite the start menu links I think), just get the Win32 version from Buildbot and extract the archive in into another folder and run.

comment:19 by SF/kriz1, 12 years ago

Actually it seems that I'm able to load only my earliest save game (that's probably, because the corruption didn't affect it yet). The other one's of course don't load.

Note: See TracTickets for help on using tickets.