This employs a "lazy" approach: the "format" for the credits stays
exactly as it was, i.e., perl code. Of course one may want to change
this to another format (e.g. YAML, JSON, XML; or also shell script or
AWK, like `configure.engine` uses). But I deliberately kept it simple,
to get a minimal change that is easy to verify. Any further changes to
e.g. the format can be layered atop this.
OSystem now just returns a nullptr if there is no text to speech manager instance
(because none is compiled into the binary, or the system doesn't provide support
for it). This removed the need for the engine authors to add scummvm osystem compile
time options checks into their engine code
In the castle cellar, when you pull the bung out of the wine cask, a sound is
played for the running wine. However, when the cask runs empty, the sound is
not stopped. Also, when the Skorl starts drinking the wine, the sound is not
restarted when you enter the room, and it is also not stopped when the wine
runs out. These issues exist with the original interpreter as well.
I fixed this by adding the running wine sound when the hotspot script for the
drinking Skorl is in the loop where the Skorl is drinking, and removing the
sound when the hotspot script for the running wine is unloaded and when the
running wine stops in the animation for the drinking Skorl.
When outside in the town, the game plays an ambient sound of twittering birds.
When first entering town after falling through the chute, this sound does not
play; it first starts after you enter and exit a building. This issue is
present with the original interpreter as well.
This change fixes this by calling removeSounds after playing the chute
animation. This function calls the bellsBodge function, which manages the
ambient sounds in town. Because there are no other sounds playing when first
entering town, this has no unwanted side effects.
When entering town after escaping from prison, after a little while bells start
chiming constantly. This does not happen in the original interpreter.
This is caused by a script that generates the ambient thunder sounds in the
prison. After the prison escape the clearSequenceDelayList function is called,
but this did not remove the script because it is not marked as "can be cleared".
Because this script is not running in town in the original interpreter, I think
the clearSequenceDelayList function is supposed to clear all scripts, even the
ones not marked as "can be cleared". The only other scripts that this affects
are two more ambient sound scripts that are now removed after entering the
castle towards the end of the game (the only other place where
clearSequenceDelayList is called). These scripts only play sounds while in town,
so removing them has no effect (but does remove some unnecessary processing).
Some room exit data have the door opening or door closing sound defined as 0
(f.e. the cave doors). This means no sound should be played. ScummVM would play
sound 0 instead, which is the running water sound. This change fixes this by
checking for value 0 and not playing a sound in that case.
ScummVM did not seem to trigger door opening and closing sounds, f.e. the cell
door at the start of the game. The checks in the roomExitAnimHandler compared
hotspot IDs to room numbers, which are different sets of IDs AFAICT. Also, the
door opening part would decrease the frame counter first, then compare to the
set destination frame. The opening sound should often be triggered at the start
of the animation, but because the frame counter is decreased first, it does not
trigger at the first frame. I moved the frame counter decrease after the check
to fix this.
This change fixes several issues with the endgame animation:
- The timing for the sounds for the animation was based on the number of frames
after which the sound should start playing. However, the animation code
interpreted it as the number of frames to wait after playing the sound. This
caused the timing of the sounds to be wrong. Fixed this by moving the number of
frames up to the next sound and adding a dummy sound for the initial pause.
- The pause and thunder sound effect at the end of the animation were missing.
- The AdLib endgame sound resource was not loaded, causing a sound effect to
play instead of the endgame music.
- Changed the timing of the first text screen to match the original interpreter.
- At the last text screen, the game now waits for a keypress before quitting
the game after the music has finished. This matches the behavior of the
original interpeter.
- Made animation more responsive to user quitting the game.
- Screen no longer fades in EGA version.
This change fixes some small differences in the barrel animation between the
original interpreter and ScummVM:
- The animation should fade in at the start
- The music should continue until the animation has faded out
- The mouse cursor should appear after the animation has faded out
The first track in the LotT introduction fades out before the second track
starts. The fade-out is implemented by reducing the velocity of the new notes
that are being played. Because this does not affect notes that are already
playing, the fade-out effect is not very good. I've replaced this by a fade-out
using MIDI channel volume.
The music playing at the game over screen would only play once and send MIDI
CC 18 messages, which are not defined in the MIDI standard. I added looping and
removed the non-standard MIDI messages to prevent possible compatibility
issues.
The music for cutscenes and for the game over screen had some strange volume
differences compared to the original interpreter which seem to be caused by a
bug in the original interpreter where volume adjustments from sound effects
would carry over into the music. I've added a note to explain this difference.
The animation that plays when you fall through the sewage chute near the start
of the game had some issues. Fades were missing at several points, the middle
part of the animation was played only once and too slow, and when skipping the
animation it would only skip the currently playing part instead of the entire
animation.
To fix these issues, I've added an option to AnimationSequence to loop the
animation a number of times.
When the player gets caught by a Skorl, an animation is shown where the player
is punched in the face. This had a few issues:
- The animation fades in and out on the original interpreter. I've added this.
- The animation plays faster on the original interpreter. Speed was updated to
match this.
- The sound effect for this animation would play right at the start instead of
at the moment of impact. I've added a delay to the sound effect using an
AnimSoundSequence.
This fixes several issues with the introduction animation:
- The timing of the various parts of the introduction did not match the timing
of the original interpreter. The music did not properly match the images and
the last section was completely missing. I've adjusted the timing to beter
match the original interpreter.
- The VGA palette of the first text screens was broken and would display them
as completely white. I've added a patch to add the colors of the palette of the
following text screens.
- The animation of the soldiers approaching each other would fade out on the
original interpreter. I've added this.
- The images of the battle sequence would fade out on the EGA version. This
does not match the original interpreter and has been removed.
Some tracks in LotT contain channel aftertouch events. These are not supported
by the MT-32 and the original interpreter does not send them to the MIDI
device. This change removes them from the MIDI output.
When pausing the game by bringing up the ScummVM menu, the MIDI notes would
hang. I've added code to pause and resume the active MIDI parsers, which stops
the active notes.
This change adds the MT-32/GM multisource MidiDriver to LotT. This adds the
following functionality:
- MT-32 initialization using the SysEx queue. ScummVM will remain responsive
while the SysExes are sent and the user can abort the process when skipping the
introduction or quitting the game.
- Use of Roland GS MT-32 instrument mapping.
It also allows for a proper implementation of music fade-outs. Some
functionality previously implemented in SoundManager is now done by the driver.
The original interpreter sends out a SysEx to turn off the MT-32 reverb when
opening a door while outside. This does not seem to work properly in the
original interpreter, and it is unclear what the developer's intentions were
with this function, so I've added a comment and removed the functionality.
When sending SysEx data to the MT-32, the game blinks an icon in the lower left
corner of the screen. This change adds that icon. It is stored in the
executable, so I added code to create_lure_dat to extract the icon and add it
to the ScummVM data file. The new version of this file is now required to run
the game.
Some sound effects in LotT loop, like the thunderstorm in the beginning of the
game. This is indicated by the high bit of the sound number. This change adds
support for these looping sound effects.
The LotT MT-32 MIDI data specifies a velocity value for the Note Off events,
but this is not sent to the MT-32 by the original interpreter. This removes the
velocity from the Note Off events, so it matches the MIDI output of the
original interpreter.
ScummVM would add one to the number of MIDI channels specified for a sound
resource, but this does not match the actual number of channels used in the
MIDI data. Additionally, it would not take into account the fact that the first
MIDI channel used in the MT-32 data is channel 1 instead of 0. This change
corrects this; the MIDI channels used now match those of the original
interpreter.
Lure of the Temptress defines a volume level for each sound resource. This is a
byte value which can increase or decrease the volume of the sound as specified
in the MIDI data (80h is the neutral value). The original interpreter applies
this as a scaling factor to the Note On velocity for the MT-32. ScummVM used it
to scale the MIDI volume control change values instead, causing incorrect
volume levels.
This change applies the sound resource volume to note velocity instead, which
results in the same volume as the original interpreter. I've left the old
method in place for AdLib, because I'm not sure how the original interpeter
handles sound resource volume in this case.
Distinction between music and SFX was made based on the most significant bit in
the sound number byte. This does not accurately reflect which MIDI sequences
are music or a sound effect.
Instead, I've added a flag which can be passed to
SoundManager::musicInterface_Play to indicate whether the sound is music or a
sound effect. All music is started from hard-coded animation sequences, so this
flag can be passed from ScummVM code when appropriate.
Some music tracks (f.e. the 2nd introduction track) do not properly set the
volume on all channels and rely on the volume set by the previous track.
ScummVM would reset the volume on all channels between tracks, which caused
wrong volumes on some channels. I've removed this.
The MIDI player remaps the channels in the MIDI data to the available channels
on the MIDI device. In case of MT-32 music, this does not work, because the
percussion channel gets remapped to an instrument channel. The original
interpreter does not remap the channels of the music at all.
I've turned off channel remapping for all MT-32 MIDI data marked as music.