X3 and Linux: playing your favourite mods without crashing

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

nlseven
Posts: 5
Joined: Mon, 6. Sep 21, 05:43
x4

X3 and Linux: playing your favourite mods without crashing

Post by nlseven »

After struggling many, many times to have a consistently functional setup for Litcube's Universe, as well as Star Wars LU, and other mods like Mayhem 3 (with the galaxy generator) and Galaxy in Chaos, I spent some time making an automated script to 'just get it done'.

I've tested this working great with:
  • Vanilla X3 (including FL)
  • Litcube's Universe (the script fixes up some of the soundtrack files that can crash the game)
  • Star Wars LU (no more crashing on entering populated sectors!)
  • Galaxy in Chaos
  • Mayhem 3 - it'll launch the galaxy generator, and generated galaxies no longer crash when you start the game
This sets up a set of Wine prefixes to install the base X3AP game (from GOG, so it's portable!) and fix up all the various crashes and audio issues. I kept struggling with things like codecs and mods and libraries (looking at you GDK) being a total pain to work, and Wine has given me the most repeatable experience and I need to use it anyway for things like the plugin manager and Litcube.

The best thing about this is that it uses Wine 10+, with a pure 64-bit prefix and WOW64, which means it won't randomly break in the future!

You can find the repo here: https://codeberg.org/nlseven/swlu-linux

Let's say you want to play Guilds in Farnham's Legend - you'd simply need to do these things:

1. Clone the repo (or download the script)
2. Make sure you've got wine 10+, gstreamer good+bad+ugly codecs and 7zip installed
3. Download the X plugin manager installer, and X3 Terran War Pack from GOG. If you don't have it, buy it!
4. Download MP10Setup.exe - either from your winetricks cache or from archive (https://web.archive.org/web/20200803205 ... 0Setup.exe).
5. Run the script to install and play:

Code: Select all

./swlu.sh bootstrap-x3
./swlu.sh install-game X3
./swlu.sh install-pluginmanager X3
./swlu.sh start-pluginmanager FL
./swlu.sh start-game FL
This takes a bunch of learnings from different places: Essentially because the game engine uses some wild codecs, and stores all the voices in a giant WMAV2 file and seeks to their locations, there were all sorts of things people needed to do for it to work. A lot has changed in the Wine world (and with Proton), so I trawled through wine debugs and stack traces to rebuild just enough of the media framework stack to handle things.

The secret sauce:
  • Installing amstream, quartz, dxvk and l3codecx from winetricks
  • Re-registering amstream so it's not broken on WOW64
  • Pulling out two DLLs from WMP10 (4 if you're using Proton, see the Lutris script)
  • Registering them in Wine
  • When running the game, telling Wine to use a specific set of native DLLs so that the buffers getting passes to gstreamer/pulse actually work fine
Note that unlike most of the guides, this means you don't actually have to hunt down and install the incredibly old Amov4IE.exe installer. Cinematics Just Work!
fastesteddy13
Posts: 18
Joined: Tue, 29. Sep 15, 23:05
x3

Re: X3 and Linux: playing your favourite mods without crashing

Post by fastesteddy13 »

OMG.. Think you may have changed my entire universe (the X3 one, at least) with this guide.. Have massively struggled to get these mods working in Linux, apart from XRM (TC and AP, FL not working for me), every mod install I have tried over the years has resulted in errors and glitches..
I would love to try Mayhem3 and so I will set about following your guide to install it..
Huge thank you for this, trying to find Linux info for X3 has been very difficult, hope I make your guide work for me..!

One thing, you mention using wine 10, but when I look at the repo site (https://codeberg.org/nlseven/swlu-linux), it states a problem with ver 10 and says to use 9 instead? My current version is 3, so my first goal is to get it upgraded to 9 (or 10?).

edit;
Am using Ubuntu 18 (bionic beaver) but seems the highest wine avalable to me is 8.01 (now installed). Any ideas how to get to 9?
When I try;
sudo apt policy winehq-stable
I get version 8.0.1 as the highest and trying;
sudo apt install winehq-stable=9.0
I get;
E: Version ‘9.0’ for ‘winehq-stable’ was not found

Have not found a way to get wine 9.0 installed, any ideas or can I get away with 8.0.1?
ForteMaster
Posts: 15
Joined: Sun, 10. Jul 11, 00:29
x4

Re: X3 and Linux: playing your favourite mods without crashing

Post by ForteMaster »

I'm glad to see this. I just got a hankering to get back into X3 after a bunch of time with X4 (and I adore X4, I think, but there's a certain nostalgia I have for X3's way of doing things and curiosity about Litcube), and I'll give it a try when I've got some time.

But in the meantime - do you have a list of dependencies, maybe? Besides wine, of course. I presume that if you can install Steam then you've got whatever you need, but my experience with Arch is that it sometimes requires some extra attention. Some explicit dependencies would be great, as I'm not exactly a great hand with Wine (but I already know X3 on Linux is a bit of a time itself, especially FL).
fastesteddy13 wrote: Sun, 4. Jan 26, 13:21 OMG.. Think you may have changed my entire universe (the X3 one, at least) with this guide.. Have massively struggled to get these mods working in Linux, apart from XRM (TC and AP, FL not working for me), every mod install I have tried over the years has resulted in errors and glitches..
I would love to try Mayhem3 and so I will set about following your guide to install it..
Huge thank you for this, trying to find Linux info for X3 has been very difficult, hope I make your guide work for me..!

One thing, you mention using wine 10, but when I look at the repo site (https://codeberg.org/nlseven/swlu-linux), it states a problem with ver 10 and says to use 9 instead? My current version is 3, so my first goal is to get it upgraded to 9 (or 10?).

edit;
Am using Ubuntu 18 (bionic beaver) but seems the highest wine avalable to me is 8.01 (now installed). Any ideas how to get to 9?
When I try;
sudo apt policy winehq-stable
I get version 8.0.1 as the highest and trying;
sudo apt install winehq-stable=9.0
I get;
E: Version ‘9.0’ for ‘winehq-stable’ was not found

Have not found a way to get wine 9.0 installed, any ideas or can I get away with 8.0.1?
Bionic Beaver is pretty old by now. It's technically still supported, but only by paying Canonical for Extended Security Maintenance. You might consider getting a newer version up.

That being said, I'm sure there are ways. The code itself says to try this version, which I'm guessing you can extract wherever you like (if you edit the script). No idea if Ubuntu will like it, though.

EDIT: The instructions on the page have some flaws. For one thing, all the installation files are sourced from the swlu subfolder. The folder also references 'MP10Setup', which I had to find manually and thought would work to fix the following glitches.

Performance seems improved, at least as far as FL is concerned, compared to native Linux...but it also makes my laptop run harder, so there's more fan noise. AP also seems to run worse than FL. I'd love to figure out how to get a nice overlay up so I can compare utilization. AP led to lots of artifacting and a missing voice clip (possibly related to the MP10Setup debacle?). Egosoft intro video is broken (possibly intentionally removed? I haven't checked the code) but all others in both vanilla offerings are fine. All in-game voices appear to be totally broken.

Also, how about a TC option? :)

I also had to rename the LU installers, which shouldn't be necessary if the process is automated. Either way, though, it doesn't seem to work - it says 'File not found' when attempting to install LU 1.7.1, skips right to 1.7.2 patch failing to find the X3AP folder (the path appears to be correct, though), before the soundtrack installer works perfectly fine...albeit in the foreground. Thus, starting LU just starts vanilla AP...with the Hub theme in the background of the intro (ie, what it should be in LU). So out of three installers, only the last one actually works.

(Oh, and of course, there's the LU alternate UI installers. Those would be a nice addition, as an optional extra, possibly one that can be reinstalled to suit.)

I used Wine 10 from Arch's repo; I didn't get far enough into any game to test whether the save files caused issues.

So...yeah. Very little works. I'll probably copy this over as an issue in your repo later. But I'll just have to stick to Windows for now, I suppose!

EDIT 2: The Litcube installer problem may be my fault, the file was 0 KB for some reason. Nonetheless, most of these issues still stand. I've made an issue in your repo.

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”