Razzmatazzz / RemnantSaveGuardian

Tool to backup your saves and view your world rolls
GNU General Public License v3.0
288 stars 40 forks source link

Steam deck? #229

Open Kirbymain001 opened 2 months ago

Kirbymain001 commented 2 months ago

is there a way to get this to work on steam deck, thanks

Kirbymain001 commented 1 month ago

is there a way to get this to work on steam deck, thanks

So my progress with using the steam deck for this tool has come to a halt, I was able to open remnantsaveguardian.exe using lutris, I found where my saves where stored linked them and now I just keep getting the error:

Error loading main window: the method or operation is not implemented.

If someone could help me, or just confirm that this isn't possible It would be deeply appreciated.

Joomsy commented 1 month ago

A big caveat to the Steam Deck is that it installs Steam from Flatpak. This makes doing anything with the steamapps/common and steamapps/compatdata directories a pain, and it's necessary to be able to work with both to get this running under Linux. I just got it up and running on a Pop!_OS install, and I'll include the steps I took to do so, but the game paths will be different on a Steam Deck. Hopefully somebody else can adapt this guide for Flatpak users before I spend the time to learn it.

First, download this .Net 6 installer. The one provided by winetricks/protontricks is a couple of minor versions behind, and RSG won't run on it. https://download.visualstudio.microsoft.com/download/pr/d0849e66-227d-40f7-8f7b-c3f7dfe51f43/37f8a04ab7ff94db7f20d3c598dc4d74/windowsdesktop-runtime-6.0.29-win-x64.exe

Next, open a terminal, and install .Net. You'll want to use the version of wine provided by your Proton version to do this. In my case, I'm using GE 9-3, so substitute as needed if you use something else. Be sure to also define the prefix for Remnant 2, as we want .Net to install to it. You may also need to remove the WINEFSYNC=1 flag if you are not using a kernel patched for fsync. Forgive me, but I don't know if the Steam Deck's has it or not. Its presence may not cause any problems, but it's worth keeping in mind.

$ cd ~/Downloads (or wherever you downloaded the installer to)
$ WINEPREFIX=/home/$USER/.steam/root/steamapps/compatdata/1282100/pfx/ WINEFSYNC=1 /home/$USER/.steam/root/compatibilitytools.d/GE-Proton9-3/files/bin/wine windowsdesktop-runtime-6.0.29-win-x64.exe

It might also be a good idea to install corefonts and other MS fonts with protontricks. Without them, RSG's fonts looked "squished" on my PC.

$ protontricks 1282100 corefonts calibri tahoma

After installing all that, we now have to do a little trick to get RSG to see Remnant's install directory. This is because Steam on Linux keeps game data in the two locations I mentioned above. common is where the game itself is installed, and compatdata is the actual home of the wine prefixes where runtimes and the like are installed. This poses a problem for RSG, though, as the game's install path isn't technically under the prefix. That can be fixed, though, by simulating the common directory under the prefix with a symlink. Do note that symlink paths must be absolute, so replace <user> with your username.

$ mkdir ~/.steam/root/steamapps/compatdata/1282100/pfx/drive_c/Program\ Files\ \(x86\)/Steam/common
$ ln -s /home/<user>/.steam/root/steamapps/common/Remnant2 /home/<user>/.steam/root/steamapps/compatdata/1282100/pfx/drive_c/Program\ Files\ \(x86\)/Steam/common/Remnant2

From here, you should now be able to launch RSG with your Proton's version of wine. My recommendation would be to extract it to a directory somewhere under home, and execute it with an alias (these go in ~/.bashrc, and can be ran with the name you assign them). You could also huck this into a shell script without the alias bits to achieve the same thing, but I find myself in a terminal more than anywhere else.

$ alias rsg="WINEPREFIX=/home/$USER/.steam/root/steamapps/compatdata/1282100/pfx/ WINEFSYNC=1 /home/$USER/.steam/root/compatibilitytools.d/GE-Proton9-3/files/bin/wine RemnantSaveGuardian.exe"

