Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#1224 closed defect (fixed)

MI2: Music stops in LeChuck's fortress

Reported by: eriktorbjorn Owned by: SF/jamieson630
Priority: normal Component: Engine: SCUMM
Keywords: Cc:
Game: Monkey Island 2

Description

Monkey Island 2 Recent CVS snapshot AdLib music

The headline is perhaps a bit misleading. I have two savegames: One of them is just before going to LeChuck's fortress, and one is in LeChuck's fortress, right before finding Wally.

If I load the second savegame, the music stops after 65-70 seconds, probably right at the point where it's supposed to start a different variation of the background music. If I load the earlier savegame and go to the fortress, the music will continue playing for as long as I have cared to listen to it.

However, if I then save and reload the resulting savegame, the music stops shortly afterwards. It looks as if something about the music state isn't properly saved and/or restored.

I was also surprised at how little music there was before Guybrush emerged from the crate. It is, after all, a pretty important event in the game, but maybe this is how it really was meant to sound.

Ticket imported from: #805593. Ticket imported from: bugs/1224.

Attachments (2)

monkey2.s32.gz (14.4 KB ) - added by eriktorbjorn 17 years ago.
Savegame before going to LeChuck's fortress
monkey2.s33.gz (14.4 KB ) - added by eriktorbjorn 17 years ago.
Savegame before finding Wally

Download all attachments as: .zip

Change History (6)

by eriktorbjorn, 17 years ago

Attachment: monkey2.s32.gz added

Savegame before going to LeChuck's fortress

by eriktorbjorn, 17 years ago

Attachment: monkey2.s33.gz added

Savegame before finding Wally

comment:1 by eriktorbjorn, 17 years ago

Owner: set to SF/jamieson630

comment:2 by SF/jamieson630, 17 years ago

Resolution: fixed
Status: newclosed

comment:3 by SF/jamieson630, 17 years ago

Should be fixed in latest CVS. _cmd_queue was one of the last data elements of IMuse that was not being saved/loaded, and it is required for the complex musical transitions that occur inside LeChuck's fortress. (We're talking 20 sound resources for that one musical piece. *whew*)

In addition, this bug is also based on the same rare assumption that manifests itself in S&M at the Bumpusville mansion -- namely, that sound resources will already be in memory even though they're not yet playing. This assumption holds true in both situations because relevant sound resources are preloaded by scripts (normally room entry scripts). However, when reloading a savegame, these scripts are not executed, and the ONLY sounds that are loaded are the ones that were actually playing. Hence, when the music tries to switch to a sound that WASN'T yet playing, that sound is not loaded in memory and does not play.

The reason why the sound can't be forced to load on-demand is twofold. First, iMuse is running in its own thread. Not only are the Scumm resource management routines not thread- safe, the memory allocation within those routines may not be thread-safe on all OS's, even if the routines themselves were made to be thread-safe. Second, there are some sounds that iMuse is asked to play that simply aren't SUPPOSED to be in memory. In other words, iMuse is asked to play something that in reality shouldn't be played. The "Sound 1" at the beginning of Sam & Max is an example.)

The bottom line is that iMuse shouldn't be able to force a sound into memory. The pattern of which sounds are available to it is important; that pattern is established by scripts, and should remain intact between saves and loads.

To that end, I have added to the savegames a list of what rtSound resources were in memory at the time the game was saved. When the game is loaded, these are immediately loaded back into memory, whether or not they're needed right away. I suspect (though I really have no idea) that this is very close to how the original interpreter handled sound resources when saving and loading games.

As for how the music is supposed to sound before Guybrush emerges from the crate -- I honestly don't know. It sounds reasonable, and a glace at the doCommand() and SysEx events doesn't reveal any obvious attempts to start or continue more music. Quite frankly, I've never seen this scene in the original [Monkey Madness] distro. Somehow I managed to finish the game without ever getting to thise scene.

comment:4 by eriktorbjorn, 17 years ago

I checked with DOSbox and the original interpreter (using debug mode and boot param), and except that the bass note when showing the exterior of LeChuck's fortress was sustained longer, the music was the same as in ScummVM.

Oh, and the crate is there in both easy and normal mode, and no one I've asked know of any alternative way of getting to the fortress, so I don't understand how you could have missed it. :-)

Note: See TracTickets for help on using tickets.