X Tutup
Skip to content

SCUMM: Add support for the classic SE variants of MI1, MI2, DOTT and FT#6313

Merged
bluegr merged 19 commits intoscummvm:masterfrom
bluegr:scumm_classic_se
Dec 20, 2024
Merged

SCUMM: Add support for the classic SE variants of MI1, MI2, DOTT and FT#6313
bluegr merged 19 commits intoscummvm:masterfrom
bluegr:scumm_classic_se

Conversation

@bluegr
Copy link
Member

@bluegr bluegr commented Dec 15, 2024

Introduction

This PR aims to support the classic SE variants of MI1, MI2, DOTT (including MM) and FT, found in their SE/remastered versions.

Information

The reasoning for this PR is that the SE editions are the the only versions of these games that can be purchased online. It has always been possible to use ScummVM with these versions, but external tools and scripts were needed to extract the files of the classic game variants. With the changes in this PR, we can support these classic version variants out of the box.

All of the files of these game variants are packed using a common PAK format.
Support for this format has been added based on the work done in DoubleFine Explorer.

Games

The classic game variants that this PR handles are:

  • The Secret of Monkey Island: Special Edition - Steam, GoG
  • Monkey Island 2 Special Edition: LeChuck’s Revenge - Steam, GoG
  • Day of the Tentacle Remastered - Steam, GoG
  • Full Throttle Remastered - Steam, GoG

TODOs left to fully support these game variants:

  • The new digital music format in MI1. This is a separate implementation, and will not be addressed with this PR. Because of this, external tools are still needed to handle the music in the classic MI1 variant. UPDATE: We now have support for the container XWB audio format used in the SE versions of MI1 and MI2. Also, all the audio CD playing code for MI1 SE has been reused from Loom Steam, and it should work out of the box.
  • Support for the Maniac Mansion easter egg found in DOTT. This will need to be handled separately, as we can't support it at the moment when its files are not in a game folder. UPDATE: This has been implemented now :)
  • Handle all the different XWB audio formats: PCM (done), XMA (no need - unused in MI1 and MI2), ADPCM (done), WMA (TODO)

Plan and next actions

I have a phased approach in mind, regarding support for the Doublefine SE versions (MI1, MI2, MM, DOTT, FT). The enhancements in the list can be done in-tree. It would be good to have WMA support so that music in MI1 classic is playable, but it's not a blocker for this PR:

Phase 1:

  • PAK file container format
  • XWB audio container format (MI1, MI2)
  • Hook MI1 CD audio infrastructure
  • PCM and MS ADPCM sound format (music, sfx and speech in all games, apart from MI1 CD audio)
  • WMA sound format (MI1 CD audio)

Phase 2 - enhancements:

  • FSB audio container format (DOTT, FT)
  • Hook MI2 SE digital music on top of iMUSE (using XWB files)
  • Hook MI1 and MI2 SE speech and SFX (using XWB files)
  • Hook DOTT SE digital music on top of iMUSE (using XWB files)
  • Hook FT SE digital music on top of digital iMUSE (using FSB files)
  • Hook DOTT and FT SE remastered speech and SFX (using FSB files)

Any comments are more than welcome :)

This will be used when reading the files of the classic versions found in
the DoubleFine remasters. Since the Full Throttle package is over 4GB,
we have adapted the internal sub file range code to use 64-bit integers
for file locations

The implementation is based on the work done in DoubleFine Explorer:
https://github.com/bgbennyboy/DoubleFine-Explorer/blob/master/uDFExplorer_LPAKManager.pas
With this, it's possible to handle the files of the MI1 and MI2
classic versions found in MI1 SE and MI2 SE
We need to cache the location of monster.sou, otherwise we'll end up
reindexing the PAK file on every speech sound.

With this, the classic version of DOTT found in the remaster works
With this, the files of the classic version of FT found in the
remastered version are now properly handled
These are found within the remastered/SE versions
Since the PAK files of the remastered versions of DOTT and FT are
very large, we need a 64-bit integer to hold their size
We now support the classic versions of these game variants
@bluegr bluegr requested a review from AndywinXp December 15, 2024 10:23
Now, subtitles in FT videos are displayed correctly
Add a game flag for Doublefine packed games, and simplify
the instantiation of the PAK file handler. This avoids
clashes with other packed games (e.g. the Mac version of DOTT)
@AndywinXp
Copy link
Contributor

This is bonkers :) awesome job!

I have just seen the code and I have yet to try it... but really, this is incredible. You singlehandedly added support for the only versions of those games that people can currently buy on digital stores, for which people previously had to resort to technical tools and such. Thank you!

I'll let you know when I can test it properly, for regressions, etc.

@AndywinXp
Copy link
Contributor

Oh and about the MI1 music format, I once released a music mod for MI1 which replaced the SE music with my own versions of the tracks, and I remember having to fiddle with a tool exactly for dealing with the format. I'll try digging something out when I can.

No functional changes. This will be reused for the DoubleFine MI1 CD
audio functionality
The audio CD tracks in that version are handled as files
All the functionality is hooked in the same manner as the Loom Steam
CD audio code. It's still disabled though, since WMA decoding isn't
implemented yet.

There are three known audio formats in MI1 SE and MI2 SE:
- PCM (tested and working)
- WMA (missing implementation)
- MP3 (currently crashes)
@bluegr
Copy link
Member Author

bluegr commented Dec 16, 2024

We now have support for the container XWB audio format used in the SE versions of MI1 and MI2. Also, all the audio CD playing code for MI1 SE has been reused from Loom Steam, and it should work out of the box. We're still missing the WMA decoder, so this code is disabled, for now.

Now, speech and SFX in MI1SE and MI2SE, which use PCM and ADPCM, are
handled correctly. WMA audio is still not handled.
Also, change the Loom CDDA class so that it instantiates the CD audio
stream internally, to streamline and simplify the code in the Sound
class
@AndywinXp
Copy link
Contributor

I just tried the code myself! Wonderful job!

I have a remark however. It seems my GOG copy of DOTT might not be the one your detection entry expects, so the game crashes at startup, along with its Maniac companion.

Maybe there could be some kind of fallback based on the naming of the resource file? These games had their own share of patch updates throughout their time, so it could just be that supporting only one might not be a viable option.

@bluegr
Copy link
Member Author

bluegr commented Dec 20, 2024

Thanks for the feedback @AndywinXp!

I've tested all the GoG and Steam versions of these four games. Only DOTT is different between GoG and Steam, so I've added the checksum of its GoG version, too.

You're right about the handling of these game variants in the fallback detector, although they don't get updated anymore. So, although this is important, we can handle the fallback detector changes in-tree, IMHO.

From SteamDB:

@bluegr
Copy link
Member Author

bluegr commented Dec 20, 2024

Thanks for your review @AndywinXp!
So, we've reached a good milestone now! Further work will be done in-tree.
Merging this.

@bluegr bluegr merged commit 5661a8b into scummvm:master Dec 20, 2024
@bluegr bluegr deleted the scumm_classic_se branch December 20, 2024 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup