Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#15550 closed defect (fixed)

SCI: KQ5CD Issue/bug with game freezing in mountains

Reported by: LaZar00 Owned by: sluicebox
Priority: normal Component: Engine: SCI
Version: Keywords:
Cc: LaZar00 Game: King's Quest 5

Description (last modified by LaZar00)

ScummVM Version: 2.9.0 master branch

Game/Language: KQ5 CD Talkie English (GOG version)

OS: PC Windows 11

I found this issue while walking in the mountains and jumping. When Graham goes to the edge of the mountain and falls, he exclaims "Arghhhh...." and then appears the death window (EgoDead) to load, restore a game. This works well in various rooms (29, 30, 31...).

The issue/bug I found is in "room 31", where are the stepping stones (jumping). I can jump to the first left stone. Then, if you step on to the second, if you don't click correctly you can fall from jumping (is a different script). Then Graham falls, with the "Arghhhh...." exclamation, the cursor is with the hourglass, and after the audio, nothing happens. The game does not respond. You can test it going directly to "room 31" and walk to the left crossing the trunk to the stones.

I'm not sure if this is a bug in scummvm. I tested in dosbox spanish KQ5 floppy version and works well. I tested this with a vanilla KQ5CD version of GOG install with 2.9.0 branch master and fails. But I have not been able to test it in 2.0.0 (the version supplied with dosbox) because it seems to not have debug and I should play all the game.

Attachments (2)

code.jpg (175.6 KB ) - added by LaZar00 3 months ago.
mountainstone.jpg (296.5 KB ) - added by LaZar00 3 months ago.

Download all attachments as: .zip

Change History (9)

by LaZar00, 3 months ago

Attachment: code.jpg added

by LaZar00, 3 months ago

Attachment: mountainstone.jpg added

comment:1 by LaZar00, 3 months ago

Description: modified (diff)

comment:2 by sluicebox, 3 months ago

Eeek, this is a ScummVM regression introduced between versions 2.2.0 and 2.5.0.

So... probably my fault =)

Thanks for another well written bug report, I can reproduce and will bisect.

comment:3 by eriktorbjorn, 3 months ago

This is what I got when I tried bisecting:

de9443407fd28cd71ac568ec2326191129243517 is the first bad commit
commit de9443407fd28cd71ac568ec2326191129243517
Author: sluicebox <22204938+sluicebox@users.noreply.github.com>
Date:   Sun Feb 21 22:27:53 2021 -0800

    SCI: kDoAudio stops samples played with kDoSound

 engines/sci/engine/ksound.cpp  | 6 ++++++
 engines/sci/sound/music.cpp    | 9 +++++++++
 engines/sci/sound/music.h      | 1 +
 engines/sci/sound/soundcmd.cpp | 4 ++++
 engines/sci/sound/soundcmd.h   | 1 +
 5 files changed, 21 insertions(+)

So I can "fix" it by removing the call to g_sci->_soundCmd->stopAllSamples() from the kSciAudioWPlay / kSciAudioPlay case of kDoAudio. But I don't know how much that will break.

comment:4 by sluicebox <22204938+sluicebox@…>, 3 months ago

In 3ac2492:

SCI: Fix KQ5 CD lock up when falling in mountains

Fixes bug #15550

This began occurring in 2021 when kDoAudio was fixed to stop all
currently playing digital samples. The fix exposed that the KQ5 CD
mountain script is incompatible with playing digital samples from
within sound resources. The KQ5 CD sound driver never played these
samples, and the script was not written to handle this condition.
We play all samples when "prefer_digitalsfx" is enabled, and it is
enabled by default, so now we patch out the script incompatibility.
See: de9443407fd28cd71ac568ec2326191129243517

Thanks to @LaZar00 for reporting.

Thanks to @MusicallyInspired for audio consulting and testing.

comment:5 by sluicebox, 3 months ago

Owner: set to sluicebox
Resolution: fixed
Status: newclosed

Thank you!

This can be worked around in earlier versions of ScummVM by unchecking "Prefer digital sound effects" on our Game Options dialog.

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

comment:6 by sluicebox, 3 months ago

Game: King's Quest 5

comment:7 by sluicebox <22204938+sluicebox@…>, 3 months ago

In a99c1a43:

SCI: Fix KQ5 CD lock up when falling in mountains

Fixes bug #15550

This began occurring in 2021 when kDoAudio was fixed to stop all
currently playing digital samples. The fix exposed that the KQ5 CD
mountain script is incompatible with playing digital samples from
within sound resources. The KQ5 CD sound driver never played these
samples, and the script was not written to handle this condition.
We play all samples when "prefer_digitalsfx" is enabled, and it is
enabled by default, so now we patch out the script incompatibility.
See: de9443407fd28cd71ac568ec2326191129243517

Thanks to @LaZar00 for reporting.

Thanks to @MusicallyInspired for audio consulting and testing.

Note: See TracTickets for help on using tickets.