Skip to content

Instantly share code, notes, and snippets.

@Yoslincake
Last active May 10, 2023 10:30
Show Gist options
  • Save Yoslincake/ddfa6f3f1aedfb6faa5f17ddd7d12f28 to your computer and use it in GitHub Desktop.
Save Yoslincake/ddfa6f3f1aedfb6faa5f17ddd7d12f28 to your computer and use it in GitHub Desktop.
How to install FAF client

Linux FAF install (steam version)

Table of Contents


1. Steam

1.1 Install Steam

Preferred way is distro package manager.

Valve wiki

1.2 Enable proton

Steam -> Settings -> Steam Play

Under Advanced "Enable Steam Play for all other titles"

1.3 Install the game

Supreme Commander: Forged Alliance

1.4 Force the use of a specific Steam Play compatibility tool

Right click game -> Properties -> Compatibility

Check mark the box and select proton 5.0-10

Note: Avoid using 5.13 or higher, while game will work the bubblewrap that steam uses might cause issues when trying to run the game with FAF client.

1.5 Set launch options

Right click game -> Properties -> General

Set following Launch Options

PROTON_NO_ESYNC=1 PROTON_DUMP_DEBUG_COMMANDS=1 %command%

PROTON_NO_ESYNC will solve black screen / slow video playback problems in the main menu and other places.
PROTON_DUMP_DEBUG_COMMANDS will generate a RUN script for your game that you will be able to use later.

1.6 Generate RUN file

Run the game from steam and generate RUN file, which we will use later.

Note: For me the game opens on black screen, but pressing ESC or clicking with mouse does bring the menu up. It's only the intros and background video that doesn't play, which is fine.

To check if the run file was generated.

$ ls -l /tmp/proton_$USER/run

2. FAF Java client

2.1 Create install location

$ mkdir -p ~/games/faf

2.2 Download the client

Download the client from github.

Note: Check the current version from github, this is just the one I tested with!

$ wget -O /tmp/dfc_unix_2022_2_0.tar.gz -c https://github.com/FAForever/downlords-faf-client/releases/download/v2022.2.0/dfc_unix_2022_2_0.tar.gz

2.3 Extract archive

Extract archive into the directory you made.

$ tar -xzf /tmp/dfc_unix_2022_2_0.tar.gz -C ~/games/faf

2.4 Install Java 17 Runtime Environment (JRE) or Development Kit (JDK)

This varies depending on distro and it's most likely best to get prebuilt OpenJDK binaries. Because Java 15 is old and outdated, you most likely won't find it in official repos.

They updated to java 17, use distro package manager, examples for Arch and Ubuntu below.

Arch

$ sudo pacman -S jdk17-openjdk

Ubuntu

$ sudo apt install openjdk-17-jre

2.4.1 Prebuilt OpenJDK binaries

Alternatively download the JRE binary. (change to version 17)

Linux x64 JRE tar.gz, old adoptopenjdk.net. new adoptium.net

For example

$ wget -c https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.2%2B7/OpenJDK15U-jre_x64_linux_hotspot_15.0.2_7.tar.gz -O /tmp/java-15-adoptopenjdk.tar.gz

Extract it into install location ~/games/faf

$ tar -xzf /tmp/java-15-adoptopenjdk.tar.gz -C ~/games/faf

Note: If it doesn't exist yet, create it mkdir -p ~/games/faf

2.4.2 Arch

Get jdk15-adoptopenjdk from aur (recommended with aur helper)

How to aur with yay

$ yay -S jdk15-adoptopenjdk

Or downgrade / install old openjdk packages (not recommended)

$ sudo pacman -U https://archive.archlinux.org/packages/j/jre-openjdk/jre-openjdk-15.0.2.u7-1-x86_64.pkg.tar.zst \
  https://archive.archlinux.org/packages/j/jre-openjdk-headless/jre-openjdk-headless-15.0.2.u7-1-x86_64.pkg.tar.zst

Note: If you do, when updating remember to ignore them with --ignore <package> or in /etc/pacman.conf IgnorePkg = <package>


2.5 Set environment variable

Check java path

$ ls /usr/lib/jvm

Note: This is where you'll usually find it if you used package manager

Every time you launch faf-client you need to set environment variable to point java path.

For example (old java 15 binary downloaded from AdoptOpenJDK)

$ export INSTALL4J_JAVA_HOME=~/games/faf/jdk-15.0.2+7-jre

2.5.1 Automate environment variable

This can be automated by editing the faf-client file or adding the export in start script/desktop file.
Open faf-client file with your favorite editor and add export on new line below the #!/bin/sh

For example

$ sed -i '2i\export INSTALL4J_JAVA_HOME=~/games/faf/jdk-15.0.2+7-jre\' ~/games/faf/faf-client-2021.11.0/faf-client

Note: The change the path depending on what and where you actually installed. To check what you have installed if you used package manager.

$ ls /usr/lib/jvm

