Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#4605 closed defect (fixed)

SWORD1: Loss of background audio loop

Reported by: SF/jerrywoolsey Owned by: eriktorbjorn
Priority: normal Component: Engine: Sword1
Keywords: Cc:
Game: Broken Sword 1

Description

I've been playing the game with no problems except that on going to Marib I no longer have any of the backgound market sound loop. I have the music playing but that's it. I'll attatch my savegame for you to check out. I didn't see this problem being reported from anyone else.

This is on Vista 32, English CD version.

Ticket imported from: #2857910. Ticket imported from: bugs/4605.

Attachments (2)

sword1.000 (904 bytes) - added by SF/jerrywoolsey 10 years ago.
Savegame
sword1-ambience.diff (537 bytes) - added by eriktorbjorn 10 years ago.
Patch against current SVN (trunk)

Download all attachments as: .zip

Change History (8)

Changed 10 years ago by SF/jerrywoolsey

Attachment: sword1.000 added

Savegame

comment:1 Changed 10 years ago by SF/jerrywoolsey

Sorry, I forgot to mention that it's the RC1 of 1.0.0

comment:2 Changed 10 years ago by eriktorbjorn

It could be a missing feature, but if so it probably affects a lot more than just Marib.

I'm no expert on the Broken Sword 1 engine, but there are three different kinds of sound effects: spot, random and looping. Spot effects are played once, random effects are played randomly until the player leaves the room, and looping effects play continuously until the player leaves the room.

The sound effects are hard-coded in _fxList[] and there is an entry called "153 Marib ambience". It's a looping sound effect, and there's a list of volume settings for three different rooms where it should be played. (I haven't checked exactly what rooms these are.) There's also a list of "fixed sound effects", _roomsFixedFx[], which tells which sound effects are associated with each room.

Currently, there are two ways that I know of that a sound effect can be triggered: A script can ask for a sound effect to be played (probably mainly used for spot effects to go with animations), or it can be triggered as a random sound effect, using _roomsFixedFx[] to figure out which sound effects it should use in the current room. But this is odd, because _roomsFixedFx[] also refers to spot and looping effects.

I don't see much purpose for it to refer to spot effects myself, but it's possible that the game engine, not the scripts, is responsible for starting the room's looping sound effects. I noticed that there is a faint noise of traffic in the very first room when I play it with the original interpreter, but I can't hear it in ScummVM.

I'm going to attach a patch that triggers the looping effects automatically when entering a new room, but I don't know if it's the right thing to do. (It might be easy to figure out, since we got at least parts of the original source code from Revolution, but I don't know where that original code is. It may be that only some developers got access to it, so I'll have to ask around.)

Changed 10 years ago by eriktorbjorn

Attachment: sword1-ambience.diff added

Patch against current SVN (trunk)

comment:3 Changed 10 years ago by eriktorbjorn

I had the opportunity to look at the original code, and I could see that it is indeed the engine that's responsible for starting the looping sounds in the background. The ones I've noticed so far are rather faint, which is probably why the missing feature went unnoticed for all this time.

I've fixed it in the trunk, using a slightly modified version of the patch I attached, but I'll need to play around with the game a lot more before I decide if it can safely be applied to the 1.0 branch as well.

comment:4 Changed 10 years ago by eriktorbjorn

Owner: set to eriktorbjorn
Resolution: fixed
Status: newclosed

comment:5 Changed 10 years ago by eriktorbjorn

Summary: Loss of background audio loopSWORD1: Loss of background audio loop

comment:6 Changed 10 years ago by eriktorbjorn

I've added this fix to the 1.0 branch as well now. I played through the whole game without encountering any problems, and the sound effects it added all made sense to me. (Some were rather hard to make out, though.)

Note: See TracTickets for help on using tickets.