mtkennerly / ludusavi

Backup tool for PC game saves
MIT License
2.81k stars 61 forks source link

Dynamic paths for cross-platforms sync #408

Closed VictuarVi closed 1 month ago

VictuarVi commented 1 month ago

What's your idea?

The problem

Suppose I play The Witcher 3: Wild Hunt, as an example, on two different machines – one with Windows 11 and the other with a generic Linux distribution. On Windows, I'd use GOG; on Linux, I'd use Heroic Games Launcher (or Lutris).

Ludasavi is going to look in %USERPROFILE%\Documents\The Witcher 3\, according to PCGamingWiki.

However, the actual path in the application differs and makes it impossibile for a seamless sync. The two paths are, respectively:

Notice that \Documents\The Witcher 3\ stays the same between the two. The %USERPROFILE% variable is different since in Windows it's the actual Documents folder, while on Linux it's the Heroic launcher prefix for Windows.

As I press Restore mode and Continue, Ludasavi returns an error because the folder \home\user\Games\Heroic\Prefixes\default\The Witcher 3 Wild Hunt - Complete Edition\pfx\drive_c\users\steamuser\Documents\The Witcher 3 doesn't exist on Windows since it's just C:\Users\%USER%\Documents\The Witcher 3\, without all the Heroic prefix.

The proposed solution

What I suggest is to search in the complete directory – which is %USERPROFILE%\Documents\The Witcher 3\ in this example, the one listed on PCGamingWiki – though backup only the folder of the gamefiles, not the complete path. This way, one could simply backup and restore their saves between multiple platforms and operating systems.

mtkennerly commented 1 month ago

Hi! This is covered by #194. I have some ideas of how to support this, but it's a bit complicated. There's more info in that ticket, and I think it'll be important to implement #354 first.

For what it's worth, if you only need to sync a few games, then you could set up a few bidirectional redirects between the Windows and Linux paths. That's not feasible to do in bulk, though.