Opened 3 months ago

Closed 2 months ago

Last modified 2 months ago

#15336 closed defect (fixed)

SCI: KQ6: ScummVM closes when trying to load a game save

Reported by: domino1983 Owned by: athrxx
Priority: normal Component: Engine: SCI
Version: Keywords:
Cc: Game: King's Quest 6

Description

Load the included savegame. Wait one minute for Alexander to turn into a beast. Then try to load any savegame - ScummVM will just close without any error.

Tested on 2.8.1 win64. KQ6 CD Windows english GOG version.

Attachments (1)

kq6-cd-win.028 (43.1 KB ) - added by domino1983 3 months ago.

Download all attachments as: .zip

Change History (8)

by domino1983, 3 months ago

Attachment: kq6-cd-win.028 added

comment:1 by antoniou79, 3 months ago

I can reproduce it with a recent developer build, 2.9.0git on Windows.

I've waited a few minutes for Alexander to transform and then tried to reload the same saved game from the death screen options.

The error message is:

Assertion failed: _globalPause == 1, file engines/sci/sound/music.cpp, line 328

Also, if I choose "Restart" from the death screen, the game early intro stuff plays normally but then at the Logo screen, choosing to Restore a game results in the same error as above.

Last edited 3 months ago by antoniou79 (previous) (diff)

comment:2 by antoniou79, 3 months ago

Summary: ScummVM closes when trying to load a game save.SCI: KQ6: ScummVM closes when trying to load a game save

comment:3 by eriktorbjorn, 2 months ago

I didn't have any trouble loading the savegame. Does it make a difference if you're using the original save/restore dialogs (I did) or not?

Version 0, edited 2 months ago by eriktorbjorn (next)

comment:4 by domino1983, 2 months ago

Yes, this only happens when I use ScummVM dialogs.

comment:5 by eriktorbjorn, 2 months ago

It seems that before the transformation, the kDoSoundPause() function is called four times. Each call increases _globalPause by 1.

When restoring the game, if you're using the ScummVM dialogs kRestoreGame() will call resetGlobalPauseCounter(), which asserts that _globalPause is 1, not 4.

If you're using the original dialogs, resetGlobalPauseCounter() is not called, and after you've loaded the savegame _globalPause is still 4. If you wait again for the transformation, _globalPause will become 8, and so on.

This is the SCI call stack the first time kDoSoundPause() is called:

Call stack (current base: 0x0):
 0: script 994 - Kq6::replay()
     obj@0001:1f4d pc=000a:045f sp=ST:0001 fp=ST:0000 argp:ST:0001
 1: script 994 - Kq6::doit()
     by 0 obj@0001:1f4d pc=000a:05b6 sp=ST:0006 fp=ST:0003 argp:ST:0002
 2: script 999 - timers::eachElementDo(0000:0039)
     by 1 obj@000a:10ca pc=0005:0474 sp=ST:000c fp=ST:0009 argp:ST:0007
 3: script 0 - beastTimer::doit()
     by 2 obj@0001:22c5 pc=0001:1af4 sp=ST:000e fp=ST:000e argp:ST:000d
 4: script 973 - Timer::doit()
     by 3 obj@0001:22c5 pc=0010:0126 sp=ST:0011 fp=ST:0010 argp:ST:000f
 5: script 973 - call 68 ()
     by 4 obj@0001:22c5 pc=0010:00a1 sp=ST:0013 fp=ST:0012 argp:ST:0011
 6: script 907 - ring::cue()
     by 5 obj@002c:3f5d pc=002c:2590 sp=ST:0015 fp=ST:0015 argp:ST:0014
 7: script 900 - rm250::setScript(0107:0368)
     by 6 obj@0109:16b1 pc=0019:02b5 sp=ST:0019 fp=ST:0018 argp:ST:0016
 8: script 994 - Rm::setScript(0107:0368)
     by 7 obj@0109:16b1 pc=000a:0b7a sp=ST:001c fp=ST:001c argp:ST:001a
 9: script 999 - egoBeastScript::init(0109:16b1)
     by 8 obj@0107:0368 pc=0005:0755 sp=ST:001f fp=ST:001f argp:ST:001d
 a: script 999 - egoBeastScript::cue()
     by 9 obj@0107:0368 pc=0005:0803 sp=ST:0021 fp=ST:0021 argp:ST:0020
 b: script 84 - egoBeastScript::changeState(0000:0000)
     by a obj@0107:0368 pc=0107:0034 sp=ST:00ee fp=ST:0024 argp:ST:0022
 c: script 0 - Kq6::killSound(0000:0001)
     by b obj@0001:1f4d pc=0001:117c sp=ST:00f3 fp=ST:00f3 argp:ST:00f1
 d: script 999 - Sounds::eachElementDo(0000:00af, 0000:0001)
     by c obj@000a:1076 pc=0005:0474 sp=ST:00fa fp=ST:00f7 argp:ST:00f4
 e: script 989 - globalSound::pause(0000:0001)
     by d obj@0001:1e2b pc=0004:0140 sp=ST:00fd fp=ST:00fd argp:ST:00fb

Subsequent calls appear to be the same, except the last line will refer to globalSound2, globalSound3 and globalSound4.

I hope this means something to someone, because it means very little to me.

comment:6 by bluegr, 2 months ago

Owner: set to athrxx
Resolution: fixed
Status: newclosed

comment:7 by eriktorbjorn, 2 months ago

I'm still worried about _globalPause running away like this. Even restarting the game won't set it back to 0 it seems, but I don't know if this actually causes problems or if it's just strange.

Note: See TracTickets for help on using tickets.