7

Recently Steam released Steam Play, which uses their fork of Wine hosted by Steam called Proton (GitHub) to allow us to play our complete games library under Linux. It creates wineprefixes for all of your games that don't already have a Linux port and works a far cry better than wine.

I'm trying to run Supreme Commander - Forged Alliance (Steam App ID: 9420) and play it on its unofficial multiplayer client, FAF. The game used to work with Wine, but now has a number of issues (for example, fullscreen doesn't work and high tendency to blackscreen in windowed). But it does work with Proton.

What I'm trying to do here is run this specific Steam game via terminal, not via Steam's GUI.

My intent isn't to circumvent Steam DRM, which running the games via terminal likely wouldn't accomplish anyways, but to run it with dynamic arguments. This will allow setting up multiplayer matches. This will be applied to other games in the future.


But I'm running into trouble when running in the terminal:

cd ~/.local/share/Steam/steamapps/common/Proton*
STEAM_COMPAT_DATA_PATH=/home/t/.local/share/Steam/steamapps/compatdata/9420 ./proton run /home/t/.local/share/Steam/steamapps/common/Supreme\ Commander\ Forged\ Alliance/bin/SupremeCommander.exe

I get an Error window: "Application load error P : 0000065615" and closing this simply brings me back to terminal with no extra output. I've experimented with other games:

  1. Age of Empires 2 HD fails, but with a much more verbose error message window stating steam must be running, but I had Steam running at the time (and it would run if I clicked the play button in Steam).

  2. Bannerman: there is no message at all and even less terminal verbose.

  3. Shadow Complex Remastered gets an actual loader screen of the game, runs for about two seconds then crashes with an error:

    CAppInfoCacheReadFromDiskThread took 3 milliseconds to initialize
    CApplicationManagerPopulateThread took 7 milliseconds to initialize (will have waited on CAppInfoCacheReadFromDiskThread)
    

So no game seems to run successfully via this method.


Maybe some potential here UPDATE 3/10/2018:

WINEPREFIX="/home/t/fa-wineprefix/":"/home/t/.local/share/Steam/steamapps/common/Proton 3.7/dist/lib/wine winecfg"
PATH="/home/t/.local/share/Steam/steamapps/common/Proton 3.7/dist/bin/:$PATH"  
export WINEDLLPATH="/home/t/.local/share/Steam/steamapps/common/Proton 3.7/dist/lib64/wine:/home/t/.local/share/Steam/steamapps/common/Proton 3.7/dist/lib/wine"  
export LD_LIBRARY_PATH="/home/t/.local/share/Steam/steamapps/common/Proton 3.7/dist/lib64:/path/to/steam/steamapps/common/Proton 3.7/dist/lib:/usr/lib/steam:/usr/lib32/steam"
WINEPREFIX="/home/t/fa-wineprefix/"  "/home/t/.local/share/Steam/steamapps/common/Proton 3.7/dist/bin/./wine"   "/home/t/.local/share/Steam/steamapps/common/Supreme Commander Forged Alliance/bin/SupremeCommander.exe"

but this method fails at the last command with this error window:

Application load error P:0000065434

as well as some terminal output:

001f:err:module:load_builtin_dll failed to load .so lib for builtin L"winebus.sys": libudev.so.0: cannot open shared object file: No such file or directory
001f:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\WineBus": c0000142
001f:err:winedevice:create_driver failed to create driver L"WineBus": c0000142
0013:err:service:process_send_command service protocol error - failed to write pipe!
000d:fixme:service:scmdatabase_autostart_services Auto-start service L"WineBus" failed to start: 1114
0009:err:module:load_library somehow failed to load steamclient

so now we know more about the issue. it seems despite steam being running and every measure to let it know where steam is it does not find steam.

I also tried the same thing from inside the proton folder with the same result.


Some new potential here UPDATE 3/10/2018 :

the trick he mentions is creating a small python script protonRunner.py:

#!/usr/bin/env python

import os
import sys

home = os.environ["HOME"]
os.environ["STEAM_COMPAT_DATA_PATH"] = home + "/.local/share/Steam/steamapps/compatdata/9420"

run = "run"
exe = "\"" + home + "/.local/share/Steam/steamapps/common/Supreme Commander Forged Alliance/bin/SupremeCommander.exe\""

cmd = "\"" + home + "/.local/share/Steam/steamapps/common/Proton 3.7/proton\" " + run + " " + exe

for arg in sys.argv[1:]:
    cmd += " " + arg

os.system(cmd)

supcomFA.desktop:

[Desktop Entry]
Name=SupremeCommander
Exec=python $HOME/.local/share/Steam/steamapps/common/Proton\ 3.7/protonRunner.py
Icon=/home/t/.local/share/icons/supcom.png
Type=Application
Encoding=UTF-8
Version=1.0
Terminal=true

doing this accomplishes the same error message:

Application load error P:0000065434


