Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#5893 closed defect (fixed)

SWORD1: Wrong background sound in Windows demo

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

Description

When playing the English Windows demo of Broken Sword 1, there is always the repetitive endless chirping of a bird which is very annoying. (NB: The Mac demo seems not to have this issue.)

It seems to be there in 1.2.0 and was not there in 1.0.0 rc1.

I checked with the latest Daily Build from October 29, 2011 to make sure this bug is still present.

Ticket imported from: #3431552. Ticket imported from: bugs/5893.

Attachments (5)

dumpsword.c (9.4 KB ) - added by eriktorbjorn 12 years ago.
Program to extract sound effects data from DOS/Windows demo
fullres.txt (60.8 KB ) - added by eriktorbjorn 12 years ago.
Sound effects list from staticres.cpp, reformatted for easier comparision
demores.txt (54.6 KB ) - added by eriktorbjorn 12 years ago.
Sound effects list from DOS/Windows demo, reformatted for easier comparision
dumpsword.2.c (9.6 KB ) - added by eriktorbjorn 12 years ago.
Updated version, but the chances are just cosmetical.
sword1demo.diff (27.9 KB ) - added by eriktorbjorn 12 years ago.
One possible patch against current git

Download all attachments as: .zip

Change History (16)

comment:1 by digitall, 12 years ago

Replicated with latest Git master on Linux x86_32. Bisecting to locate the point of regression.

comment:2 by digitall, 12 years ago

Bisection shows that this bug was introduced by the following commit: commit 9cc0dc3d9126245afda5e3e3605ecdae18c84767 Author: Torbj��rn Andersson <eriktorbjorn@users.sourceforge.net> Date: Sun Sep 13 21:38:47 2009 +0000

Fixed bug #2847910, "Loss of background audio loop". It would probably be safe to backport this to the 1.0 branch, but I'm not 100% sure, and it's getting pretty late here. (On the other hand, the missing sound effects are pretty faint, at least in the cases I've seen, so we haven't been missing much. That's probably why it's gone unnoticed until now.)

svn-id: r44073

comment:3 by digitall, 12 years ago

I should note that the refrenced bug is #2857910 "SWORD1: Loss of background audio loop", rather than #2847910 as noted in that commit message: https://sourceforge.net/tracker/index.php?func=detail&aid=2857910&group_id=37116&atid=418820

This should allow checking of an amended fix which corrects the Marib market issue without side effects.

comment:4 by eriktorbjorn, 12 years ago

I tried the Windows demo in DOSBox, and ScummVM definitely isn't playing the correct sound effect. The only looping sound that's supposed to be in the first room is the drone of traffic; what is called FX_TRAFFIC2 in staticres.cpp. I believe _fxList[] is a list of all the possible sound effects in the game, with some directions about how they should be played, and _roomsFixedFx[] is a list of sound effects that are played in each location. (So all of this is hard-coded into the game engine itself, rather than being scripted.)

My almost completely unsubstantiated guess is that the DOS/Windows demo has a slightly different hard-coded value for FX_TRAFFIC2, but I lack the tools and expertise to figure that out. I did notice that the PARIS1.CLU file from the demo has a slightly different size than the one in the full game, which could indicate a slightly different set of resources.

comment:5 by eriktorbjorn, 12 years ago

I think I have found the start of _fxList[] in SWORD.EXE and WINSWORD.EXE (which, of course, should be the same in this regard), so I may be able to reconstruct the list for the demo, and create a mapping for it. It'll take a bit of time, of course.

comment:6 by digitall, 12 years ago

eriktorbjorn: Ah good. Thanks for looking at this...

by eriktorbjorn, 12 years ago

Attachment: dumpsword.c added

Program to extract sound effects data from DOS/Windows demo

comment:7 by eriktorbjorn, 12 years ago

I've attached my program to extract the sound effects data structure from the demo's SWORD.EXE or WINSWORD.EXE. I haven't studied the resource files themselves, but the structure I'm generating seems pretty similar to the one already in staticres.cpp. Mind you, I'm not suggesting adding a whole new sound effects list even if there are some minor differences in the roomVolList for some of the effects, that's probably not worth the trouble of replicating.

Rigth now, I have two ideas on how to adjust the resource id. One idea is to write a function to remap the id for the demo. This is probably fairly easy, since it seems that most of the differences are from sound effects missing, causing the subsequent ones to be renumbered. The other idea is to store the alternative id in the _fxList[] data structure. This could probably be done without increasing the size of the data structure by replacing the id with an array containing the most significant byte (0x06, 0x07, ..., 0x0E), and the least significant bytes for the demo and full game.

The second idea is slightly more intrusive, I guess.

by eriktorbjorn, 12 years ago

Attachment: fullres.txt added

Sound effects list from staticres.cpp, reformatted for easier comparision

by eriktorbjorn, 12 years ago

Attachment: demores.txt added

Sound effects list from DOS/Windows demo, reformatted for easier comparision

by eriktorbjorn, 12 years ago

Attachment: dumpsword.2.c added

Updated version, but the chances are just cosmetical.

comment:8 by eriktorbjorn, 12 years ago

I've attached reformatted sound effects lists from the full game (staticres.cpp) and the demo to make it easier to compare. The main difference is, of course, that a lot of sound effects are missing from the demo. Other than that, there are some differences in volume settings and delay/chance, but as I said before I don't think that's worth the trouble to fix.

by eriktorbjorn, 12 years ago

Attachment: sword1demo.diff added

One possible patch against current git

comment:9 by eriktorbjorn, 12 years ago

And now I've attached a possible patch. It seems to work for me, though I've only given it a quick test.

comment:10 by eriktorbjorn, 12 years ago

I've played through the demo without noticing any problems, so I've committed a slightly updated version of the patch to the trunk.

comment:11 by eriktorbjorn, 12 years ago

Owner: set to eriktorbjorn
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.