Skip to content

FAForever/faf-linux

Repository files navigation

FAF on Linux

A set of scripts to automatically set up Supreme Commander: Forged Alliance with Forged Alliance Forever on Linux. Tested on some places.

Important notice

faf-linux has been updated to use the Steam Runtime. This will simplify installation and should eliminate a large class of strange bugs caused by distro differences.

Some recent versions of Ubuntu break sandboxing by default. If you see the error message FATAL: bwrap missing or nonfunctional, you will need to run echo "kernel.apparmor_restrict_unprivileged_userns = 0" | sudo tee /etc/sysctl.d/99-allow-userns.conf and then reboot.

Setup instructions

  1. Install prerequisites from your distribution's package manager:
    • Debian and derivatives (including Ubuntu, Pop!_OS, and Linux Mint):
      • Ensure i386 architecture is enabled: sudo dpkg --add-architecture i386
      • sudo apt install git curl jq bubblewrap libvulkan1:amd64 libvulkan1:i386
      • Nvidia drivers: make sure to have libnvidia-gl-xxx:i386 (where X is the major version returned by nvidia-smi) installed.
    • Fedora and Red Hat-based (including Bazzite and Nobara):
      • sudo dnf install git curl jq bubblewrap vulkan-loader.x86_64 vulkan-loader.i686
    • Arch Linux and derivatives (including Manjaro, EndeavourOS, and CachyOS):
      • 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 curl jq bubblewrap vulkan-icd-loader lib32-vulkan-icd-loader
    • 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
        
      • sudo emerge -avuND @world
      • sudo emerge -a dev-vcs/git net-misc/curl app-misc/jq sys-apps/bubblewrap media-libs/vulkan-loader (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
      • In your Nix configuration, add the following, then rebuild:
        programs.steam = {
          enable = true;
          package = with pkgs; steam.override { extraPkgs = pkgs: [
            jq
            curl
            git
          ];};
        };
      • Run steam-run bash to start a shell in the configured FHS 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 #38 for more information
    • Other distributions:
      • Commands needed: git, curl, jq, bwrap
      • Libraries needed:
        • Both 32-bit and 64-bit versions of:
          • libvulkan.so.1 (Vulkan ICD loader)
    • 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
    • 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.
    • If you are using the game from GOG, skip this step
  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, 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" ./setup.sh
    • Note: if you are using Ubuntu, you may see the error message FATAL: bwrap missing or nonfunctional. Ubuntu disallows applications to use sandboxing/containerization features (user namespaces) unless explicitly whitelisted. To fix this, run echo "kernel.apparmor_restrict_unprivileged_userns = 0" | sudo tee /etc/sysctl.d/99-allow-userns.conf and then reboot. Additionally, consider not using Ubuntu.
  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. You may safely delete old versions after update completes. The script will not currently automatically remove old versions.

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

  • Black screen immediately after launching the game: follow the steps below to enable the virtual desktop.
    • This only seems to happen on Nvidia GPUs.
  • Forged Alliance minimizes itself on Alt-Tab: run ./launchwrapper winecfg, go to "Graphics", then check the "Emulate a virtual desktop" box.
    • Warning: as of 2022-10-24, this does cause everything to break. You have been warned. This is no longer the case.
    • To run the game in fullscreen with the virtual desktop, set the virtual desktop resolution to your monitor's resolution.
    • Gamescope is an alternative, see below
  • FPS is horrendously low / UI lags several seconds: ForgedAlliance.exe might not be using your GPU. Make sure you have 32-bit support for your GPU drivers installed. Refer to the Ubuntu section on how to do this for Nvidia drivers.
    • Debug info for Nvidia drivers: : Run watch -n 1 nvidia-smi before starting the FAF client and a game. Once you start a game, nvidia-smi should list ...o/.faforever/bin/ForgedAlliance.exe as one of the process names. If it does not, your FAF game is not using your GPU. You may not have 32-bit support installed for your GPU drivers. If you have 32-bit support, then ls -lah {/etc,/usr/share}/vulkan/icd.d/ should list an nvidia_icd.i686.json.
  • Mouse cursor stuck, can't click things in lobby: quit out of the game and the FAF client, run ./run-offline, click past the intro videos until you get to the main menu, exit the game, then try starting a game from FAF again
  • Game crashes with "Unable to create Direct3D", logs have wine error "Application requires child window rendering": libXcomposite is missing or failed to initialize, try installing libxcomposite or libXcomposite from package manager (the 32-bit version as well)
    • This should no longer happen. Please visit the support channel.
  • FAF client crashes on launch with massively enormous error message, at the bottom it says something along the lines of "cannot use an unresolved DNS server address": Chances are there's something in your /etc/resolv.conf that netty does not understand (for example, scoped IPv6 addresses). Install systemd-resolved if possible.
  • If you encounter strange display issues, consider using gamescope. In common-env, set use_gamescope="1" (or add that line if it does not already exist). Gamescope does not support the Nvidia driver.
  • Mod selector in client doesn't work: this has been fixed by a recent commit, however it only takes effect on new installations. To fix the problem without a reinstall, find game_data_path in common-env, then replace Local Settings/Application Data with AppData/Local.
  • Failed to create vulkan instance
    • May appear as:
      • 0024:err:vulkan:__wine_create_vk_instance_with_callback Failed to create instance
      • 0024:err:vulkan:wine_vk_instance_load_physical_devices Failed to enumerate physical devices, res=-3
      • terminate called after throwing an instance of 'dxvk::DxvkError'
    • Possible issues:
      • Vulkan drivers are not installed. Please install the appropriate Vulkan drivers for your GPU and distribution and install them.
      • 32-bit graphics drivers (including Vulkan libraries) are not installed. Please ensure both 32-bit and 64-bit graphics drivers, including Vulkan support, are installed.
      • You are on Arch and have accidentally installed lib32-amdvlk. AMDVLK is the old AMD Vulkan driver and causes many issues. Unless you are sure you need AMDVLK, uninstall lib32-amdvlk, and if necessary, install lib32-vulkan-radeon (newer AMD RADV driver) in its place.
  • No adapters found
    • May appear as:
      • Skipping Vulkan 1.2 adapter
      • DXVK: No adapters found.
      • "Requested display count exceeds those available."
    • Your graphics driver lacks support for features required by the installed dxvk version. Please update your graphics drivers if possible.
    • If updating graphics drivers is not an option, manually downgrade dxvk (./update-component.sh dxvk 1.10.3) then add the line dxvk_pin_version="1" at the bottom of common-env to prevent the updater script from reverting to a newer version of dxvk.
  • setup.sh hangs on the wineboot step
    • This should no longer happen. Please visit the support channel.
  • Some errors related to missing effects or missing maps
    • May be caused by the client failing to update game files
    • Try deleting ~/.faforever (create backup first if necessary)
    • Proceed from step 6 of the guide (start client, log in, close client, run ./set-client-paths.sh)
  • 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.

Why should you use this

  • Years of my own suffering have culminated in this massive pile of hacks
  • I suck at faf so I literally spend more time maintaining these scripts than playing faf
  • I stole a bunch of open source stuff from Steam that makes the game run better (thanks Valve)

About

Scripts for Forged Alliance Forever (FAF) on Linux

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors

Languages