Opened 2 years ago

Last modified 21 months ago

#13555 closed defect

LSL6HIRES: Door close sound plays at wrong moment — at Version 4

Reported by: RayKoopa Owned by:
Priority: normal Component: Engine: SCI
Version: Keywords: sound
Cc: Game: Leisure Suit Larry 6

Description (last modified by RayKoopa)

ScummVM 2.7.0git101-gf37f00331ca (Jun 8 2022 14:35:39)
Game language: English
Game version: Hi-Res 1.000.000
Windows 11 21H2 10.0.22000.675

The soft bang sound when a door was closed plays at the wrong moment in case of the Sauna door:

Steps to reproduce:

  • Start a new game.
  • Go to the Health Spa, grab a towel.
  • Go to the Locker Room and undress with the towel.
  • Go to the mud baths, and enter the Sauna.
  • Leave the Sauna. Notice how the door does not close with a sound.
  • Do anything else generating a voice line. The door close sound will play once the voice line ended. - or - Click Game > Save-O-Matic™️ and accept or cancel the dialog to play the sound.

This also happens with the following doors:

  • Electro-Shock to Mud Bath
  • Mud Bath to Weight Room
  • Aerobics Room to Swimming Pool

This does not happen in lo-res.

In DOSBox, the door close sound plays once the door closes, as with any other door.

Change History (5)

by RayKoopa, 2 years ago

Attachment: lsl6hires.003 added

comment:1 by RayKoopa, 2 years ago

Description: modified (diff)

comment:2 by sluicebox, 2 years ago

Interesting, I don't know why this works in the original. The scripts pause the door-close sound immediately after playing it. Completing speech audio resumes paused sounds. Why does the door sound not pause in the original?

When entering mud bath (room 400) from the steam room (370) or the shock room (380):

  1. The door closes in handsOff mode
  2. Sound 33 plays with a Sound:flags value of 0
  3. LSL6:handsOn is immediately called
  4. LSL6:handsOn pauses all sounds that don't have flag $0001 set

Most sound objects in this game set flag $0001, the no-pause flag. Or, scenes are programmed like the entrance from the shower which waits on sound 33 to complete before calling handsOn.

That's why you can hear sound 33 briefly play and quickly stop. The background bubbles sound also pauses. In the original, only the bubbles pause. Maybe there's a timing thing where pausing doesn't work if the sample has just been queued to start? Or maybe a sample can't be interrupted with a pause at all? (The bubbles loop and aren't a sample)

I can eventually do some script-patch experiments to test some of these theories in the original.

comment:3 by RayKoopa, 2 years ago

Unrelated, but this reminds me of a bug in a custom game engine I worked on once.
A sound was queued to start but also told to stop before the sound system could put it into the "playing sounds" list. When telling it to stop, it immediately iterated over this list, didn't find the sound, and thus never set it's immediate stop state, so the sound just started playing completely once the sound system did the next update...
Maybe SCI works kinda similar, who knows - well at least I sadly don't ;-)

comment:4 by RayKoopa, 2 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.