Posted May 04, 2020
Installation - X3: Terran War Pack
Overview
• Install Distro Packages
• Prepare Wine Prefix
• Install Game
• Install Required Winetricks
• Install Microsoft ActiveMovie
• Create Run Scripts
• Configure Game Display
• Create Shortcuts
Tested Environment
Distro: Linux Mint 19.3 "Tricia" | Cinnamon | 64-bit
Kernel: 5.0.0-32-generic
Graphics: NVidia GeForce GTX 670
CPU: Intel i7-3930K @ 3.20GHz × 6
Wine Version: Wine Staging 5.6 (WineHQ)
Game File Checkums:
570f6d88f850912852046bda150ce220 setup_x3_terran_war_pack_3.4_(17049).exe
d904068fe35e09ecdc8dbf63fa410877 setup_x3_terran_war_pack_3.4_(17049)-1.bin
7a2e799a9bfe4b37b85933abc9522975 setup_x3_terran_war_pack_3.4_(17049)-2.bin
Requirements
• X3: Terran War Pack (Windows version)
• Wine: A recent "staging" version is recommended.
• Winetricks: A recent version is required (NOT a repository version).
• Microsoft ActiveMovie - "amov4ie.exe" available from PlayOnLinux or Lone Wolf $cripts (will be installed last)
The following also assumes an Ubuntu-based distribution when discussing package management. GOG only officially supports Ubuntu. Feel free to discuss other distros (Arch/Fedora/etc.) in the comments, but please don't start a pointless distro flame war.
Step 1: Install Distro Packages
X3 is a 32-bit game. Ensure you have the 32-bit (i386) architecture enabled with:
sudo dpkg --add-architecture i386
sudo apt-get update
At a minimum, you'll want the following codec libraries installed:
gstreamer1.0-libav:i386
gstreamer1.0-plugins-base:i386
gstreamer1.0-plugins-good:i386
gstreamer1.0-plugins-ugly:i386
Install the above packages from the command line:
sudo apt-get install gstreamer1.0-libav:i386 gstreamer1.0-plugins-base:i386 gstreamer1.0-plugins-good:i386 gstreamer1.0-plugins-ugly:i386
Step 2: Prepare Wine Prefix
You'll be setting up a 32-bit Wine prefix in a new directory:
mkdir x3-terran-war-pack
cd x3-terran-war-pack
export WINEPREFIX=$PWD
export WINEARCH=win32
winecfg
The last command will prepare a local standalone wine environment and bring up the Wine configuration window.
I highly recommend disabling all "Link" options under the "Desktop Integration" tab to keep installers from polluting your desktop and menu environments.
Hit "Apply" or "OK" before closing the window to save your changes.
IMPORTANT NOTE: The above commands exported WINEPREFIX and WINEARCH, both of which must be available to the commands used in the following steps. Don't close or change terminal sessions until all steps are complete.
Step 3: Install Game
Assuming the game is in your Downloads folder, run the following in your terminal:
wine ~/Downloads/setup_x3_terran_war_pack_3.4_(17049).exe
Click "Exit" when the installer completes. DO NOT click Launch.
Runtime errors near the end of installation are common and won't affect your installation. If encountered, just click through them.
(OPTIONAL) You might want to make a backup of the directory at this point. If any Winetricks fail you'll have to start over.
Step 4: Install Required Winetricks
Before continuing, ensure you're running an up-to-date version of Winetricks.
The Ubuntu repository version is outdated and will not work.
If you fail to heed this warning, expect to start over ;)
The following Winetricks are required, and should be installed in this order:
amstream
devenum
quartz
wsh57
wmp10
Install them all with the following command:
winetricks -q amstream devenum quartz wsh57 wmp10
If you encounter any errors, start over from Step 1... or use that backup I so kindly suggested :)
Step 5: Install Microsoft ActiveMovie
Depending on where you downloaded ActiveMovie from, it will be called "Amov4ie.exe" or "amov4ie.exe". Adjust accordingly.
Assuming the file is in your Downloads folder, run the following in your terminal:
wine ~/Downloads/Amov4ie.exe
If you encounter any errors, start over from Step 1... or use that backup I so kindly suggested :)
Step 6: Create Run Scripts
At this point the games should be fully playable, but it's a hassle to manually define your WINEPREFIX and WINEARCH, change to the game directory, and manually run Wine every time you want to play.
Add the following two scripts, named X3TC.sh and X3AP.sh to your "x3-terran-war-pack" base directory:
--- X3TC.sh ---
#!/bin/bash
export WINEPREFIX=$(realpath $(dirname $0))
export WINEARCH=win32
echo WINEPREFIX: $WINEPREFIX
echo WINEARCH: $WINEARCH
cd "$WINEPREFIX/drive_c/GOG Games/X3 Terran War Pack"
echo Working Directory: $PWD
echo "Running 'X3TC.exe'"
WINEDEBUG=fixme-all wine "X3TC.exe"
--- X3AP.sh ---
#!/bin/bash
export WINEPREFIX=$(realpath $(dirname $0))
export WINEARCH=win32
echo WINEPREFIX: $WINEPREFIX
echo WINEARCH: $WINEARCH
cd "$WINEPREFIX/drive_c/GOG Games/X3 Terran War Pack"
echo Working Directory: $PWD
echo "Running 'X3AP.exe'"
WINEDEBUG=fixme-all wine "X3AP.exe"
To make those scripts executable, run the following in your terminal:
chmod +x X3TC.sh X3AP.sh
Now you can run either of those scripts to fire up "X3: Terran Conflict" or "X3: Albion Prelude" respectively.
Step 7: Configure Game Display
Some window managers won't properly assign focus to fullscreen child processes, or can make Alt-Tabbing difficult.
There are a couple easy steps you can take to address these kinds of issues.
1. Adjust the game's "Fullscreen" settings
Open each game and, on the intro popup, click "Graphics Settings" and change "Fullscreen" to "Borderless".
This retains the fullscreen experience but allows toggling windows without fullscreen switching.
Note that disabling "Fullscreen" will also disable your ability to control antialiasing.
2. Adjust the Wine configuration's Virtual Desktop settings
From the "x3-terran-war-pack" directory, run the following to open up the Wine configuration (settings):
export WINEPREFIX=$PWD
export WINEARCH=win32
winecfg
This should look familiar. It was part of creating the Wine prefix in Step 1.
This time, go to the "Graphics" tab, check "Emulate a virtual desktop".
Set the "Desktop size" boxes to match your current screen resolution.
Using a virtual desktop allows your window manager to handle Alt-Tab behavior instead of the game trying to handle the focus change.
Step 8: Create Shortcuts
Your game(s) should be running pretty well now, but it would be easier to fire it up from the application menu. Unfortunately, I can't give you any hard and fast rules because each desktop environment is different, but there are some commonalities.
Menu entries are usually stored in "~/.local/applications/*.desktop" files.
These files describe location, display name, icon, and category information.
Writing these files by hand is a pain, and most window managers have a built-in mechanism for creating these files. Try right-clicking your application menu icon to see if it has a "Configure" or "Add Application" option.
If you happen to be running Cinnamon, as I am, the process is:
Configure -> Menu -> Open the menu editor -> New Item
Go ahead and create shortcuts pointing to the X3TC.sh and X3AP.sh scripts created in Step 6.
You should be able to select the associated game icon from the "x3-terran-war-pack/drive_c/GOG Games/X3 Terran War Pack" directory (look for *.ico files). In my case, the file was "goggame-1441039322.ico".
If your desktop environment doesn't handle *.ico files, you can use a local editor or a site like iConvert Icons online converter to create a compatible PNG from the ICO format.
Final Thoughts
This post was originally quite a bit longer and covered some alternative options... but GOG wouldn't allow a post that long.
My first attempt at this port failed due to an outdated Winetricks install, so thanks to WinterSnowfall for re-peaking my interest and passing along his working setup. Much appreciated.
And as always, have fun :)
Overview
• Install Distro Packages
• Prepare Wine Prefix
• Install Game
• Install Required Winetricks
• Install Microsoft ActiveMovie
• Create Run Scripts
• Configure Game Display
• Create Shortcuts
Tested Environment
Distro: Linux Mint 19.3 "Tricia" | Cinnamon | 64-bit
Kernel: 5.0.0-32-generic
Graphics: NVidia GeForce GTX 670
CPU: Intel i7-3930K @ 3.20GHz × 6
Wine Version: Wine Staging 5.6 (WineHQ)
Game File Checkums:
570f6d88f850912852046bda150ce220 setup_x3_terran_war_pack_3.4_(17049).exe
d904068fe35e09ecdc8dbf63fa410877 setup_x3_terran_war_pack_3.4_(17049)-1.bin
7a2e799a9bfe4b37b85933abc9522975 setup_x3_terran_war_pack_3.4_(17049)-2.bin
Requirements
• X3: Terran War Pack (Windows version)
• Wine: A recent "staging" version is recommended.
• Winetricks: A recent version is required (NOT a repository version).
• Microsoft ActiveMovie - "amov4ie.exe" available from PlayOnLinux or Lone Wolf $cripts (will be installed last)
The following also assumes an Ubuntu-based distribution when discussing package management. GOG only officially supports Ubuntu. Feel free to discuss other distros (Arch/Fedora/etc.) in the comments, but please don't start a pointless distro flame war.
Step 1: Install Distro Packages
X3 is a 32-bit game. Ensure you have the 32-bit (i386) architecture enabled with:
sudo dpkg --add-architecture i386
sudo apt-get update
At a minimum, you'll want the following codec libraries installed:
gstreamer1.0-libav:i386
gstreamer1.0-plugins-base:i386
gstreamer1.0-plugins-good:i386
gstreamer1.0-plugins-ugly:i386
Install the above packages from the command line:
sudo apt-get install gstreamer1.0-libav:i386 gstreamer1.0-plugins-base:i386 gstreamer1.0-plugins-good:i386 gstreamer1.0-plugins-ugly:i386
Step 2: Prepare Wine Prefix
You'll be setting up a 32-bit Wine prefix in a new directory:
mkdir x3-terran-war-pack
cd x3-terran-war-pack
export WINEPREFIX=$PWD
export WINEARCH=win32
winecfg
The last command will prepare a local standalone wine environment and bring up the Wine configuration window.
I highly recommend disabling all "Link" options under the "Desktop Integration" tab to keep installers from polluting your desktop and menu environments.
Hit "Apply" or "OK" before closing the window to save your changes.
IMPORTANT NOTE: The above commands exported WINEPREFIX and WINEARCH, both of which must be available to the commands used in the following steps. Don't close or change terminal sessions until all steps are complete.
Step 3: Install Game
Assuming the game is in your Downloads folder, run the following in your terminal:
wine ~/Downloads/setup_x3_terran_war_pack_3.4_(17049).exe
Click "Exit" when the installer completes. DO NOT click Launch.
Runtime errors near the end of installation are common and won't affect your installation. If encountered, just click through them.
(OPTIONAL) You might want to make a backup of the directory at this point. If any Winetricks fail you'll have to start over.
Step 4: Install Required Winetricks
Before continuing, ensure you're running an up-to-date version of Winetricks.
The Ubuntu repository version is outdated and will not work.
If you fail to heed this warning, expect to start over ;)
The following Winetricks are required, and should be installed in this order:
amstream
devenum
quartz
wsh57
wmp10
Install them all with the following command:
winetricks -q amstream devenum quartz wsh57 wmp10
If you encounter any errors, start over from Step 1... or use that backup I so kindly suggested :)
Step 5: Install Microsoft ActiveMovie
Depending on where you downloaded ActiveMovie from, it will be called "Amov4ie.exe" or "amov4ie.exe". Adjust accordingly.
Assuming the file is in your Downloads folder, run the following in your terminal:
wine ~/Downloads/Amov4ie.exe
If you encounter any errors, start over from Step 1... or use that backup I so kindly suggested :)
Step 6: Create Run Scripts
At this point the games should be fully playable, but it's a hassle to manually define your WINEPREFIX and WINEARCH, change to the game directory, and manually run Wine every time you want to play.
Add the following two scripts, named X3TC.sh and X3AP.sh to your "x3-terran-war-pack" base directory:
--- X3TC.sh ---
#!/bin/bash
export WINEPREFIX=$(realpath $(dirname $0))
export WINEARCH=win32
echo WINEPREFIX: $WINEPREFIX
echo WINEARCH: $WINEARCH
cd "$WINEPREFIX/drive_c/GOG Games/X3 Terran War Pack"
echo Working Directory: $PWD
echo "Running 'X3TC.exe'"
WINEDEBUG=fixme-all wine "X3TC.exe"
--- X3AP.sh ---
#!/bin/bash
export WINEPREFIX=$(realpath $(dirname $0))
export WINEARCH=win32
echo WINEPREFIX: $WINEPREFIX
echo WINEARCH: $WINEARCH
cd "$WINEPREFIX/drive_c/GOG Games/X3 Terran War Pack"
echo Working Directory: $PWD
echo "Running 'X3AP.exe'"
WINEDEBUG=fixme-all wine "X3AP.exe"
To make those scripts executable, run the following in your terminal:
chmod +x X3TC.sh X3AP.sh
Now you can run either of those scripts to fire up "X3: Terran Conflict" or "X3: Albion Prelude" respectively.
Step 7: Configure Game Display
Some window managers won't properly assign focus to fullscreen child processes, or can make Alt-Tabbing difficult.
There are a couple easy steps you can take to address these kinds of issues.
1. Adjust the game's "Fullscreen" settings
Open each game and, on the intro popup, click "Graphics Settings" and change "Fullscreen" to "Borderless".
This retains the fullscreen experience but allows toggling windows without fullscreen switching.
Note that disabling "Fullscreen" will also disable your ability to control antialiasing.
2. Adjust the Wine configuration's Virtual Desktop settings
From the "x3-terran-war-pack" directory, run the following to open up the Wine configuration (settings):
export WINEPREFIX=$PWD
export WINEARCH=win32
winecfg
This should look familiar. It was part of creating the Wine prefix in Step 1.
This time, go to the "Graphics" tab, check "Emulate a virtual desktop".
Set the "Desktop size" boxes to match your current screen resolution.
Using a virtual desktop allows your window manager to handle Alt-Tab behavior instead of the game trying to handle the focus change.
Step 8: Create Shortcuts
Your game(s) should be running pretty well now, but it would be easier to fire it up from the application menu. Unfortunately, I can't give you any hard and fast rules because each desktop environment is different, but there are some commonalities.
Menu entries are usually stored in "~/.local/applications/*.desktop" files.
These files describe location, display name, icon, and category information.
Writing these files by hand is a pain, and most window managers have a built-in mechanism for creating these files. Try right-clicking your application menu icon to see if it has a "Configure" or "Add Application" option.
If you happen to be running Cinnamon, as I am, the process is:
Configure -> Menu -> Open the menu editor -> New Item
Go ahead and create shortcuts pointing to the X3TC.sh and X3AP.sh scripts created in Step 6.
You should be able to select the associated game icon from the "x3-terran-war-pack/drive_c/GOG Games/X3 Terran War Pack" directory (look for *.ico files). In my case, the file was "goggame-1441039322.ico".
If your desktop environment doesn't handle *.ico files, you can use a local editor or a site like iConvert Icons online converter to create a compatible PNG from the ICO format.
Final Thoughts
This post was originally quite a bit longer and covered some alternative options... but GOG wouldn't allow a post that long.
My first attempt at this port failed due to an outdated Winetricks install, so thanks to WinterSnowfall for re-peaking my interest and passing along his working setup. Much appreciated.
And as always, have fun :)
Post edited May 04, 2020 by xixas