flathub / com.valvesoftware.Steam

https://flathub.org/apps/details/com.valvesoftware.Steam
339 stars 69 forks source link

Native Linux games do not write saved games & user config to disk (so they are lost) #1076

Open SentineI opened 1 year ago

SentineI commented 1 year ago

Game information 7 Days To Die The Long Dark (and probably other native Linux games - i.e. that don't use Proton)

Distribution name and version where applicable Ubuntu 22.04

Flatpak info Flatpak 1.12.7 nvidia-470-161-03 default host

Problem description These native games do not write save game data & user configuration to disk, so once Steam is quit & then restarted, those games will show no saved games (but beware the saved games are still visible if the game is restarted withOUT first quitting Steam). Also save game files copied to the expected location (from ~/.local/share/... to ~/.var/app/com.valvesoftware.Steam/.local/share/...) are not seen by the game.

From stracing the games, it appears that they try to load/save the files at /home/.local/share/... (i.e. missing username folder), so their save game files are never created when saving, nor found when loading.

Example of how I straced a game (or Steam just before starting the game): strace -f -e trace=open,openat -p 51544 2>&1 | tee temp.txt Example of what I found:

[pid 55356] openat(AT_FDCWD, "/home/.local/share/Hinterland/TheLongDark/Survival", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 90
[pid 55356] openat(AT_FDCWD, "/home/.local/share/Hinterland/TheLongDarkNoSync/Survival", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 90
[pid 55356] openat(AT_FDCWD, "/home/.local/share/Hinterland/TheLongDark/Survival", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 151
[pid 55356] openat(AT_FDCWD, "/home/.local/share/Hinterland/TheLongDark/Survival/profile_survival.113628", O_RDONLY) = 151
[pid 55356] openat(AT_FDCWD, "/home/.local/share/Hinterland/TheLongDark/Survival/sandbox1", O_RDONLY) = 151
[pid 55356] openat(AT_FDCWD, "/home/.local/share/Hinterland/TheLongDarkNoSync/Survival/settings_survival.113628", O_RDONLY) = 151

Another example:

[pid 58140] openat(AT_FDCWD, "/home/.local/share/7DaysToDie/Saves/profiles.sdf", O_RDWR|O_CREAT, 0666) = 109
[pid 58140] openat(AT_FDCWD, "/home/.local/share/7DaysToDie/Saves", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 109
[pid 58140] openat(AT_FDCWD, "/home/.local/share/7DaysToDie/Saves/Navezgane/My Game/gameOptions.sdf", O_RDWR|O_CREAT, 0666) = 109
[pid 58140] openat(AT_FDCWD, "/home/.local/share/7DaysToDie/Saves/Navezgane/My Game/blockmappings.nim", O_RDWR|O_CREAT, 0666) = 115
[pid 58140] openat(AT_FDCWD, "/home/.local/share/7DaysToDie/Saves/Navezgane/My Game/itemmappings.nim", O_RDWR|O_CREAT, 0666) = 115
[pid 58140] openat(AT_FDCWD, "/home/.local/share/7DaysToDie/Saves/Navezgane/My Game/ConfigsDump/materials.xml", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 115

Does this issue reproduce with native Steam No, they work fine there.

SentineI commented 1 year ago

This problem still exists with nvidia-530-41-03

nanonyme commented 1 year ago

There is no copying happening. ~/var/app/com.valvesoftware.Steam is your home directory inside flatpak sandbox.

SentineI commented 1 year ago

There is no copying happening. ~/var/app/com.valvesoftware.Steam is your home directory inside flatpak sandbox.

Hi. Not sure what you are trying to say, but I never said there was any copying happening. I said that native games are failing to write/store data on disk.

nanonyme commented 1 year ago

This should not be the case. The files should be persisted under sandboxed home.