Introduction

My fianceé is a huge fan of the Gothic franchise (or at least the first two games). At least once a year she boots up her copy of either the first or the second game and haves her fun. This year, she wanted to play Gothic II with a specific mod: Odyssee. It is a total conversion mod for the game, so I doubted from the start it would run under OpenGothic. But Gothic II some time ago got an update which adds support for Steam Workshop.

Unfortunately, it turns out that the Steam Workshop version of Odyssee doesn’t have a good Polish translation. It has one, but it was done using Google Translate. There is a mod to the mod which adds proper Polish translation from the Sefaris Team, so she decided to install that one manually. And modding games on Linux is always fun, so ultimately I had to help her.

Installing dotnet40

The Sefaris Team installation steps are 1. Install Union Primary Universal 2. Install Union 1.0m 3. Unpack the mod to the game folder

Union is a mod for Gothic games that fixes a lot of issues, allows the game to even be played on modern systems and is the thing that allows big mods to exist. So I downloaded both Union Primary Universal and Union 1.0m and tried installing the UPU. Unfortunately I got an error about dotnet not being present:

Unhandled Exception:
System.TypeLoadException: Could not load type of field 'UnionOfflineInstaller.Installer:CachedZipFile' (8) due to: Could not load file or assembly 'DotNetZip, Version=1.13.3.0, Culture=neutral, PublicKeyToken=6583c7c814667745' or one of its dependencies.

Knowing my way around Proton and wine already, I ran protontricks 39510 dotnet40. Unfortunately after a while the installer failed: Installation failure The logs did not show any clear looking errors, this was the last message:

013c:fixme:secur32:GetComputerObjectNameW NameFormat 7 not implemented

After looking around, all I got was a bunch of people that couldn’t get .NET 4.0 installed on Linux under Proton. So I decided to look around for the error that the Union installer gave me. I found a Reddit thread with this comment. So I ran protontricks -c 'winetricks dotnet40' 39510 and… the installation failed!

Being persistent, I decided that maybe the previous installation process done with protontricks broke something, so I deleted the wine prefix the game was in and regenerated it by launching the game from Steam. Unfortunately, the installation failed again.

To try out another way, I needed the path to the game wine prefix. The easiest way I found to get that is by running protontricks -c 'env' 39510 | grep WINEPREFIX. After that I just used WINEPREFIX=/path/to/SteamLibrary/steamapps/compatdata/39510/pfx winetricks dotnet40, without using protontricks at all.

Lo and behold, the installation went through!

Installing Union Primary Universal and Union

Now it was onto the first step of the mod installation guide. I decided to drop into a shell using protontricks -c bash 39510, and ran the UPU installer. The installer asked me for language, I clicked it, and… it crashed. There was a long stack trace in the logs with this at the top of it:

0024:fixme:advapi:RegisterEventSourceW ((null),L".NET Runtime"): stub
0024:fixme:advapi:ReportEventW (CAFE4242,0x0001,0x0000,0x00000402,00000000,0x0001,0x00000000,011ED7E4,00000000): stub
0024:err:eventlog:ReportEventW L"Application: Union Primary Universal.exe\n"
0024:err:eventlog:ReportEventW L"Framework Version: v4.0.30319\n"
0024:err:eventlog:ReportEventW L"Description: The process was terminated due to an unhandled exception.\n"
0024:err:eventlog:ReportEventW L"Exception Info: System.InvalidOperationException\n"
0024:err:eventlog:ReportEventW L"Stack:\n"
0024:err:eventlog:ReportEventW L"   at System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(Boolean)\n"
0024:err:eventlog:ReportEventW L"   at UnionOfflineInstaller.Program.Main(System.String[])\n"
0024:fixme:advapi:DeregisterEventSource (CAFE4242) stub

Unhandled Exception: System.InvalidOperationException: SetCompatibleTextRenderingDefault must be called before the first IWin32Window object is created in the application.
   at System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(Boolean defaultValue)
   at UnionOfflineInstaller.Program.Main(String[] args)

A hunch told me to just run the binary again, I selected the language again and was able to progress through the installation. After selecting the folder where Gothic II was installed, UPU was installed.

Installing Union went smoothly. Now, onto the last step.

Copying Odyssee’s files

This one is easy. The only thing you have fix is directory names. By default, the Serafis team download includes directories _Work and System. But Linux filesystems are case-sensitive, and Gothic’s directories are named _work and system. Rename the directories after unpacking the files from the archive downloaded from Serafis’ website, and you’re good to go!

Launching (and playing) the game

After that the game launcher will allow you to choose Odyssee as the module to launch, but after playing a bit, my fianceé found out that sometimes her game would freeze for a second or two. It happened mostly when enemies noticed her or she died.

I tried looking for some fixes online, but didn’t found any. But I employed my usual strategy that I use while fixing issues like this: I started Steam through terminal, put that terminal on a second screen and launched the game. Turns out that during fights, I was seeing a lot of warnings related to sound.

Again, knowing my way around Proton, I ran protontricks 39510 directmusic. After I did it the game stopped launching, showing this error instead:

failed to initialize sound, MSS reported: Broken waveOut driver – ’buffer done’ flag never set

Luckily, this error send me to this Reddit comment from which I did steps 3 (deleting the SystemPack.ini file from Gothic’s system directory) and 10 by removing "*dsound"="native" from the user.reg file from the root wine prefix directory. After doing those steps, the game started working again, this time with no freezes and with background music working!

Conclusions?

So this shows that with enough perserverence you can get even old, heavily modded games running on Linux. I think that’s all, isn’t it?

Oh, wait, I just remembered something!!!

Bonus round: Installing dotnet472 and modding Bannerlord

After I managed to install dotnet40 using the roundabout way of not using protontricks or Proton’s wine, but instead just pointing regular wine to the correct WINEPREFIX, I remembered that I couldn’t get protontricks to install dotnet472 in case of Mount & Blade II: Bannerlord. I tried to install it because my fianceé wanted to play with Realistic Battle Mod on Linux and the mod requires that specific version.

Since I’ve found a new way to try, I decided to give it a go. And it worked! I was able to go through all of the installers with just winetricks! I once again got the prefix location by using protontricks -c 'env' 261550 | grep WINEPREFIX, and ran WINEPREFIX=/path/to/SteamLibrary/steamapps/compatdata/261550/pfx winetricks dotnet472, went through a lot of installers for the .NET framework, and I had it! RBM’s steam workshop page also lists vcrun2017 and gdiplus (which takes ages to download), and I installed them in the same way.

Unfortunately, even after installing those three things using winetricks directly, the game froze on loading screens with RBM installed. But I stumbled upon a solution on accident: installing the Harmony mod for some reason fixes this issue and makes the game work again.

Conclusions, this time for realzies

After writing all that, I don’t think if I have it in me to edit and proofread this post to be honest. I also don’t have it in me to write conclusions. If you found this guide online and it helped you, great!

Tags: english linux wine proton protontricks winetricks steam

Posted on: 2024-05-29, last edited on: 2024-05-29, written by: Kavelach