Linux install script (Lutris)

I've tested out a few distros with the script to make sure FAF works stable on all flavours of Linux using it.

✔ Ubuntu 20.04 LTS
✔ Pop!_OS 20.10
✔ Linux Mint 20.1 "Ulyssa"
✔ Fedora 34 Workstation
✔ OpenSUSE Tumbleweed
✔ MX Linux 19.4.1-ahs
✔ ElementaryOS 5.1
✔ Manjaro 21.0.5
✔ Debian 10 Buster
⚠ Arch Linux

The mentioned bug on Arch Linux may be a sole problem of me missing a specific package (classic Arch problem I assume). Someone may confirm and tell which one it was for FAF to recognize Env vars so it can be fixed. Since Manjaro works fine it probably is just missing configuration on my side. ☺

https://lutris.net/games/forged-alliance-forever-steam-latest/installer/edit
made my own attempt which looks less hacky and is working on arch

You could edit the wiki and make an instruction there on how to do your thing https://wiki.faforever.com/index.php?title=Setting_Up_FAF_Linux

Soon™️

@axel12 Already done here.

@ovo Your install script doesn't work, throws Error 17 "File already exists" after looking for the run file. This isn't the only problem though.

Other things I noticed:

  • You're getting the files via wget instead of using Lutris' in-built file download function. Works, but isn't beautiful since you skip the option to insert the files yourself
  • Instead of downloading the FAF client, you're downloading the Java 15 SDK twice
  • The Steam arguments you give are missing %command%
  • Having the user manually looking for the run file is unnecessary, it will always spawn in /tmp/proton-$USER/
  • You made the same error like me with line breaks 😉
  • The user isn't told to set a specific Proton version. This can cause later problems like desyncs, as described here.
  • You don't tell the user that SteamPlay has to be activated for every title in order to even install Forged Alliance. In my opinion missing information like this is extremely frustrating for new users.
  • Your client.prefs file will be rejected by the FAF client since the lobby isn't written to simply add missing entries, but expect them to be already present. That's the reason I uploaded a prepared one for my script which I edit using sed, so the client accepts the file.
  • You do not set the preferences file location, therefore FAF lobby will look for it in ~/.wine/ and create a new one there, ignoring your FA settings as well as forgetting all settings every time a user might deletes his standard wine prefix.
  • Not a necessity, but I find the option to have all files in your defined game folder quite important for large games so your /home won't get cluttered. In the end FAF will save literally everything in ~/.faforever/

Sorry, but as it is, your script is absolutely non-working on any machine and riddled with problems.

@sereiya i've posted a link to edit script, since new drafts wont appear before lutris team moderation, take a look into it

You're getting the files via wget instead of using Lutris' in-built file download function. Works, but isn't beautiful since you skip the option to insert the files yourself

can be done for JRE, but i guess only the latest version of FAF should be aviable, especially after 1.4.4

Having the user manually looking for the run file is unnecessary, it will always spawn in /tmp/proton-$USER/

sounds reasonable, used this one just to show instruction dialog
may just use input_menu

The user isn't told to set a specific Proton version. This can cause later problems like desyncs, as described here.

Didn't checked, but haven't latest proton already got rid if most of FA errors?
https://www.winehq.org/announce/6.7
That one fixed the last bug for FA, may not be an issue for future versions of proton.

You don't tell the user that SteamPlay has to be activated for every title in order to even install Forged Alliance. In my opinion missing information like this is extremely frustrating for new users.

Agree

Your client.prefs file will be rejected by the FAF client since the lobby isn't written to simply add missing entries, but expect them to be already present. That's the reason I uploaded a prepared one for my script which I edit using sed, so the client accepts the file.

Works 4 me👍
Will look into it

You do not set the preferences file location, therefore FAF lobby will look for it in ~/.wine/ and create a new one there, ignoring your FA settings as well as forgetting all settings every time a user might deletes his standard wine prefix.

Uuugh, but it doesnt even uses standart wine

Not a necessity, but I find the option to have all files in your defined game folder quite important for large games so your /home won't get cluttered. In the end FAF will save literally everything in ~/.faforever/

Agree, can it be done just with a symlink?

UPD: ok, zero brain moment, just realized only i have access to edit page

@ovo I've looked into it, but every iteration of the draft shows the same bugged version. I encounteres some similar behaviour when I worked with the page which is why I almost never saved it before commiting and mostly worked offline. I assume the website is bugged. 😕

