Known issues/Save Breaker Linux

From Turing Complete

On Linux when trying to launch the save_breaker alpha, the game might show just a gray screen.

This is because the save_breaker version of the game runs two processes - the Turing Complete.x86_64 main process and the simulator process that’s used to compile and execute circuits. These two processes communicate with each other over a localhost TCP socket. For the sake of debugging, the main process tries to spawn the simulator process in its own separate terminal window; on Linux it does this by executing gnome-terminal -- bash -ic "./simulator 5002". After executing this command, regardless of whether it succeeds or fails, the game goes into a loop trying to connect to TCP 5002 socket, which is why it appears to be stuck at a gray screen.

There are a few ways to resolve this, depending on whether you run Steam via Flatpak or not, and how far you’re willing to trade hackiness for convenience.

Steam in Flatpak[edit | edit source]

If you’re using Steam via Flatpak, then this is the only known solution.

  1. Start the game.
  2. Run flatpak ps to find the game’s running process.
  3. Run sudo -E flatpak enter instance_id /bin/sh to start a shell inside the process’s namespace.
  4. In this shell, run ./simulator 5002.

Give the game access to the host’s gnome-terminal[edit | edit source]

If you do have gnome-terminal installed on your system, the game will nevertheless fail to find it. This is because Steam defaults to running Linux games in a sandbox, dictated by the game’s “Compatibility” setting.

  1. Right-click on the game in Steam and open its Properties.
  2. In the Compatibility tab, check “Force the use of a specific Steam Play compatibility tool”.
  3. In the dropdown that appears, select “Legacy runtime 1.0”. This will disable the sandbox for the game, so the game will be able to access your host system’s gnome-terminal binary. Note that it is the “Legacy runtime 1.0” option, not the similarly named “Steam Linux Runtime 1.0 (scout)” option.
  4. Start the game. It should now automatically spawn gnome-terminal.

Run simulator manually[edit | edit source]

This is similar to the two methods mentioned above but for non-Flatpak installs of Steam.

  1. Right-click on the game in Steam and open its Properties.
  2. In the Compatibility tab, check “Force the use of a specific Steam Play compatibility tool”.
  3. In the dropdown that appears, select “Legacy runtime 1.0”. This will disable the sandbox for the game, so the game will be able to access your host system’s gnome-terminal binary. Note that it is the “Legacy runtime 1.0” option, not the similarly named “Steam Linux Runtime 1.0 (scout)” option.
  4. Open a terminal of your choice and run the simulator binary. The binary is in the installation directory of the game. For example, run ~/.steam/steamapps/common/Turing\ Complete/simulator 5002 if your steamroot is ~/.steam.

Shim gnome-terminal with a script that runs the terminal of your choice[edit | edit source]

  1. Disable the game’s sandbox using the “Legacy runtime 1.0” method above.
  2. Create an executable script named gnome-terminal in the game’s installation directory (ie adjacent to the Turing Complete.x86_64 and simulator binaries) that forwards $@ to a terminal of your choice. Depending on what that terminal is, you might have to munge the parameters like removing the leading --. Also note that the game expects the spawned gnome-terminal process to fork and exit; if it blocks on the simulator process then the game will remain hung. So you may need the script to background the spawned terminal process.
  3. Start the game. It should now automatically spawn your gnome-terminal script.

Run the game yourself instead of via Steam[edit | edit source]

The game does not have Steam DRM, so it is perfectly possible to run the Turing Complete.x86_64 binary yourself and not worry about Steam sandboxes. In this case, if you have gnome-terminal installed then the game will automatically use it, and if you don’t then you have the ability to run simulator 5002 manually. Of course you will lose out on Steam integration features like Cloud Saves this way.

Give the game access to the host’s gnome-terminal, nuclear option[edit | edit source]

This option is more intrusive than the “Give the game access to the host’s gnome-terminal” option above, in that it disables the Steam sandbox for all games, not just Turing Complete. There should be no reason to do this, but it is listed here for completeness.

  1. Change the way you launch Steam to append -compat-force-slr off. Note that we are talking about a CLI parameter for Steam itself, not the “Launch Options” setting for individual games inside Steam. For example if you normally run /usr/games/steam you would now run /usr/games/steam -compat-force-slr off instead. This will disable the sandbox and allow the game to find your host system’s gnome-terminal binary.
  2. Start the game. It should now automatically spawn gnome-terminal.

Hex-edit the game to run a terminal of your choice[edit | edit source]

The libbackend.so file in the game’s installation directory contains the string used to construct the gnome-terminal commandline. It is possible to edit this string to be the terminal of your choice. As mentioned in the previous point, make sure that the commandline you place here forks and exits instead of blocking. An example of such editing is in this post.

This method is the most “fire-and-forget” but will break any time the game updates and reverts your changes to its files. It is not recommended to do this method and it is only mentioned here for completeness.