luxtorpeda-dev / packages

Package build scripts and support for luxtorpeda client
https://luxtorpeda.org
zlib License
37 stars 28 forks source link

Eternity Engine for Doom 2 Master Levels native support #1009

Closed hfc2x closed 11 months ago

hfc2x commented 11 months ago

Project Link

https://github.com/team-eternity/eternity

Project License

GPL v3

Steam App Ids

Additional Context

This is an engine that does not require wadsmoosh nor any other tools to detect and play Master Levels for Doom II. It requires no modifications of any the files, but it does require a bit of configuration to be set up properly for first launch. It does not support cloud saves. The newest version available in the releases tab is about 2 years old, so it's recommended that the latest commit be used instead, at least until a newer stable release is made.

For the unlisted version of Master Levels (App ID 9160), assuming the engine will be downloaded into Master Levels of Doom/eternity-engine/, an accompanying file needs to be created that will set a Console Variable for the engine upon launch. This is simply a text file with the .csc extension (for the example, we'll name it "master.csc" below) with the following contents (see attachment, remove .txt extension):

master.csc.txt master_levels_dir "../master/wads/"

Then, the engine needs to be launched with the following parameters:

"$DIR/eternity" -iwad "$DIR/../doom2/DOOM2.WAD" -vanilla -exec "$DIR/master.csc" "$@"

For the repackaged Doom II version (App ID 2300), assuming the directory will be Doom 2/eternity-engine, the contents of the *.csc file have to be the following:

master_levels_dir "../masterbase/master/wads/"

And the launch parameters should be as follows:

"$DIR/eternity" -iwad "$DIR/../masterbase/doom2/DOOM2.WAD" -vanilla -exec "$DIR/master.csc" "$@"

DISCLAIMER: The following part can be completely ignored, but I think it would make for a better user experience with this engine.

Eternity Engine uses SDL2_Mixer for music, and therefore the way the MIDI music sounds is dependent on the default soundfont provided by SDL2_Mixer. In my own opinion, this soundfont sounds like garbage, and it's completely ear-piercing. This can be changed on launch for something more acceptable by setting the SDL_SOUNDFONTS environment variable.

There is a Roland-sounding SF2 format soundfont made by Kenneth Rundt, which is provided for free with a Creative Commons CC-BY 3.0 license. This soundfont is packaged with the free SynthFont software he makes (available here). The soundfont can also be directly downloaded here without having to download the software.

I downloaded this file into the Eternity Engine directory as "soundfont.sf2", and made a launcher that sets the soundfont at launch like this:

SDL_SOUNDFONTS=./soundfont.sf2 ./eternity

The reason for this suggestion is because having the launcher expect "soundfont.sf2" allows for the user to just replace it with whatever SF2 soundfont they like, provided they name it that. If nothing is provided, Eternity Engine automatically falls back to the horrible default SDL2_Mixer soundfont.

d10sfan commented 11 months ago

Interesting thanks, I'll take a look when I have a chance

d10sfan commented 11 months ago

Thanks for the details in this, that made implementing it easier!

I've added eternity engine for doom and doom2, including the doom 2 master levels. I also added a soundfont (the same one that other engines use).

For the old master levels app, I don't own it so I can't test it, but would be happy to look over a pull request if you have it. Thanks!

Let me know if you run into any issues

hfc2x commented 10 months ago

Just to add something here, I tried using Eternity Engine with Master Levels (bundled with Doom 2) but I think it's kind of an issue for it to try and download a 129 MB soundfont file. The Ubuntu FTP server it tries to download from is too far away from my location, so it was about 1 hour just to get to 50%, and I'm on 750 Mbps connection.

I think it'd be better to either use a smaller file, or just notify users on how to provide a soundfont themselves, because I don't think it's feasible for most people to wait for this long.

d10sfan commented 10 months ago

For this, do you have another soundfont in mind that could work?

hfc2x commented 10 months ago

Is the license an issue with the soundfont provided above?

If so, there's this notation software called MuseScore (GPLv3) that provides their own soundfonts, but also gives instructions on getting other recommended soundfonts in their website as well, here. From all of the ones listed, GeneralUser GS seems to be the best-sounding (for games at least), and it's only 29 MB in size.

d10sfan commented 10 months ago

The site for the original sound font you linked loads pretty slowly, so that probably wouldn't be a good one. The GeneralUser one has a drop-box link which might work, but do you know of a better download?

hfc2x commented 10 months ago

Is Archive.org acceptable for this purpose?

d10sfan commented 10 months ago

Sure, that's fine

hfc2x commented 10 months ago

Okay, sorry for disappearing.

There's a folder in Archive.org that contains a bunch of free-to-use MIDI soundfonts here. The GeneralUser soundfont above is listed as "GeneralUser GS v1.471.sf2".

There's also the Microsoft General MIDI soundfont listed as well (Microsoft_gm.sf2), and the Roland SOUNDCanvas SC-55 soundfont that's what Doom's music was originally intended for (listed specifically as "SC-55.sf2" with other similarly-named files lacking certain sounds), but I'm not sure about the legality of either of these.

The GMGSx soundfont I mentioned above is not listed there, however.

d10sfan commented 10 months ago

Thanks for the links, I've updated eternity engine to use that soundfont

hfc2x commented 8 months ago

Hey there.

I just now had time to test this out, and the soundfont downloads fine. The problem right now is that it's not loaded at start, because the SDL_SOUNDFONTS variable is set to "GeneralUser GS v1.471.sf2" instead of "../GeneralUser GS v1.471.sf2", which is where the soundfont is located.

Changing it manually does the trick.

d10sfan commented 8 months ago

I've pushed a commit that should fix that and it'll be live in a few minutes. Can you give it a try and see if that fixes it?