Run FAF Java client To see if it works.

$ cd ~/games/faf/faf-client-2021.11.0 && ./faf-client

2.6 Copy and edit the run file

Copy the run file into faf directory.

$ cp /tmp/proton_$USER/run ~/games/faf/
2.6.1 Run game without steam

Edit the run file with your favorite editor and remove steam.exe from last line e.g.

$ sed -i 's/steam.exe //g' ~/games/faf/run

2.7 Set game and run paths

After you login to the FAF client

Click top left icon -> settings -> Forged Alliance Forever

In Game location add your Supreme Commander Forged Alliance dir e.g.

/home/USER/.steam/steam/steamapps/common/Supreme Commander Forged Alliance

In command Line Format for Executable add path of the run file e.g.

/home/USER/games/faf/run "%s"

Note: change USER to your actual username.

2.8 Test the game

Create test game with bots.

Play -> Custom games -> Create game

Insert name, optionally password, click create. Setup the game, remember to click ready, have fun.


3. Starting FAF-client

3.1 Clickable icon

Download icon

$ wget -P /home/$USER/games/faf/ https://raw.githubusercontent.com/tatsujb/FAFICON/master/faf.png

Create desktop file with your favorite editor and save it as faforever.desktop in ~/.local/share/applications/

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Exec=bash -c "cd /home/$USER/games/faf/faf-client-2021.11.0 && ./faf-client"
Name=FAF
Comment=Forged Alliance Forever Client
Icon=/home/$USER/games/faf/faf.png

Example:

$ cat <<EOF > /home/$USER/.local/share/applications/faforever.desktop
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Exec=bash -c "cd /home/$USER/games/faf/faf-client-2021.11.0 && ./faf-client"
Name=FAF
Comment=Forged Alliance Forever Client
Icon=/home/$USER/games/faf/faf.png
EOF

Note: copy from cat to last EOF and paste in terminal.

3.2 Symlink faf-client

You can add symlink for easier use (optional)

$ ln -s ~/games/faf/faf-client-2021.11.0/faf-client ~/.local/bin

Note: If you use this approach you need to fix relative paths in faf-client.vmoptions

3.3 Bash script to start faf-client

It might be easier to just create bash script instead and save it in /home/USER/.local/bin/faf-client (recommended)

#!/usr/bin/env bash
cd /home/$USER/games/faf/faf-client-2021.11.0 && ./faf-client

Example:

$ cat <<EOF > /home/$USER/.local/bin/faf-client
#!/usr/bin/env bash
cd /home/$USER/games/faf/faf-client-2021.11.0 && ./faf-client
EOF

Note: copy from cat to last EOF and paste in terminal.


4. Troubleshooting

Discord

Forums

4.1 Download winetricks

winetricks wine wiki

4.1.1 Arch
$ sudo pacman -S winetricks

4.2 Missing DLLs

If you are missing audio, check that you got xact installed (32-bit)

$ WINEPREFIX=/home/$USER/.steam/steam/steamapps/compatdata/9420/pfx/ winetricks dlls xact

If the game is crashing at start and giving errors about unable to load effect files.

$ WINEPREFIX=/home/$USER/.steam/steam/steamapps/compatdata/9420/pfx/ winetricks dlls d3dx9

4.3 Low FPS

Adding PROTON_NO_FSYNC=1 in steam launch options might help if you're suffering low FPS.

4.4 Last resort

Check the outdated wiki


9. Ubuntu 20.04.4 LTS (nvidia)

Fresh install: Minimal ubuntu 20.04.4 LTS install, no proprietary included

            .-/+oossssoo+/-.               user@ubuntu-20-04-4-lts 
        `:+ssssssssssssssssss+:`           ------------------------ 
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 20.04.4 LTS x86_64 
    .ossssssssssssssssssdMMMNysssso.       Kernel: 5.13.0-30-generic 
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Uptime: 21 mins 
  +ssssssssshmydMMMMMMMNddddyssssssss+     Packages: 1806 (dpkg), 7 (snap) 
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Shell: bash 5.0.17 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Resolution: 2560x1440 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   DE: GNOME 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   WM: Mutter 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   WM Theme: Adwaita 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Theme: Yaru [GTK2/3] 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Icons: Yaru [GTK2/3] 
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/    Terminal: gnome-terminal 
  +sssssssssdmydMMMMMMMMddddyssssssss+     CPU: AMD Ryzen 9 3900X (24) @ 3.800GHz 
   /ssssssssssshdmNNNNmyNMMMMhssssss/      GPU: NVIDIA GeForce GTX 1080 Ti 
    .ossssssssssssssssssdMMMNysssso.       Memory: 2657MiB / 32025MiB 
      -+sssssssssssssssssyyyssss+-
        `:+ssssssssssssssssss+:`                                   
            .-/+oossssoo+/-.                                       

Install steam

$ sudo apt install steam

In steam

Right click game -> properties -> compatibility, check force use and select proton 5.0-10

