mtkennerly / ludusavi

Backup tool for PC game saves

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Steam Game (FTL) crashes instantly when using ludusavi

LoetkolbenLukas opened this issue · comments

Ludusavi version

v0.22.0

Operating system

Linux (Steam Deck)

Installation method

Flatpak

Description

I'm trying to use the Ludusavi backup tool to automatically back up my save data for the game "FTL: Faster Than Light" (FTL) when launching the game via Steam on my Linux system. However, I'm encountering an issue where the Steam environment can't find the ludusavi command, despite the command being available in my system and working correctly when invoked directly from a terminal.

Steps Taken:

  1. I installed Ludusavi as a Flatpak app.
  2. I wrote a shell script to run ludusavi and then launch FTL. This script works correctly when executed directly from a terminal. Here's the script:
#!/bin/bash  
  
# Clear log file  
echo "" > ~/ftl.log  
  
# enter the game directory  
cd ./data  
  
# run ludusavi, then FTL  
./ludusavi --config $HOME/.var/app/com.github.mtkennerly.ludusavi/config/ludusavi wrap --name "FTL: Faster Than Light" --gui -- ./FTL "$@" >> ~/ftl.log 2>&1  
  1. I tried to use this script as a launcher for FTL in Steam. This is where the problem occurs: the Steam environment can't find the ludusavi command.

/var/home/<user>/.local/share/Steam/steamapps/common/FTL Faster Than Light/FTL: line 11: ./ludusavi: No such file or directory

  1. I tried creating a symbolic link to ludusavi in the FTL executable's directory, but this didn't resolve the issue.

  2. I attempted to use the flatpak run command to run ludusavi from my script, but the Steam environment couldn't find the flatpak command.

/var/home/<user>/.local/share/Steam/steamapps/common/FTL Faster Than Light/FTL: line 11: flatpak: command not found

  1. I added the ludusavi wrap command to the Steam launch options for FTL, but the Steam environment couldn't find the flatpak command.

The original launch script for FTL looks like this:

#!/bin/bash

# enter the game directory
cd ./data

# run FTL
exec ./FTL "$@"

Logs

Steam Logs:

[2024-02-27 13:03:32] GameAction [AppID 212680, ActionID 28] : LaunchApp changed task to ProcessingInstallScript with ""
[2024-02-27 13:03:32] GameAction [AppID 212680, ActionID 28] : LaunchApp changed task to SynchronizingCloud with ""
[2024-02-27 13:03:33] GameAction [AppID 212680, ActionID 28] : LaunchApp changed task to ControllerWarnings with ""
[2024-02-27 13:03:33] GameAction [AppID 212680, ActionID 28] : LaunchApp waiting for user response to ControllerWarnings ""
[2024-02-27 13:03:33] GameAction [AppID 212680, ActionID 28] : LaunchApp continues with user response "ControllerWarnings"
[2024-02-27 13:03:33] GameAction [AppID 212680, ActionID 28] : LaunchApp changed task to SynchronizingControllerConfig with ""
[2024-02-27 13:03:33] Loaded Config for Local Selection Path for App ID 212680, Controller 15: /var/home/<user>/.local/share/Steam/steamapps/common/Steam Controller Configs/127366454/config/212680/controller_neptune.vdf
[2024-02-27 13:03:33] Created virtual controller at slot 0 for controller 0
[2024-02-27 13:03:33] GameAction [AppID 212680, ActionID 28] : LaunchApp changed task to SiteLicenseSeatCheckout with ""
[2024-02-27 13:03:33] GameAction [AppID 212680, ActionID 28] : LaunchApp changed task to WaitForStreamingEncoderConfig with ""
[2024-02-27 13:03:33] GameAction [AppID 212680, ActionID 28] : LaunchApp changed task to CreatingProcess with ""
[2024-02-27 13:03:33] GameAction [AppID 212680, ActionID 28] : LaunchApp waiting for user response to CreatingProcess ""
[2024-02-27 13:03:33] GameAction [AppID 212680, ActionID 28] : LaunchApp continues with user response "CreatingProcess"
[2024-02-27 13:03:33] Game process added : AppID 212680 "flatpak run com.github.mtkennerly.ludusavi --config $HOME/.var/app/com.github.mtkennerly.ludusavi/config/ludusavi wrap --name "FTL: Faster Than Light" --gui --  /var/home/<user>/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=212680 -- /var/home/<user>/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/var/home/<user>/.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier'/_v2-entry-point --verb=waitforexitandrun -- '/var/home/<user>/.local/share/Steam/steamapps/common/SteamLinuxRuntime'/scout-on-soldier-entry-point-v2 --  '/var/home/<user>/.local/share/Steam/steamapps/common/FTL Faster Than Light/FTL'", ProcID 54459, IP 0.0.0.0:0
[2024-02-27 13:03:33] Controller slots reset
[2024-02-27 13:03:33] Loaded Config for Local Selection Path for App ID 212680, Controller 15: /var/home/<user>/.local/share/Steam/steamapps/common/Steam Controller Configs/127366454/config/212680/controller_neptune.vdf
[2024-02-27 13:03:33] Destroyed virtual controller at slot 0 for controller 0
[2024-02-27 13:03:33] GameAction [AppID 212680, ActionID 28] : LaunchApp changed task to WaitingGameWindow with ""
[2024-02-27 13:03:33] GameAction [AppID 212680, ActionID 28] : LaunchApp changed task to Completed with ""
[2024-02-27 13:03:33] Game process removed: AppID 212680 "flatpak run com.github.mtkennerly.ludusavi --config $HOME/.var/app/com.github.mtkennerly.ludusavi/config/ludusavi wrap --name "FTL: Faster Than Light" --gui --  /var/home/<user>/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=212680 -- /var/home/<user>/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/var/home/<user>/.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier'/_v2-entry-point --verb=waitforexitandrun -- '/var/home/<user>/.local/share/Steam/steamapps/common/SteamLinuxRuntime'/scout-on-soldier-entry-point-v2 --  '/var/home/<user>/.local/share/Steam/steamapps/common/FTL Faster Than Light/FTL'", ProcID 54459 
[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:34] Local Device Found
  type: 28de 1205
  path: /dev/hidraw0
  serial_number: MEDA20236551 - 1
