08-26-2019, 04:07 PM
Misfit's guide to running Discovery Freelancer on GNU/Linux
A brief overview
So, you're an enlightened individual who is sick and tired of Windows being slow, spying on you, and being all round garbage so you've decided to embrace an open-source, UNIX-like system. You've got your favourite browser installed, you're listening to your music with Spotify, and you've discovered gaming on Linux with Steam's Proton giving you higher FPS than your Windows contemporaries. But you miss the good old days of trading, getting pirated and then ragequitting to write an angry forum post, so you try to run Discovery Freelancer using the traditional wisdom wine methods or even using 's old guide to find it doesn't work. Well I'm here to tell you: it's possible.
It's a bit tricky and might be a bit confusing at first, but it can be done. The tl;dr version of this guide is basically install two different wine prefixes and download wine-staging 2.21, install some components with winetricks and run the game with that in one prefix and run the launcher to patch the game in the other prefix. Account switching will be done with a script I've created. Trust me, once you get it all done by following this nifty guide you'll understand how it works and how you might even be able to improve on my method. Linux is a community after all, and if you've found a better way to go about running the game (such as using a game manager like Lutris), please do share your method. There's probably many ways to go about installing disco on Linux, but this is the one we've tried and tested and we know works so far.
It's a bit tricky and might be a bit confusing at first, but it can be done. The tl;dr version of this guide is basically install two different wine prefixes and download wine-staging 2.21, install some components with winetricks and run the game with that in one prefix and run the launcher to patch the game in the other prefix. Account switching will be done with a script I've created. Trust me, once you get it all done by following this nifty guide you'll understand how it works and how you might even be able to improve on my method. Linux is a community after all, and if you've found a better way to go about running the game (such as using a game manager like Lutris), please do share your method. There's probably many ways to go about installing disco on Linux, but this is the one we've tried and tested and we know works so far.
Requirements
Wine:
- wine-staging 2.21
- wine-staging latest
- winetricks
You might be wondering why two different versions. Wine-staging 2.21 is what we use to run the game, as we've observed best results with this specific version as the game doesn't work with the latest wine-staging (and it's not like you have to install it, we'll get to that later). Current Wine-staging is what we use to install the game and run the launcher, since 2.21 won't start the launcher.
For the account switcher:
- bash (sorry I used bashisms because my smooth brain doesn't know what real programming or POSIX compliance is)
- xmlstarlet
- A DSLauncher compatible launcheraccts.xml file (You can take this file from a previous installation or you can make one of these when we install the game and run the launcher but after that you'll want to copy it somewhere easier to access)
The following 32-bit libraries installed on your system:
- lib32-libpulse
- lib32-gst-plugins-base-libs
- lib32-mpg123
- lib32-nss-mdns (for Arch users this is an AUR package)
These packages may not be the actual package name for your distribution (for instance, lib32-libpulse in Fedora is actually called pulseaudio-libs.i686). Please search for the appropriate packages names for your distribution. These packages might even be installed as part of pulseaudio, gstreamer, and mpg123 respectively.
Additionally, there may also be more packages required for your specific system. Check the wine logs and make sure you don't see anything missing if something isn't working.
Installing the game
First we need to create a fresh 32-bit wine prefix. For example
Code Wrote:mkdir .winedisco
WINEPREFIX=~/.winedisco WINEARCH=win32 wineboot
After setting up this prefix as 32 bit, it's not longer necessary to explicitly specify "winearch=win32".
The following Windows components are necessary. We can install these with winetricks.
directplay
mfc42
dotnet40
Code Wrote:WINEPREFIX=~/.winedisco winetricks directplay mfc42 dotnet40
Once these are installed you can install the game as you would on Windows. Please not that "wine" in these steps is not the wine-staging 2.21 version I told you to download earlier, this is whatever wine version is installed on your system. We use the downloaded version later to launch the game.
Code Wrote:WINEPREFIX=~/.winedisco wine <discovery installer>
Note: It is important that you change the install path to something easier to access. I install mine to a Games directory in my home directory. This makes it easier to use different wineprefixes which may be necessary.
You should now have an unpatched install of the game, congratulations.
Running the launcher
In normal use, you won't actually need the Discovery launcher. However, for our first setup and for the purposes of patching, it is necessary to run the launcher.
Now, here's where things can get a bit messy. Running the launcher in the prefix we just created will crash, and you won't be able to use the launcher. To create a DSLauncher compatible prefix, we will simply do what we did in the previous step but without installing the Windows components necessary to run the game using winetricks. For example:
Code Wrote:mkdir .winedslauncher
WINEPREFIX=~/.winedslauncher WINEARCH=win32 wineboot
To run the launcher with this new prefix:
Code Wrote:cd ~/path/to/Discovery\ Freelancer \ 4.91.0/
WINEPREFIX=~/.winedslauncher wine DSLauncher.exe
Patch the game until it says it's ready, but don't start it yet.
For fresh installs that do not have a launcheraccts.xml file:
Generate an account (or a few) using the launcher in the Accounts tab, and then export or all accounts. Take the XML file that is created and use that as your launcheraccts.xml file for the account switcher later, or just don't worry about it if you only plan on having one account (not advised).
Running the game
The important part. The part you've been waiting for. All these installed packages and set up prefix(es) lead to this.
But wait.
You can't run the game through the launcher. Wine-staging 2.21 won't start the launcher, and if you run the game from the launcher using the current wine-staging or whatever wine version you're running, the game might not work. By now you've probably got the wine-staging version I told you to download earlier, we can simply extract the contents of that tar file to a directory convenient for you. Maybe even put it in your Discovery Freelancer directory so you don't lose it.
So here is where your linux brain might have to do some work, as it's up to you how you want to start the game. You could use a desktop shortcut with options enabled (see list below), or you can use a script which you can call on with a keyboard shortcut like I do. Here's the script I run to launch the game:
Misfit Wrote:#!/bin/sh
export PATH="~/mount/staging-2.21-x86_64/bin/:$PATH"
cd ~/mount/Discovery\ Freelancer\ 4.91.0/EXE/
WINEPREFIX=~/mount/.winedisco32dotnet40 wine Freelancer.exe -s163.172.117.137:2302 -logchat -logappend -logtime -noflighttext -dptplayer -newplayer -lag -numdmg -dx -d 1366 -x 768
From this example it should be clear to you what your game options are, and how you want to set up your resolution. The main things to note are:
-You need to set your PATH environment variable to the bin directory of wine-staging 2.21. This ensures we're using the correct wine version and we don't get version mismatches from anything wine calls on while we're running (Thanks
-You need to be in the disco/EXE/ directory
-You need to specify the wine prefix that has dotnet40 installed
-You need to include the server address (and any other server addresses you wish to play on) as an -s argument.
From here, the game will launch and it will use the default created account in your wine prefix. That's where my custom account switcher script comes in.
Switching accounts
With your launcher and game in two different wine prefixes, you can't use your launcher to modify your game prefix's registry to change accounts. That's why I made a simple little script which handles that for you. It's terminal based, so don't expect any popup window with buttons or a sortable list you can sift through, just a big list of your accounts with a corresponding number which you use to select your account. It then edits the registry of the wine prefix you specify in the top of the script, thus changing the multiplayer account of the game. From there you can probably even go as far as setting up keyboard shortcuts in your desktop environment to switch accounts on the fly, or create a menu script with a utility like dmenu. The functions of the script are extensible so it's up to you.
Get the script here and please make sure you follow the instructions on the git page/in the readme as it does require some setup.
(Also I'm totally aware it's called "launcher" when it doesn't actually launch the game, it just switches accounts. I'll keep adding features to it and it will eventually become the proper Linux Launcher)
Patching the game
At the moment we don't have our own Linux-specific method of patching the game (I tried, it got me autobanned), so you'll have to use the other wine prefix to patch the game through the launcher. Remember when I told you to install the game to a non-default install path? Well that's important now. In order to start the launcher and update the game, simply do what you did earlier to start the launcher, but make sure you're using the launcher in the copy you use to play the game if you had multiple copies.
After that, start the game again through whichever method you chose (like my game launching script from earlier) and you should be up to date.
Conclusion
It takes a few more steps than it used to and we can't use the lazlauncher to start the game as we were previously able, but that doesn't stop us. Once you get everything installed and you know how to go about patching the game, your experience should be on par if not better than that of Windows users (Try changing your account with a hotkey, Winblows users). I'd like to thank the members of both the Discovery and Linux communities that have made this possible, notably
We soon hope to have a specific patcher available and this guide will be amended in the future once it is tested and incorporated into the launcher script. If you have any questions or if anything here needs to be changed please do let me know on Discord, it's on my forum profile.