NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.29k stars 13.54k forks source link

Package request: Ultima Underworld: The Stygian Abyss #219129

Open l0b0 opened 1 year ago

l0b0 commented 1 year ago

Project description

From Wikipedia:

Ultima Underworld: The Stygian Abyss is a first-person role-playing video game developed by Blue Sky Productions (later Looking Glass Studios) and published by Origin Systems. Released in March 1992, the game is set in the fantasy world of the Ultima series. It takes place inside the Great Stygian Abyss: a large cave system that contains the remnants of a failed utopian civilization. The player assumes the role of the Avatar—the Ultima series's protagonist—and attempts to find and rescue a baron's kidnapped daughter.

Hopefully this can be installed similarly to Descent 1 & 2 by using gogUnpackHook.

I've attempted to install using both Lutris and playonlinux, but neither of them work out of the box on NixOS 22.11. See How to install libstdc++.so.6 for DOSBox in Lutris? and #219126. The only way I've been able to create a runnable version is this:

  1. wine setup_ultima_underworld_1.0_cs_\(28190\).exe
  2. nix-shell --packages dosbox-staging
  3. cd ~/.wine/drive_c/GOG\ Games/Ultima\ Underworld
  4. Save this patch as dosboxULTIMA1_single.conf.patch:

    --- dosboxULTIMA1_single.conf.orig   2023-03-02 20:42:12.706179781 +1300
    +++ dosboxULTIMA1_single.conf    2023-03-02 22:20:54.399556136 +1300
    @@ -6,9 +6,9 @@
    [autoexec]
    # Lines in this section will be run at startup.
    @echo off
    -mount C ".."
    +mount C "~/.wine/drive_c/GOG Games/Ultima Underworld"
    #mount C "..\cloud_saves" -t overlay
    -imgmount d "..\game.gog" -t iso -fs iso
    +imgmount d "~/.wine/drive_c/GOG Games/Ultima Underworld/game.gog" -t iso -fs iso 
    d:
    goto launcher
    
  5. Apply the patch with patch -p0 < dosboxULTIMA1_single.conf.patch
  6. Run the game with dosbox -conf ~/.wine/drive_c/GOG\ Games/Ultima\ Underworld/dosboxULTIMA1.conf -conf ~/.wine/drive_c/GOG\ Games/Ultima\ Underworld/dosboxULTIMA1_single.conf

Metadata

Zaechus commented 1 year ago

I went ahead and bought this game on GOG (it was in the wishlist anyway :)), and installed/ran it from Lutris. Both I & II ran just fine for me, I don't see a problem here that would warrant a package. Could you provide more details as to what wasn't working?

Recommendations:

l0b0 commented 1 year ago

I already had the extra Lutris packages; they weren't helping.

innoextract + dosbox -conf ./__support/app/dosboxULTIMA1.conf -conf ./__support/app/dosboxULTIMA1_single.conf did work though. The main reason I wanted a package was to be able to really easily install it, as Nix is an excellent way to install games to run reliably. By packaging in nixpkgs we could also add community patches like Ultima Hacks in a way that would allow owners of this game to get the best possible experience with a single command.

For example, to get UU running with Ultima Hacks and the MIDI patch, I had to do something like this:

  1. Download the GOG files
  2. innoextract the installer
  3. Mount the extracted game.gog file as a loop device
  4. Copy the mounted directory somewhere read-writeable
  5. Patch the uu.exe file
  6. Download the resulting file
  7. Replace the original uu.exe file
  8. Download the MIDI patch
  9. Extract the MIDI patch files into the sound directory
  10. Re-package the updated directory as an ISO-9660 file
  11. Replace the game.gog file with the new ISO.
  12. Go to the UU1/__support directory (yes, really)
  13. Run dosbox -conf app/dosboxULTIMA1.conf -conf app/dosboxULTIMA1_single.conf

nix-shell -p ultima-underworld followed by ultima-underworld & seems preferable. :grin: Hopefully something like this would be possible by some relatively simple mechanism like specifying a GOG API key in a Nix configuration file. This sort of easy install of games potentially from a whole host of game providers could be a bit of a superpower of nixpkgs, IMO.