TL;DR: How to run a Windows Steam game (that manages to run via Proton on Linux) from the terminal.

  • 1
    Related and likely helpful: chat.stackexchange.com/transcript/message/46882631#46882631 – David Foerster Oct 2 '18 at 18:29
  • 2
    Knowing nothing about Steam, I have a suggestion on how you might be able to get some progress: start the game via proton as you'd normally do. Then do a ps faux. Carefully inspect the Proton processes you see, how stuff gets started, maybe there are some useful parameters there. Then note the PIDs of all the processes. Go to /proc/$PID and have a look around the stuff there, especially cwd, environment etc. You wanna try to set up the environment exactly as Valve does. – Tomáš Pospíšek Oct 2 '18 at 21:35
  • 3
    FYI: if you didn't export the WINEDLLPATH and LD_LIBRARY_PATH variables, they wouldn't affect the wine command ran later. Also, you shouldn't use both quotes and backslashes in the file path. Prefer only quotes: WINEPREFIX="/home/t/fa-wineprefix/" "/home/t/.local/share/Steam/steamapps/common/Proton 3.7/dist/bin/./wine" "/home/t/.local/share/Steam/steamapps/common/Supreme Commander Forged Alliance/bin/SupremeCommander.exe" Also, the line "maybe some potential here" seems to link to screenshot of the error you got earlier. Did you make a mistake with the link? – muru Oct 3 '18 at 0:22
  • 2
    @muru fixed the link. thanks for your edits. I'm always either too unspecific or too detailed and overdrawn. I'm just an all around bad writer. and thanks for your suggestion. I'll experiment with export tonight when I get home. – tatsu Oct 3 '18 at 7:36
  • @muru hey! I tried both the exports and removing the backslashes as well as the other method i found. since i'm still coming up on the same error in both cases I think I have to assume this would correctly run the game but this "steam not found running" thing must become the real issue now. any ideas? – tatsu Oct 3 '18 at 18:51
1

Here's an experiment that may help you get the answer. For convenience, I'll refer to your default Steam library location as $STEAM (the default is ~/.local/share/Steam/). Proton is installed by default to $STEAM/steamapps/common/Proton 3.7, I'll call this $PROTON.

So, when I tried running The Witcher, Steam ran this command:

"$PROTON/dist/bin/wine-preloader" "$PROTON/dist/bin/wine" "Z:\$STEAM\steamapps\common\The Witcher Enhanced Edition\System\witcher.exe"

Where $STEAM has backslashes instead of slashes, as it's a Windows path. In addition, it set something like 70 environment variables (related to Wine, Steam, various hardware/drivers, libraries, etc.). A single variable, WINESERVERSOCKET referred to the wine server started for this instance. If I omitted this variable and used all the rest, I could start the game from the command line.

Steps:

  1. Replace $PROTON/dist/bin/wine-preloader with a wrapper script that saves the environment somewhere:

    PROTON="$HOME/.local/share/Steam/steamapps/common/Proton 3.7" # adjust to your settings
    mv "$PROTON/dist/bin/wine-preloader" "$PROTON/dist/bin/wine-preloader-orig"
    printf "%s\n" '#! /bin/sh' 'env --null | grep -vz WINESERVERSOCKET > ~/env' > "$PROTON/dist/bin/wine-preloader"
    printf 'exec %q "$@"\n' "$PROTON/dist/bin/wine-preloader-orig" >> "$PROTON/dist/bin/wine-preloader"
    chmod +x "$PROTON/dist/bin/wine-preloader"
    

    The script is essentially this:

    #! /bin/sh
    env --null | grep -vz WINESERVERSOCKET= > ~/env
    printf "%s\0" "$0"-orig "$@" > ~/cmd
    exec /home/user/.local/share/Steam/steamapps/common/Proton\ 3.7/dist/bin/wine-preloader-orig "$@"
    

    It saves the environment, except for WINESERVERSOCKET, in ~/env, the command to run and arguments in ~/cmd and runs the actual file with the arguments provided. It uses ASCII null characters to separate everything, since the actual environment variables may contain newlines.

    Note that I save the command with -orig added for convenience.

  2. Run the game from the Steam GUI. The wrapper script will create these files.

  3. You can load the environment and run the command from these files. In bash

    mapfile -d '' -t env < ~/env
    mapfile -d '' -t cmd < ~/cmd
    env "${env[@]}" "${cmd[@]}"
    

    -d '' here tells bash the files use the ASCII null character as delimiter.

This much was sufficient for The Witcher to run for me. All of those environment variables probably won't be necessary. I leave it to you to test which aren't.


Of course, all of these might be completely unnecessary. Looking at Steam's command-line options, we have:

-applaunch <appID> [launch parameters]  Launches an Game or Application through Steam.

And when I ran:

steam -applaunch 20900 foo bar

the Wine command was:

"$PROTON/dist/bin/wine" "Z:\$STEAM\steamapps\common\The Witcher Enhanced Edition\System\witcher.exe" foo bar

So Steam did pass on foo and bar as arguments to the game. This might be all you need.

  • In the case of downlord's FAF client, replacing "%s" with steam -applaunch 9420 in the launch options almost works, but doesn't: FAF sets the working directory and tries to load files with local paths, but Steam changes the directory. – dhardy Apr 16 at 19:38
0

I have found the solution thanks to some help by aeikum on the steam proton github :

https://www.youtube.com/watch?v=c5K7QmK-Xas (updated 3/12/2019) https://github.com/tatsujb/installFAFscript

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.