Install supreme commander: forged alliance and proton 5.0

Note: I highly suggest using specifically 5.0-10 version for this game with FAF client.

Start the game - gpu error

Unable to start
Unable to create Direct3D
Please ensure system has current video driver

Problem is that ubuntu 20.04 only has nouveau driver installed for nvidia by default. You very much want the proprietary (non-free) one for gaming.

Note: To check what GPU you have, these instructions are for nvidia

$ lspci | grep -i --color 'vga\|3d\|2d'

or (need to install hwinfo)

$ sudo apt install hwinfo
$ hwinfo --gfxcard --short

You can run following command

$ sudo ubuntu-drivers devices

Notice the "recommended" line

vendor   : NVIDIA Corporation
model    : GP102 [GeForce GTX 1080 Ti]
driver   : nvidia-driver-470 - distro non-free
driver   : nvidia-driver-510 - distro non-free recommended
driver   : nvidia-driver-390 - distro non-free
driver   : nvidia-driver-418-server - distro non-free
driver   : nvidia-driver-450-server - distro non-free
driver   : nvidia-driver-470-server - distro non-free
driver   : xserver-xorg-video-nouveau - distro free builtin

Automaticly install recommended drivers

$ sudo ubuntu-drivers autoinstall

Restart PC

$ reboot

Check if you're on nvidia drivers (need to install mesa-utils)

$ sudo apt install mesa-utils
$ glxinfo -B

Should give things like

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce GTX 1080 Ti/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 510.47.03

Or with nvidia stuff

$ nvidia-smi

Or gui application

$ nvidia-settings

If you can't run these, rebooted and still get error you have problems. Maybe xorg configs need fixing, maybe nouvaeu needs blacklisting or integrated gpu is messing up someting. There's too many guesses, hopefully search engine helps.

Start the game - general

CD3DDeviceResources::DevResInitResources: Unable to load effect file /effects/cartographic.fx   

Game needs d3dx9 libs to run. Also I had to get xact to hear audio. This is where we use winetricks!

Note: you can use protontricks too It's just additional layer ontop winetricks which isn't necessarily needed, but might be easier to use.

$ sudo apt install winetricks
$ WINEPREFIX=/home/$USER/.steam/steam/steamapps/compatdata/9420/pfx/ winetricks dlls d3dx9 xact

Pay attention to the WINEPREFIX path, for example I have my games in another drive so I would type

$ WINEPREFIX=/mnt/games/SteamLibrary/steamapps/compatdata/9420/pfx winetricks dlls d3dx9 xact

End

Those were the problems I did encounter when testing to install and play the game on Ubuntu. After installing nvidia drivers and getting the dlls the game started fine, check what to do next to get FAF client working 1.5 Set launch options

Very quick rundown of commands for (unsupported) java 17, which seems to so far work fine.

Tested with java 17 (much easier to install), even thought FAF client devs still recommend 15.

Note: I don't follow java developement nor know what was changed between 15 and 17, but from my limited testing everything seems fine. Check the situation here

Getting the recommended version shouldn't be too much of a hassle java 15

$ sudo apt install openjdk-17-jre

Check java dir

$ ls /usr/lib/jvm

Edit ~/games/faf/faf-client-2022.2.0/faf-client add the following or modify the existing override var

export INSTALL4J_JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64

more importantly if you're using higher than intended version modify the check on line 150 (shouldn't need anymore)

if [ "$ver_major" = "" ]; then
  return;
fi
if [ "$ver_major" -lt "15" ]; then
  return;
fi

if [ "$ver_major" = "" ]; then
  return;
fi
if [ "$ver_major" -gt "17" ]; then
  return;
fi

copy the generated run file 1.5 Set launch options

$ cp /tmp/proton_$USER/run ~/games/faf/

after that you should be able to run the game

$ cd ~/games/faf/faf-client-2022.2.0/ && ./faf-client

After you login to the FAF client

Click top left icon -> settings -> Forged Alliance Forever

In Game location add your Supreme Commander Forged Alliance dir e.g.

/home/USER/.steam/steam/steamapps/common/Supreme Commander Forged Alliance

In command Line Format for Executable add path of the run file e.g.

/home/USER/games/faf/run "%s"
@Angular-Angel
Copy link

The 'INSTALL4J_JAVA_HOME_OVERRIDE=' one, specifically.

@Yoslincake
Copy link
Author

I don't recommend using export app_java_home=$JAVA_HOME it skips quite many checks that the FAF devs seem to expect
either setting export INSTALL4J_JAVA_HOME=<java-path> before running game
e.g. cd ~/games/faf/faf-client-2021.11.0 && export INSTALL4J_JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 && ./faf-client
or editing the faf-client variable INSTALL4J_JAVA_HOME_OVERRIDE is better as that's how they intentded it to be used. However since the linux support is still unofficial, if whatever workaround works and you get to play the game, great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment