Enjoying Morrowind On Linux - Part One: The Original Engine

Posted:

I've written about this before but I think the time is ripe for another look at the topic - how can Morrowind be enjoyed on a modern Linux distro? Please join me for part one of a two-part series as I explore using the original Windows executable and related modding tools.

Why Morrowind?

Folks who know me know that I enjoy computer games and that Morrowind is one that I enjoy more than most others. There's a lot of things that keep me coming back but I think that's a topic for another blog entry. For now I'd like to focus more on the "how" but suffice it to say: it's a game that's now several decades old but still manages to stay fresh. 1

One other thing that's worth noting: we have the luxury of being able to experience the game in several different flavors, including via the original engine enhanced by script extenders or via a totally new engine altogether. Fun stuff to experiment with!

Prerequisites

If you want to follow along at home you'll need a few things before getting started:

  1. I'll be writing as a user of the GOG.com version of Morrowind, if you have it on Steam things should still work fine but you'll have to keep differences in mind
  2. Download WEM and make it available in $PATH
  3. Ensure that WINE is installed on your system from the package manager. The specific version isn't too important but hopefully it's reasonably modern.
  4. X11; At present I've not had much experience with Wayland beyond trying WEM on my Steam Deck and seeing it fail to work. Eventually I'll make time to investigate that or switch over to Wayland altogether, at which time I'll update this post.

I'll explain each point above in detail below.

GOG.com Version Of Morrowind

The GOG version of Morrowind is preferred because it's arguably easier to install and use, and it comes with the Construction Set executable. If you don't plan on actually making any mods that's not so important, but it's arguably very nice to have available.

If you happen to have Morrowind from Steam, the primary difference in the process will be around where the game data files are installed. Just note where you have the game installed and that's really it. 2

Download WEM

WEM is a command-line program that I wrote to simplify working with WINE. The idea is that you describe your particular setup with a couple lines of config and then can just run WEM to execute things. You can then go on to make desktop launchers or whatever else you like with WEM under the hood, driving things. More on that below!

Ensure System WINE Is Installed

The exact process for this will vary from distro to distro but the idea is the same: use your package manager to install whatever 'wine' package is available. This is needed to bootstrap WINE "envs" before handing things off to other WINE builds (again, more on that below). 3

X11

For now this guide only supports X11 simply because I've not yet had much access to Wayland (or gone out of my way to use it). At some point I'll make the jump and update this information accordingly.

About WEM

A quick note about WEM, specifically its intended usage. WEM was intended to be fully configurable, both via a config file but also via command-line arguments. Anything you tell WEM to do via a command-line argument will take precedence over a configured value (should any exist). We'll leverage this below. Although WEM is a command-line tool, it can be used in a graphical, desktop context as the launch command for a desktop or menu entry.

When you set up WEM to run something, it creates an "env" which is a folder that WINE uses as a kind of base. The env root will have "drive" folders and other things related to the structure of a WINE filesytem.

Installing Morrowind

With all prerequisites out of the way the game can now be installed. With WEM, the idea is that you tell it a few things about your setup and then interacting with it is a simple matter of invoking wem.

First we will create or "init" the env, I've included comments that explain each option below:

wem init morrowind \
    # Download and install DXVK 2.3
    # Omit this if your GPU doesn't support Vulkan
    --dxvk-version 2.3 \

    # Pass the GOG installer some options to supress installer windows
    --gog-silent-install \
    --install-workdir $HOME/games \

    # Path to the installer executable
    # {{.InstallWorkDir}} references the option we set above
    --install-exe "{{.InstallWorkDir}}/setup_tes_morrowind_goty_2.0.0.7.exe" \

    # Working directory to be used when running the env
    --run-workdir "{{.WinePrefix}}/drive_c/game" \

    # Executable to be used when running the env
    --run-exe "{{.RunWorkDir}}/Morrowind.exe" \

    # File expected to be in place once the installer has completed
    --install-expected "{{.RunExe}}" \

    # Supress most output; don't use this when troubleshooting
    --quiet-run \

    # Use mangohud
    --run-prefix "mangohud" \

    # Run in a "virtual desktop", this is very useful for testing
    --virtualdesktop 1920x1080 \

    # Some DLL overrides we'll need for modding tools
    --wine-dlloverrides "d3d8=n,b;mwse=n,b;csse=n,b"

Or, as a more copy-pastable one-liner:

wem init morrowind --dxvk-version 2.3 --gog-silent-install --install-workdir $HOME/games --install-exe "{{.InstallWorkDir}}/setup_tes_morrowind_goty_2.0.0.7.exe" --run-workdir "{{.WinePrefix}}/drive_c/game" --run-exe "{{.RunWorkDir}}/Morrowind.exe" --install-expected "{{.RunExe}}" --quiet-run --run-prefix "mangohud" --virtualdesktop 1920x1080 --wine-dlloverrides "d3d8=n,b;mwse=n,b;csse=n,b"

