Razzmatazzz / RemnantSaveManager

Automatic backing up of your Remnant: From the Ashes save files, and the ability to anlayze your world to see what events rolled.
https://www.reddit.com/r/remnantgame/comments/d4eq86/remnant_save_manager_and_world_analyzer/
GNU General Public License v3.0
117 stars 21 forks source link

Handling saves outside of the default path #45

Open aelfwine88 opened 3 years ago

aelfwine88 commented 3 years ago

Hello,

I would like to request an option in the settings menu to be able to set user defined save profile paths.

Reason: We are playing Remnant with my girlfriend using NucleusCoop which makes it possible to play coop games in one computer with splitscreen or multiple displays. NucleusCoop uses it's own profile paths to be able to keep track the different players for the games. In Save Manager I cannot select therefore manage these profiles.

Thanks!

Razzmatazzz commented 3 years ago

I don't think adding the option will be of much use, for practical and technical reasons.

Practically speaking, when you're playing multiplayer in Remnant, only the host's world is used. If any of the people playing on the host's game are running the world analyzer, it will display the world data from their own world, not from the host's world that they're playing in.

But I suppose running the save manager would still be useful for purposes of backing up saves. From a technical perspective, my understanding of the way user settings are saved for .NET programs means that it's not possible to run two instance of the save manager on the same Windows account using two different save manager program settings. The settings for the program aren't stored in the particular .exe on your computer, but somewhere in the Windows registry instead. That means two different instances of the save manager running from two different locations will still access the same program settings. If I added the option to change the save path and you changed it in one instance of the save manager, another instance of the save manger you open from another location would use that value as well.

aelfwine88 commented 3 years ago

We just started with the game so I don't know the insides of it's save system but my main reason to fiddle with your program is that it was recommended to use it to avoid save corruptions. Now again, I know nothing about these corruptions and how they occur in a coop session but I see that each profile has it's own save and config files now in my computer and they are getting updated simultaneously as we play.

You say only the host's world is getting updated in the host's profile with these saves but I suspect that at least the client's character progression is getting updated in the client's own profile at the same time. Which I assume needs to be backed up as well.

So I need 2 things in my scenario: 1: backup of the host's (in my case host is always the same profile) word and character state 2: backup of the client's character state

My understanding is that your program would be able to solve the first if I would be able to set a nondefault game profile folder. Additionally we would be able to track our items since we play only together. For the second (client's character) it seems I need to write a script that backs up the profile manually before every game lunch.

Or you have any better recommendation?

Razzmatazzz commented 3 years ago

Yes, each client's character data is updated while playing multiplayer. Character data is saved in the profile.sav file. World data is saved in the save_#.sav files, where # is a number starting at 0 that corresponds with each character that game install has.

Is neither player in your setup using the default save path? If one of the players is using the default save path, then the save manager will be able to back that save up without any issues.

aelfwine88 commented 3 years ago

Neither player in my setup using the default save path. Both has their own respectively in my case: C:\Users\%username%\NucleusCoop\%profilename1%\AppData\Local\Remnant\Saved\SaveGames C:\Users\%username%\NucleusCoop\%profilename2%\AppData\Local\Remnant\Saved\SaveGames

My default save path has an "empty" or initial save right now. This profile separation ensures that I can just copy any of the NucleusCoop profile saves above to my default path so I can play with that specific profile on my own if I want to without the NucleusCoop framework.

Razzmatazzz commented 3 years ago

I just uploaded a new version that includes the option to change the save path. Let me know if it does the trick for you or if you encounter any bugs.

aelfwine88 commented 3 years ago

I just tried and managed to change the paths. So that's a win!

Also I monitored the process and found out the following which seems useful:

  1. The program looks for it's config in 3 possible locations in this order: a) Same folder as executable with a filename: RemnantSaveManager.exe.config b) %APPDATA%\RemnantSaveManager\RemnantSaveManager.exe%URL%\1.96.0.0\user.config c) %LOCALAPPDATA%\RemnantSaveManager\RemnantSaveManager.exe%URL%\1.96.0.0\user.config

It willing to read config files from any of these locations (I tried only a)) but for me it only willing to save new config options in the c) path. It would be interesting to find out how to force the program to always use path c).

  1. The %URL% variable is generated based on god knows what (aka I did not google it) components but it seems the path of the actual executable is one of them. In short: if you move the program there always will be a new config folder generated with a new user.config file.

  2. The above two points makes it actually possible to have multiple folders and thus multiple instances of your program running in the same time with separate configs each. I did not try the autosave feature yet but I don't see why it shouldn't work as well.

And two more quality of life requests I would like to ask for you if you have interest and time to play with: 1: Could you modify your program so when I change the "Save Folder" it automatically changes the "Backup Folder" path as well? 2: Could you dig into how to force your program to use the a) option for both read and write user config?

Thanks and cheers!

Razzmatazzz commented 3 years ago

1: I don't think it's ideal to update the backup folder automatically when the save folder is changed. Those two folders don't necessarily have to be in the same location, and updating the backup folder automatically when the save folder is changed isn't necessarily something the user would expect. The user might change the backup folder first and then change the save folder second, and then they would be confused about why the backup folder changed on its own.

2: Changing how the program handles storing configuration variables is more work than I'm willing to put in for an extreme edge case. The source code is available; feel free to fork the project and modify to suit your needs.