Since I uploaded the .yaml code in my first post (clearer syntax than on lutris . net, looks way less "hacky"), why won't you just take the code that's already working but seem a little hacky to you and just edit it? 😘 Not lying, it feels weird to see someone completely working around me and encountering some problems I already solved within a few hours of testing. Stuff like the optional ~/.faforever/ symlink is already included too, and as I said I'm not even sure the problem on Arch wasn't due to a faulty configuration on my side.

Updated to Lobby version 1.4.6 due to the serverload issue. Filename still says 1.4.4-RC1 simply because the Lutris mods still didn't review the installer, therefore link changes aren't applied. Next revision of the install script will have some fancy code to update the lobby automatically through Lutris. 😄

It worked, Thank you!

Before I stated I installed the open source AMDGPU driver for my RX 570 with pretty much everything from the "Install" section: https://wiki.archlinux.org/title/AMDGPU
I am on Manjaro, the only problem I encountered was that the game crashes on launch, saying “CD3DDeviceResources::DevResInitResources: Unable to load effect file /effects/cartographic.fx”

I followed this guys guide: https://www.protondb.com/users/1007765403
But skipped the resolution changes. Maybe that was why the first start of the steam version took quite long, the cut scenes were laggy but skippable.

Install winetricks:
ubuntu: sudo apt install winetricks
manjaro: sudo pacman -S winetricks

Install protontricks using this guide from simpler: https://www.simpler.website/html/2021/1/protontricks.html

Copy from simpler:
Arch based Linux distros:
Open the terminal, then copy and paste these commands:
sudo pacman -S python-pip python-pipx python-setuptools python-virtualenv
python3 -m pip install --user pipx
python3 -m pipx ensurepath

Close and reopen the terminal again.
Install protontricks using this command:

pipx install protontricks

in a terminal, write: protontricks 9420 dlls d3dx9

in a terminal, write: protontricks 9420 dlls xact

(if you, at a later stage, change proton version in steam, you have to reinstall the above two libraries since they don’t seem to come with proton.)

Now start the game. It took quite some time for me. Create a game profile ingame and exit.
edit your Game.prefs on ubuntu it’s located in:

~/.steam/debian-installation/steamapps/compatdata/9420/pfx/drive_c/users/steamuser/Local Settings/Application Data/Gas Powered Games/Supreme Commander Forged Alliance/ change primary_adapter = ‘1024,758,60’, to whatever your native screen resolution is, mine is: primary_adapter = ‘2560,1440,60’, and save.

Edit launch options again (see step above) and remove “/windowed 1024 758” leaving just PROTON_NO_ESYNC=1, PROTON_DUMP_DEBUG_COMMANDS=1 %command%.

All that is left now is to install faforever client (for multiplayer), check the wiki: https://wiki.faforever.com/index.php?title=Setting_Up_FAF_Linux#Java_Downlord.27s_Client

Any help with this? Installed with OPs scripts, FA works fine through Steam, the client crashes when logging in though. This is on Arch.

