Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#6767 closed defect (fixed)

ZVISION: Ambient sounds keep playing after leaving the relevant area

Reported by: SF/tnm23 Owned by: bluegr
Priority: normal Component: Engine: ZVision
Keywords: Cc:
Game: Zork Grand Inquisitor

Description

Scummvm version: ScummVM 1.8.0git (Jan 16 2015 10:31:43)
Features compiled in: TAINTED Vorbis FLAC MP3 ALSA SEQ TiMidity RGB zLib MPEG2 Theora AAC FreeType2 JPEG PNG Optimised/Release build.

Bug details: Sometimes ambient sound effects keep playing after leaving their area. For example, the heartbeat can still be heard after walking out of the castle.

English language edition of ZGI, 2 CD release. Installed under wine, official patch applied, then all required files copied into /usr/share/scummvm/zgi

Debian Wheezy 7.8, Kernel 3.2.0-4-amd64 (#1 SMP Debian 3.2.65-1), gcc version 4.7 (x86_64-linux-gnu)

Steps to reproduce: Play as normal. Enter area with ambient sound effects. Leave area.

Ticket imported from: bugs/6767.

Attachments (1)

zgi-win.013 (24.3 KB ) - added by SF/tnm23 5 years ago.

Download all attachments as: .zip

Change History (6)

by SF/tnm23, 5 years ago

Attachment: zgi-win.013 added

comment:1 by bluegr, 5 years ago

Summary: Ambient sounds keep playing after leaving the relevant areaZVISION: Ambient sounds keep playing after leaving the relevant area

comment:2 by bluegr, 5 years ago

This seems to be a problem with how the universe_music script command is handled for ZGI (Nemesis doesn't use such functionality).

universe_music is supposed to set a sound that will only be used for a specific "universe" (world + room, I suppose?)

The script in question is dc10.scr

This does:
action:universe_music:02310(0 dc10q01p.raw 1 100) # dc10_heart_sound
action:pan_track:02311(02310 1110) # dc10_heart_sound

Upon exiting the scene, slot 2311 (the pan track) is killed, but slot 2310 (the heartbeat sound effect) is not killed, as it's a universal track. There's a check in the ActionMusic destructor:

ActionMusic::~ActionMusic() {
if (!_universe)
_engine->getScriptManager()->killSideFx(_slotKey);
}

I'm not sure where track 2310 is supposed to stop. It should either stop when pan_track is killed, or when the room changes, or by game scripts. I can't find a game script that stops the sound itself, or all sounds of that type when exiting the castle.

This will need some checking with the original interpreter.

comment:3 by SF/tnm23, 5 years ago

Possibly related to this bug, ambient sound effects don't decrease in volume as you get further away, as long as you're still close enough to be able to hear them at all. This causes them to drown out other sounds in some cases. The beehive and the electric fence are two of the most noticeable examples. I'm not sure whether to open a separate ticket for this; I guess it's all part of the same code.

comment:4 by bluegr, 5 years ago

Owner: set to bluegr
Resolution: fixed
Status: newclosed

comment:5 by bluegr, 5 years ago

This has been fixed with the changes in pull request #568:

https://github.com/scummvm/scummvm/pull/568

Many thanks to the original ZEngine developer, Anton Yarcev!

Closing as fixed

Note: See TracTickets for help on using tickets.