[2024-02-27 13:03:34]   Manufacturer: Valve Software
[2024-02-27 13:03:34]   Product:      Steam Deck Controller
[2024-02-27 13:03:34]   Release:      100
[2024-02-27 13:03:34]   Interface:    0

[2024-02-27 13:03:34] Local Device Found
  type: 28de 1205
  path: /dev/hidraw1
  serial_number: MEDA20236551 - 1
[2024-02-27 13:03:34]   Manufacturer: Valve Software
[2024-02-27 13:03:34]   Product:      Steam Deck Controller
[2024-02-27 13:03:34]   Release:      100
[2024-02-27 13:03:34]   Interface:    1

[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:34] GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()
[2024-02-27 13:03:35] Local Device Found
  type: 28de 1205
  path: /dev/hidraw0
  serial_number: MEDA20236551 - 1
[2024-02-27 13:03:35]   Manufacturer: Valve Software
[2024-02-27 13:03:35]   Product:      Steam Deck Controller
[2024-02-27 13:03:35]   Release:      100
[2024-02-27 13:03:35]   Interface:    0

[2024-02-27 13:03:35] Local Device Found
  type: 28de 1205
  path: /dev/hidraw1
  serial_number: MEDA20236551 - 1
[2024-02-27 13:03:35]   Manufacturer: Valve Software
[2024-02-27 13:03:35]   Product:      Steam Deck Controller
[2024-02-27 13:03:35]   Release:      100
[2024-02-27 13:03:35]   Interface:    1

Steam is probably running the command with a limited PATH environment variable. I think the easiest solution would be to use an absolute path instead of just flatpak.

Could you open a console and run which flatpak? Then you can insert that full path in the script:

<FULL_PATH_HERE>/flatpak run com.github.mtkennerly.ludusavi --config $HOME/.var/app/com.github.mtkennerly.ludusavi/config/ludusavi wrap ...

I don't really know what Steam is doing, but i let it output the PATH content, but it was completely empty.
Changing the flatpak path to the full path didn't work:

/var/home/<user>/.local/share/Steam/steamapps/common/FTL Faster Than Light/FTL: line 9: /usr/bin/flatpak: No such file or directory

That's strange. I would've expected a permission error rather than not recognizing the path at all.