lutris-wrapper: Forged Alliance Forever
Running /home/max/Games/forged-alliance-forever/lobby/downlords-faf-client
Initial process has started with pid 53623
Start monitoring process.
19:52:08.557 [main] DEBUG com.faforever.client.preferences.PreferencesService - Logger initialized
2021-10-02 19:52:09.471  WARN 53623 --- [kground-preinit] o.s.h.c.j.Jackson2ObjectMapperBuilder    : For Jackson Kotlin classes support please add "com.fasterxml.jackson.module:jackson-module-kotlin" to the classpath
2021-10-02 19:52:09.517  INFO 53623 --- [JavaFX-Launcher] o.s.boot.SpringApplication               : Starting application using Java 15.0.2 on endeavour with PID 53623 (started by max in /home/max/Games/forged-alliance-forever/lobby)
2021-10-02 19:52:09.518  INFO 53623 --- [JavaFX-Launcher] o.s.boot.SpringApplication               : The following profiles are active: prod,linux
2021-10-02 19:52:10.068  INFO 53623 --- [JavaFX-Launcher] trationDelegate$BeanPostProcessorChecker : Bean 'asyncConfig' of type [com.faforever.client.config.AsyncConfig$$EnhancerBySpringCGLIB$$ebe4d117] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-10-02 19:52:10.081  INFO 53623 --- [JavaFX-Launcher] trationDelegate$BeanPostProcessorChecker : Bean 'cacheConfig' of type [com.faforever.client.config.CacheConfig$$EnhancerBySpringCGLIB$$4d23845d] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.gson.internal.reflect.UnsafeReflectionAccessor (file:/home/max/Games/forged-alliance-forever/lobby/lib/gson-2.8.5.jar) to field java.net.HttpCookie.name
WARNING: Please consider reporting this to the maintainers of com.google.gson.internal.reflect.UnsafeReflectionAccessor
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2021-10-02 19:52:10.235  INFO 53623 --- [JavaFX-Launcher] c.f.c.preferences.PreferencesService     : Switching FA Forever logging configuration to INFO
2021-10-02 19:52:10.254  INFO 53623 --- [JavaFX-Launcher] o.s.s.c.ThreadPoolTaskScheduler          : Initializing ExecutorService 'taskScheduler'
2021-10-02 19:52:10.590  INFO 53623 --- [JavaFX-Launcher] c.f.c.map.generator.MapGeneratorService  : Deleting leftover generated maps...
2021-10-02 19:52:10.681  INFO 53623 --- [JavaFX-Launcher] com.faforever.client.update.Version      : The current application version is: 1.4.6
2021-10-02 19:52:10.688  INFO 53623 --- [JavaFX-Launcher] c.f.c.update.ClientUpdateServiceImpl     : Current version: 1.4.6
2021-10-02 19:52:10.692  INFO 53623 --- [pool-3-thread-3] c.f.client.update.CheckForUpdateTask     : Checking for client update
2021-10-02 19:52:10.711  INFO 53623 --- [pool-3-thread-4] c.f.c.update.CheckForBetaUpdateTask      : Checking for client update (pre-release channel)
2021-10-02 19:52:10.919  INFO 53623 --- [JavaFX-Launcher] o.s.boot.SpringApplication               : Started application in 2.07 seconds (JVM running for 2.857)
2021-10-02 19:52:11.232  INFO 53623 --- [lication Thread] com.faforever.client.update.Version      : fromVersion '1.4.6' is not newer than toVersion '1.4.6'. No update is required.
2021-10-02 19:52:15.675  INFO 53623 --- [    Discord RPC] c.f.client.discord.DiscordEventHandler   : Discord is ready with user 'BenDover'
2021-10-02 19:52:18.111  INFO 53623 --- [      Thread-12] c.f.client.remote.FafServerAccessorImpl  : Trying to connect to FAF server at lobby.faforever.com:8001
2021-10-02 19:52:18.140  INFO 53623 --- [      Thread-12] c.f.client.remote.FafServerAccessorImpl  : FAF server connection established
2021-10-02 19:52:18.164  INFO 53623 --- [      Thread-12] c.f.client.remote.FafServerAccessorImpl  : FAF session initiated, session ID: 2857377651
2021-10-02 19:52:27.779  INFO 53623 --- [      Thread-12] c.f.client.remote.FafServerAccessorImpl  : FAF login succeeded
2021-10-02 19:52:27.943  INFO 53623 --- [lication Thread] com.faforever.client.update.Version      : fromVersion version '1.6' is newer than toVersion '1.4.6'. fromVersion should be updated.
> Patching com/sun/webkit/WebPage ...
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f5e22d83399, pid=53623, tid=53915
#
# JRE version: OpenJDK Runtime Environment (15.0.2+7) (build 15.0.2+7-27)
# Java VM: OpenJDK 64-Bit Server VM (15.0.2+7-27, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [libavcodec.so.58+0x1bc399]  av_packet_free_side_data+0x9
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to /home/max/Games/forged-alliance-forever/lobby/core.53623)
#
# An error report file with more information is saved as:
# /home/max/Games/forged-alliance-forever/lobby/hs_err_pid53623.log
[thread 53920 also had an error]
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#
Monitored process exited.
All monitored processes have exited.
Monitored process didn't return an exit code.
Exit with returncode 0

Update:
I fixed it, what I did was change config in lutris to windows and back to linux to reset to defaults, changed the executable like it used to be, added INSTALL4J_JAVA_HOME=.. and PROTON_NO_ESYNC=1, changed in Game.prefs my primary adapter to 2560,1440,120 and it works now in fullscreen borderless window.

I get a FAF splash screen for a second and then it closes. Pls fix?
And im on Manjaro KDE, if that makes any sense.

Edit: I guess i have the same bug as Arch and Manjaro xfce, manually launching with the command works.
Also why is FAF client written in Java?

FAF client was written in Java as that is what a contributor wanted to write it in and that who we have to support it contributor come and go.

"The needs of the many outweigh the needs of the few" - Spock

I'm sorry, I was gone from the community for a while due to health issues. I'll look into the provided logs asap. 🙂

@sereiya Thanks for your hard work mate!

FAF Website Developer

@sereiya Thanks very much for the script I am not sure if I would have made it without it, also on Manjaro Xfce