Regardless of how you decide to launch it, just be sure the command that does it is ran from the directory you extracted RSG to.

Once it's actually launched, you'll need to go into RSG's settings, and define the paths to your save location, save backup location, and Remnant's install path. The first two are under the user directory (users\steamuser\Saved Games\Remnant2\Steam\<steam-id> and steamuser\Documents\Save Backups\Remnant 2 respectively), and the latter is the symlink we created up above. You should be able to browse to it under the prefix's C:\ drive in Program Files (x86)\Steam\common.

After you've got all that done, you're finished! Go back to the Save Backups section of RSG, click the floppy disk icon to make your first backup, and then use the World Analyzer to check it out.

image

image

brokenphone commented 3 weeks ago

EDIT: This was resolved simply by ensuring that Lutris has read/write permissions on ~/.var/app/com.valvesoftware.Steam instead of just the default setting of read. Obviously this could also be made more restrictive by only selecting the specific prefixes or directories you want Lutris to have write permissions on.

Thanks for the useful information, @Joomsy

I have a slightly different setup than you, mainly using Flatpaks, and I am getting permissions errors on the save data. I'm running both Steam and Lutris as Flatpaks. I like your solution, but I am trying to keep multilib/x86 files and libraries out of my Arch installation which is why I've turned to Flatpak for Steam. This results in me being unable to run wine directly from the proton-created pfx as it's 32-bit.

I've installed the .NET 6.0.29 runtime which is a great tip, I spent a lot of time wondering why default versions through winetricks weren't getting the job done.

Lutris has rw permissions on /home/myuser/.var/app/com.valvesoftware.Steam. Steam has rw permissions on /home/myuser/Games/Windows/Remnant Save Guardian. Both of these permissions were added manually using Flatseal.

Save and game location respectively:

/home/myuser/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/compatdata/1282100/pfx/drive_c/users/steamuser/Saved\ Games
/home/myuser/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Remnant2

RSG location and prefix respecitively:

/home/myuser/Games/Windows/Remnant Save Guardian
/home/myuser/Games/Windows/Remnant Save Guardian/remnant-save-guardian

I've created symlinks so the game and save data is available within the prefix:

$ ln -s /home/myuser/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Remnant2 /home/myuser/Games/Windows/Remnant\ Save\ Guardian/remnant-save-guardian/drive_c/Program\ Files\ \(x86\)/Steam/common
$ ln -s /home/myuser/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/compatdata/1282100/pfx/drive_c/users/steamuser/Saved\ Games /home/myuser/Games/Windows/Remnant\ Save\ Guardian/remnant-save-guardian/drive_c/users/steamuser/Documents/

After pointing RSG to the relevant directories I get the following error:

Error initializing analyzer page: System.UnauthorizedAccessException: Access to the path 'C:\users\steamuser\Documents\Saved Games\99892508\profile.sav' is denied.

$ ls -la /home/myuser/Games/Windows/Remnant Save Guardian/remnant-save-guardian/drive_c/users/steamuser/Documents/Saved\ Games/99892508
lrwxrwxrwx 1 myuser myuser 148 May  8 17:39 '/home/whale/Games/Windows/Remnant Save Guardian/remnant-save-guardian/drive_c/users/steamuser/Documents/Saved Games/99892508' -> '/home/myuser/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/compatdata/1282100/pfx/drive_c/users/steamuser/Saved Games/Remnant2/Steam/99892508'

When placing the files there directly, it works as expected.

EDIT: This was resolved simply by ensuring that Lutris has read/write permissions on ~/.var/app/com.valvesoftware.Steam instead of just the default setting of read. Obviously this could also be made more restrictive by only selecting the specific prefixes or directories you want Lutris to have write permissions on.

It seems that RSG cannot properly see inside the proton prefix created by Steam. I suspect this could be because I need to use some sort of Flatpak-friendly pathing, perhaps the /run/user/1000/... directories but I don't see how any of the files in there relate to what I'm trying to do. Either that or I've simply misconfigured something above.

Hopefully someone more knowledgeable with Flatpaks than I can chime in here.