Could you give this a try and see what happens?

  • Download the non-Flatpak version of Ludusavi (i.e., ludusavi-v0.22.0-linux.zip) and extract it somewhere in your home folder
  • Mark it as executable (chmod +x ./ludusavi)
  • In your script, reference the executable with an absolute path

I tried your suggestion and it launched! Yay

Only thing i am not sure about is if it backed up anything. I had the --gui option set, but there was no confirmation dialogue. I tested the behaviour when omitting the --gui option, but in that case I got this error:
Restore save data for FTL: Faster Than Light? [y/n] �[?25lUnable to request confirmation.

This sort of makes sense to me since i cannot confirm anything, but I would love to either set a default to always backup and restore or maybe find out why i don't get the GUI confirmation dialogue.

Do you have any idea?

I checked if it backed up anything, but it seems like it didn't:

lukas@Lukas-SteamDeck:~/OneDrive - Personal/Anwendungen/Backup/SteamDeck/FTL_ Faster Than Light$ ls -la
total 0
drwxr-xr-x. 2 lukas lukas  4096 Mar 15 05:56 .
drwxr-xr-x. 4 lukas lukas  4096 Mar 15 05:56 ..
-rw-r--r--. 1 lukas lukas 13290 Mar 15 13:01 backup-20240315T120149Z.zip
-rw-r--r--. 1 lukas lukas  3833 Feb 23 09:01 hs_mv_prof_backup.sav
-rw-r--r--. 1 lukas lukas  1070 Mar 12 20:03 mapping.yaml
lukas@Lukas-SteamDeck:~/OneDrive - Personal/Anwendungen/Backup/SteamDeck/FTL_ Faster Than Light$ ls -la
total 0
drwxr-xr-x. 2 lukas lukas  4096 Mar 15 05:56 .
drwxr-xr-x. 4 lukas lukas  4096 Mar 15 05:56 ..
-rw-r--r--. 1 lukas lukas 13290 Mar 15 13:01 backup-20240315T120149Z.zip
-rw-r--r--. 1 lukas lukas  3833 Feb 23 09:01 hs_mv_prof_backup.sav
-rw-r--r--. 1 lukas lukas  1070 Mar 12 20:03 mapping.yaml

Here is another log snippet, but i am not sure if this is from the Game or from ludusavi:

Warning: <FTL> not found in data/mup_mvkestrel_a.xml, adding wrapper tag
Null event creation = DROPPOINT_SUPPLY_DEPOT_LIST
Something went wrong in saving the profile!
Something went wrong in saving the profile!
Something went wrong in saving the profile!
Couldn't find in dictionary: hotkey_drone5
Couldn't find in dictionary: hotkey_drone6
Couldn't find in dictionary: hotkey_drone5
Couldn't find in dictionary: hotkey_drone6
Warning: <FTL> not found in data/mup_mvkestrel_a.xml, adding wrapper tag
Something went wrong in saving the profile!
Something went wrong in saving the profile!
Warning: <FTL> not found in data/mu_curator.xml, adding wrapper tag
Steam stats received
Something went wrong in saving the profile!
Something went wrong in saving the profile!
Something went wrong in saving the profile!
Finalizing Steam achievements

I tried your suggestion and it launched! Yay

Nice 🎉

I would love to either set a default to always backup and restore

I've just added a --force option in master. Here's a Linux build: ludusavi-v0.22.0-post.25+e2d8f79-linux.zip . Be careful, though, because Ludusavi might think some games exit right away, like if the main executable starts the actual game in the background and then quits.

or maybe find out why i don't get the GUI confirmation dialogue.

Could you check $HOME/.var/app/com.github.mtkennerly.ludusavi/config/ludusavi for a ludusavi_rCURRENT.log file? After you hit the error, that file should contain a line with Unable to request confirmation: containing the reason.

I'm guessing it's related to why the flatpak executable didn't work, since the GUI popups will try to use zenity or kdialog on Linux.

Here is another log snippet, but i am not sure if this is from the Game or from ludusavi

That's from the game.

This worked great thanks!
My FTL start script looks like this now:

#!/bin/bash

# enter the game directory
cd ./data

# start the game with ludusavi as a wrapper
./ludusavi --config $HOME/.var/app/com.github.mtkennerly.ludusavi/config/ludusavi wrap --name "FTL: Faster Than Light" --force -- ./FTL "$@"