INSTALL4J_JAVA_HOME=/path/to/game/folder/openjdk15/ ./faf-client

worked for me and I now see the launcher but I have twoone problems:

  1. this is a smaller one, can I somehow specify the INSTALL4J_JAVA_HOME=/path/to/game/folder/openjdk15 somewhere so that I can start the game through Lutris.

  2. This seems to be java related but it prevents me from logging in, java cant resolve lobby.faforever.com java.net.UnknownHostException: Failed to resolve 'lobby.faforever.com' (just while I am writing this it seems to be fixed by specifying the IP in my hosts file)

So just 1., how can I make it so that I can run the mod through Lutris without the need to run INSTALL4J_JAVA_HOME=/path/to/game/folder/openjdk15/ ./faf-client every time I want to start the launcher?

Sry if this is the wrong place for bug support but after I finally got the launcher working I thought the game would run as well, turns out it doesn't.

When I am starting(or joining) a custom game the game starts but seems to load in the "Connecting" screen infinity and it seems that there are no errors in the console:

2022-01-04 17:13:18.374  INFO 8373 --- [      Thread-46] c.f.client.fa.ForgedAllianceService      : Starting Forged Alliance with command: [%USER_PROFILE%/Games/forged-alliance-forever/run, %USER_PROFILE%/.faforever/bin/ForgedAlliance.exe, /init, init.lua, /nobugreport, /log, %USER_PROFILE%/.faforever/logs/game_16054279.log, /gpgnet, 127.0.0.1:63025, /mean, 1500.0, /deviation, 500.0, /savereplay, gpgnet://127.0.0.1:33381/16054279/Lamdarer.SCFAreplay, /country, DE, /numgames, 0, /numgames, 0] in directory: %USER_PROFILE%/.faforever/bin
wineserver: using server-side synchronization.
Setting breakpad minidump AppID = 9420
Steam_SetMinidumpSteamID:  Caching Steam ID:  76561198329369279 [API loaded no]
info:  Game: ForgedAlliance.exe
info:  DXVK: v1.7-8-g51531e4a7
info:  Built-in extension providers:
info:    Win32 WSI
info:    OpenVR
Unable to read VR Path Registry from C:\users\steamuser\Local Settings\Application Data\openvr\openvrpaths.vrpath
warn:  OpenVR: Failed to initialize OpenVR
info:  Enabled instance extensions:
info:    VK_KHR_get_surface_capabilities2
info:    VK_KHR_surface
info:    VK_KHR_win32_surface
warn:  D3D9: VK_FORMAT_D16_UNORM_S8_UINT -> VK_FORMAT_D24_UNORM_S8_UINT
info:  NVIDIA GeForce GTX 1060 6GB:
info:    Driver: 495.44.0
info:    Vulkan: 1.2.186
info:    Memory Heap[0]: 
info:      Size: 6144 MiB
info:      Flags: 0x1
info:      Memory Type[7]: Property Flags = 0x1
info:    Memory Heap[1]: 
info:      Size: 11988 MiB
info:      Flags: 0x0
info:      Memory Type[0]: Property Flags = 0x0
info:      Memory Type[1]: Property Flags = 0x0
info:      Memory Type[2]: Property Flags = 0x0
info:      Memory Type[3]: Property Flags = 0x0
info:      Memory Type[4]: Property Flags = 0x0
info:      Memory Type[5]: Property Flags = 0x0
info:      Memory Type[6]: Property Flags = 0x0
info:      Memory Type[8]: Property Flags = 0x6
info:      Memory Type[9]: Property Flags = 0xe
info:    Memory Heap[2]: 
info:      Size: 246 MiB
info:      Flags: 0x1
info:      Memory Type[10]: Property Flags = 0x7
info:  Process set as DPI aware
info:  Device properties:
info:    Device name:     : NVIDIA GeForce GTX 1060 6GB
info:    Driver version   : 495.44.0
info:  Enabled device extensions:
info:    VK_EXT_depth_clip_enable
info:    VK_EXT_full_screen_exclusive
info:    VK_EXT_host_query_reset
info:    VK_EXT_shader_demote_to_helper_invocation
info:    VK_EXT_shader_viewport_index_layer
info:    VK_EXT_transform_feedback
info:    VK_EXT_vertex_attribute_divisor
info:    VK_KHR_create_renderpass2
info:    VK_KHR_depth_stencil_resolve
info:    VK_KHR_draw_indirect_count
info:    VK_KHR_driver_properties
info:    VK_KHR_image_format_list
info:    VK_KHR_sampler_mirror_clamp_to_edge
info:    VK_KHR_swapchain
info:  Device features:
info:    robustBufferAccess                     : 1
info:    fullDrawIndexUint32                    : 1
info:    imageCubeArray                         : 1
info:    independentBlend                       : 1
info:    geometryShader                         : 1
info:    tessellationShader                     : 0
info:    sampleRateShading                      : 1
info:    dualSrcBlend                           : 0
info:    logicOp                                : 0
info:    multiDrawIndirect                      : 0
info:    drawIndirectFirstInstance              : 0
info:    depthClamp                             : 1
info:    depthBiasClamp                         : 1
info:    fillModeNonSolid                       : 1
info:    depthBounds                            : 1
info:    multiViewport                          : 1
info:    samplerAnisotropy                      : 1
info:    textureCompressionBC                   : 1
info:    occlusionQueryPrecise                  : 1
info:    pipelineStatisticsQuery                : 1
info:    vertexPipelineStoresAndAtomics         : 1
info:    fragmentStoresAndAtomics               : 0
info:    shaderImageGatherExtended              : 0
info:    shaderStorageImageExtendedFormats      : 1
info:    shaderStorageImageReadWithoutFormat    : 0
info:    shaderStorageImageWriteWithoutFormat   : 1
info:    shaderClipDistance                     : 1
info:    shaderCullDistance                     : 1
info:    shaderFloat64                          : 0
info:    shaderInt64                            : 0
info:    variableMultisampleRate                : 0
info:  VK_EXT_conditional_rendering
info:    conditionalRendering                   : 0
info:  VK_EXT_custom_border_color
info:    customBorderColors                     : 0
info:    customBorderColorWithoutFormat         : 0
info:  VK_EXT_depth_clip_enable
info:    depthClipEnable                        : 1
info:  VK_EXT_host_query_reset
info:    hostQueryReset                         : 1
info:  VK_EXT_memory_priority
info:    memoryPriority                         : 0
info:  VK_EXT_robustness2
info:    robustBufferAccess2                    : 0
info:    robustImageAccess2                     : 0
info:    nullDescriptor                         : 0
info:  VK_EXT_shader_demote_to_helper_invocation
info:    shaderDemoteToHelperInvocation         : 1
info:  VK_EXT_transform_feedback
info:    transformFeedback                      : 0
info:    geometryStreams                        : 0
info:  VK_EXT_vertex_attribute_divisor
info:    vertexAttributeInstanceRateDivisor     : 1
info:    vertexAttributeInstanceRateZeroDivisor : 1
info:  Queue families:
info:    Graphics : 0
info:    Transfer : 1
Fossilize INFO: Overriding serialization path: "/home/myusername/.local/share/Steam/steamapps/shadercache/9420/fozpipelinesv6/steamapprun_pipeline_cache".
Fossilize INFO: engineVersion 4222976 is too low for pEngineName DXVK. Skipping.
Fossilize INFO: engineVersion 4222976 is too low for pEngineName DXVK. Skipping.
info:  DXVK: Read 0 valid state cache entries
info:  DXVK: Using 5 compiler threads
info:  D3D9DeviceEx::ResetSwapChain:
info:    Requested Presentation Parameters
info:      - Width:              2560
info:      - Height:             1440
info:      - Format:             D3D9Format::A8R8G8B8
info:      - Auto Depth Stencil: false
info:                  ^ Format: D3D9Format::Unknown
info:      - Windowed:           false
info:  Presenter: Actual swap chain properties:
info:    Format:       VK_FORMAT_B8G8R8A8_UNORM
info:    Present mode: VK_PRESENT_MODE_IMMEDIATE_KHR
info:    Buffer size:  2560x1440
info:    Image count:  2
info:    Exclusive FS: 0
info:  Setting display mode: 2560x1440@60
warn:  D3D9DeviceEx::SetRenderState: Unhandled render state D3DRS_ADAPTIVETESS_X
warn:  D3D9DeviceEx::SetRenderState: Unhandled render state D3DRS_ADAPTIVETESS_Y
warn:  D3D9DeviceEx::SetRenderState: Unhandled render state D3DRS_ADAPTIVETESS_W
info:  Presenter: Actual swap chain properties:
info:    Format:       VK_FORMAT_B8G8R8A8_UNORM
info:    Present mode: VK_PRESENT_MODE_IMMEDIATE_KHR
info:    Buffer size:  2560x1440
info:    Image count:  2
info:    Exclusive FS: 0

Maybe someone has an idea what I could try to get the game starting or the be able to join a game.