This will write a file to $HOME/.config/wem/morrowind.cfg and we can now interact with our env. First thing's first, let's install the game:

wem install morrowind

This will run for a bit, how long depends on your hardware. When it completes you're ready to run the game:

wem run morrowind

And with that you should have a window running the game. I'd recommend at least starting a new game just to see the game load and all that. But we're not done yet, we've got to install some powerful modding tools.

Modding Tools: MCP, MGE:XE And MWSE

Next up we'll be setting up MCP, MGE:XE and MWSE which will enhance the visuals and modding capabilities of the game, respectively.

MCP

MCP, or Morrowind Code Patch by Hrnchamd makes required patches to the game executable. We'll use WEM's "exec" feature to run an arbitrary executable in our WINE "env" context:

wem run morrowind --exec "Morrowind Code Patch.exe" --no-virtualdesktop --no-run-prefix

The MCP GUI will be shown (pictured above), which options to select is pretty subjective so I won't go into those details here. The important thing is to apply the patch, regardless of which options you selected.

The MCP GUI

MGE:XE

MGE:XE is the next requirement, enabling modern graphical features such as distant statics and post processing shaders. It's also required for MWSE.

Note that you want to download the MGE XE Manual Install file for the purposes of this guide. The manual file allows us to quickly extract everything we need into our game folder without needing to click through an installer GUI.

The process of running the MGE configuration GUI is the same as with the MCP GUI:

wem run morrowind --exec "MGEXEGui.exe" --no-virtualdesktop --no-run-prefix

This is where you'll want to set and select various feature and quality settings. As with MCP what you pick is subjective so I won't go into detail about that.

The MGE:XE GUI

MWSE

The final piece of the puzzle needed to unlock MWSE-Lua mods is of course MWSE itself. To get it, we'll run the MWSE updater exe that comes with MGE:XE:

wem run morrowind --exec "MWSE-Update.exe" --no-virtualdesktop --no-run-prefix --no-quiet-run

We'll use the --no-quiet-run option to ensure we see things work as expected:

~ >>> wem run morrowind --exec "MWSE-Update.exe" --no-run-prefix --no-virtualdesktop --no-quiet-run --no-sandbox
2024/02/03 09:55:03 Exec: MWSE-Update.exe 
2024/02/03 09:55:03 Wine DLL Overrides
2024/02/03 09:55:03 Enable DXVK v2.3
Found install location: C:\game\
Newest version: b664fcbae63047e1661e208b1f558fbfa9ba7e83
Downloading update ... Done.
Deleting old files ... Done.
Extracting update ... Done.
2024/02/03 09:55:07 Completed without errors

With that, we should now be ready to run the game!

Run The Game

As a quick sanity check, run Morrowind and get through the initial character generation to be sure things are good to go:

wem run morrowind

After that you may then turn to installing mods, the "how" of which is out of scope for this guide but I may write about it in the future.

Another option, though, is to fire up the Construction Set and create some mods of your own! The modding community has enhanced this tool with the "CSSE" extension. Running it is simple:

wem run morrowind --exec "TES Construction Set.exe" --no-run-prefix --no-virtualdesktop
Construction Set: CSSE Edition
Ah yes, we've been expecting you...

You may recall setting DLL overrides above, those are how we enable MWSE and CSSE to hook in and do their thing.

Here's a few mod suggestions to get you on your way:

Launching

From here you can rather easily create launchers or menu entries that utilize WEM for launching into MWSE or CSSE. There's plenty of ways to go about it but a simple desktop entry might look like this:

# For launching the Morrowind game itself - save this as Morrowind.desktop
[Desktop Entry]
Name=Morrowind with MWSE
Exec=wem run morrowind
Type=Application
StartupNotify=true
Icon=AF8E_goggame-1435828767.0

# For launching CSSE - save this as CSSE.desktop
[Desktop Entry]
Name=CSSE
Exec=wem run morrowind --exec "TES Construction Set.exe" --no-run-prefix --no-virtualdesktop
Type=Application
StartupNotify=true
Icon=AF8E_goggame-1435828767.0

Note that in these example files, for the icon to work you'd need to either configure the path to that file or put the file itself into some place that the system uses for icons.

Special Thanks

I'd like to use this section to extend a special thanks to a few people that I owe inspiration to for this blog post:

Conclusion

Now you can enjoy Morrowind with all of the goodies available, including tools to run and create modern mods. Join me for future installments as I explore managing mods as well as a whole new engine for playing Morrowind: OpenMW.

Footnotes And References

1 We're even lucky enough to have one of the original game developers return to give us new content, see AFFresh and Fargoth Says Hello for a few examples of content made by Doug Goodall.

2 It should be possible to roughly follow this guide and use the Steam version; You'd just use Steam as your WINE manager and not WEM. Launching other executables would be a matter of making symlinks to Morrowind.exe or some other method.

3 In the context of WEM, an "env" or "WINE environment" consists of the prefix that gets used but also various other parameters of operation.

This page was last modified on: 2024-02-04