FAForever / faf-linux

Scripts for Forged Alliance Forever (FAF) on Linux
71 stars 6 forks source link

FAF on Linux

A set of scripts to automatically set up Supreme Commander: Forged Alliance with Forged Alliance Forever on Linux. Tested on Ubuntu, Fedora, and Arch, should work on other distributions as well.

Setup instructions

  1. Install prerequisites from your distribution's package manager:
    • Debian and derivatives (Ubuntu, Pop!_OS, Linux Mint, etc):
      • Ensure i386 architecture is enabled: sudo dpkg --add-architecture i386
      • sudo apt install git wget jq cabextract libvulkan1:amd64 libvulkan1:i386 libpulse0:amd64 libpulse0:i386 libfreetype6:amd64 libfreetype6:i386 libxcomposite1:amd64 libxcomposite1:i386 libxrandr2:amd64 libxrandr2:i386 libxfixes3:amd64 libxfixes3:i386 libxcursor1:amd64 libxcursor1:i386 libxi6:amd64 libxi6:i386
    • Fedora and Red Hat-based:
      • sudo dnf install git wget jq cabextract vulkan-loader.x86_64 vulkan-loader.i686 pulseaudio-libs.x86_64 pulseaudio-libs.i686 freetype.x86_64 freetype.i686 libXcomposite.x86_64 libXcomposite.i686 libXrandr.x86_64 libXrandr.i686 libXfixes.x86_64 libXfixes.i686 libXcursor.x86_64 libXcursor.i686 libXi.x86_64 libXi.i686
    • Arch Linux and derivatives (Manjaro, EndeavourOS, etc):
      • If you haven't enabled multilib in pacman yet, go to edit file /etc/pacman.conf and make sure the following are uncommented (including header):
        [multilib]
        Include = /etc/pacman.d/mirrorlist

        And then upgrade the system sudo pacman -Syu

      • sudo pacman -Syu git wget jq cabextract vulkan-icd-loader lib32-vulkan-icd-loader libpulse lib32-libpulse freetype2 lib32-freetype2 libxcomposite lib32-libxcomposite libxrandr lib32-libxrandr libxfixes lib32-libxfixes libxcursor lib32-libxcursor libxi lib32-libxi
    • Gentoo Linux:
      • Add following to /etc/portage/package.use/faforever (or whatever file you want in that folder):
        media-libs/vulkan-loader abi_x86_32
        media-libs/libpulse abi_x86_32
        media-libs/freetype abi_x86_32
        x11-libs/libXcomposite abi_x86_32
        x11-libs/libXrandr abi_x86_32
        x11-libs/libXfixes abi_x86_32
        x11-libs/libXcursor abi_x86_32
        x11-libs/libXi abi_x86_32
      • sudo emerge -avuND @world
      • sudo emerge -a dev-vcs/git net-misc/wget app-misc/jq app-arch/cabextract media-libs/vulkan-loader media-libs/libpulse media-libs/freetype x11-libs/libXcomposite x11-libs/libXrandr x11-libs/libXfixes x11-libs/libXcursor x11-libs/libXi (feel free to exclude any ebuilds that is already present in your system, no need to rebuild)
    • NixOS and other Nix-based environments:
      • Ensure graphics drivers are installed
      • Run nix-shell -p steam-run jq cabextract wget git --run "steam-run bash" to start a shell with the necessary environment
      • Proceed with the rest of the installation steps below. All scripts, including ./run, will need to be executed within this environment.
      • The desktop file generated by install-shortcut.sh will need to be edited to include the command above
      • In the future, the scripts should seamlessly support a Nix environment
      • Please see https://github.com/FAForever/faf-linux/issues/38 for more information
    • Other distributions:
      • Commands needed: git, wget, jq, cabextract
      • Libraries needed:
      • Both 32-bit and 64-bit versions of:
        • libvulkan.so.1 (Vulkan ICD loader)
        • libpulse.so.0 (pulseaudio client library, required even if using PipeWire)
        • libfreetype.so.6 (FreeType font rendering library)
        • libXcomposite.so.1 (XComposite extension client library)
        • libXrandr.so.2 (XRandR extension client library)
        • libXfixes.so.3 (XFixes extension client library)
        • libXcursor.so.1 (XCursor extension client library)
        • libXi.so.6 (XInput extension client library)
    • Note: 32-bit graphics drivers are required. If using Intel or AMD, install the 32-bit version of mesa-vulkan-drivers. On Fedora, this is mesa-vulkan-drivers.i686. On Debian, this is mesa-vulkan-drivers:i386. On Arch, this is lib32-vulkan-DRIVERNAME, where DRIVERNAME is radeon or intel. If using Nvidia, ensure you have the 32-bit driver package installed. These should already be installed, although they may be missing if you have installed Steam within Flatpak.
  2. Install Steam, then install Supreme Commander: Forged Alliance from Steam
    • In Properties -> Compatibility, check "Force the use of a specific Steam Play compatibility tool", and select "Proton Experimental"
    • Start the game from Steam. This step is needed to download and unpack Proton Experimental.
    • Note: the game may lag horribly or not even start. This is fine, as the rest of this guide should still work.
    • If you want to play Forged Alliance on Steam, set PROTON_NO_ESYNC=1 PROTON_NO_FSYNC=1 %command% in launch options. If you only wish to play on FAF, this step is not necessary.
  3. Clone this repository
    • Open a terminal where the installation should be located, then run git clone https://github.com/FAForever/faf-linux
    • This will create a new folder named faf-linux, where the client will be installed.
    • Do not put faf-linux within the game directory or any other Steam-managed directories. It will not function properly.
  4. Run ./setup.sh to set up the local wine prefix, the FAF client, java, and others
    • Note: the script will install everything into the path where you cloned this repository. If you wish to move the installation later, edit the paths in common-env then re-run ./set-client-paths.sh and ./install-shortcut.sh.
    • Note: if you bought the game from GOG and installed it with Lutris, you need to run the setup like this: BYPASS_STEAM=1 GAME_PATH="/path/to/Lutris/gog/supreme-commander-forged-alliance/drive_c/GOG Games/Supreme Commander Forged Alliance" PROTON_PATH="/path/to/Steam/steamapps/common/Proton - Experimental" ./setup.sh
  5. Start the FAF client with ./run and log in
  6. After logging in, close the FAF client and run ./set-client-paths.sh
  7. To launch FAF, run ./run
  8. If you wish to launch FAF without using the terminal, run ./install-shortcut.sh. FAF will show up as "Forged Alliance Forever" in your application launcher.

How to update after installation

  1. Run ./update.sh perform to update necessary components automatically
  2. The update script will not automatically remove old versions currently. If new versions work, old versions are safe to delete.

Manually updating individual components

The script ./update-component.sh is provided for convenient updating of certain parts. Generally you do not need to use this.

Help, it doesn't work!

Please check the section below for common troubleshooting steps. Failing that, please ping @iczero on the FAF Discord guild in the tech-support-forum channel.

Weird issues and other nonsense

Why should you use this