mtkennerly / ludusavi-manifest

Backup info for PC game saves
MIT License
70 stars 13 forks source link

<storeUserId>/<user-id> not detected for Divinity: Original Sin II - Definitive Edition #14

Closed redactedscribe closed 1 year ago

redactedscribe commented 1 year ago

Divinity: Original Sin II - Definitive Edition.

For example, should be detecting %USERPROFILE%\Documents\Larian Studios\Divinity Original Sin 2 Definitive Edition\PlayerProfiles\<some_user_defined_string>\Savegames\ but isn't.

The issue appears to be that <user-id> on PCGW is defined as "The user ID or profile name (specific to your account or computer)" (if you mouseover "\<user-id>"), but Ludusavi thinks of it differently as evidenced by its own placeholder named <storeUserId> as seen when looking the custom rule made for the game after pressing Customize.

In this game's case, <user-id> is just a profile name used within the game created by the player, not an ID from any particular store. Because of this, Ludusavi should probably just think of PCGW's <user-id> as *. Or perhaps <user-id> is being used incorrectly on PCGW in this case? Depends on the interpretation of the definition I quoted above.

Thanks.

mtkennerly commented 1 year ago

Ludusavi does indeed interpret <storeUserId> as *, so this should work. I don't own the game, but if I manually create something there, it's recognized:

$ cargo run -- backup --preview 'Divinity: Original Sin II - Definitive Edition'
Divinity: Original Sin II - Definitive Edition [0 B]:
  - C:/Users/mtken/Documents/Larian Studios/Divinity Original Sin 2 Definitive Edition/PlayerProfiles/123/Savegames/asd.txt

I do see that one entry uses PlayerProfile while the others use PlayerProfiles. Could you double check if that's the only typo on the wiki? Larian's website and this Reddit comment show Player Profiles with a space, for example.

redactedscribe commented 1 year ago

On my system, it's definitely %USERPROFILE%\Documents\Larian Studios\Divinity Original Sin 2 Definitive Edition\PlayerProfiles\... with an 's'.

I can only presume that \Player Profiles\ is likely wrong, despite being on the official website. This is because, for both Windows and macOS, they include a colon ("... 2: Definitive ...") in the same paths which isn't a valid character for folder names on both OSes, so that would be the second error.

Concerning Windows, the manifest shows:

<winDocuments>/Larian Studios/Divinity Original Sin 2 Definitive Edition/PlayerProfile/<storeUserId>:
  tags:
    - config
  when:
    - os: windows
<winDocuments>/Larian Studios/Divinity Original Sin 2 Definitive Edition/PlayerProfiles/<storeUserId>/Savegames:
  tags:
    - save
  when:
    - os: windows

One path without the 's' (top) and one with (bottom). Neither of the paths match despite the bottom one being correct, at least for my system. I will correct the top path on PCGW to include an 's' [done].

The only match I get in Ludusavi is for the other config path:

<winDocuments>/Larian Studios/Divinity Original Sin 2 Definitive Edition/graphicSettings.lsx:
  tags:
    - config
  when:
    - os: windows
mtkennerly commented 1 year ago

Could you run this command and post the "rCURRENT" log file here? It'll be in the same folder as the config and manifest files.

redactedscribe commented 1 year ago

Neither of the paths match despite the bottom one being correct

It looks like Ludusavi checks whether the path is empty and ignores it if so. I've just noticed that for the bottom path that should be matching, the contents of that location is currently just two empty folders. Adding a 0 byte text file made Ludusavi display the path in its UI.

If an empty file makes Ludusavi display the path in its UI, perhaps empty folders should too? Technically there's something there, despite it only being an empty folder structure. Backing up also omits the path from the backup unless an empty/non-empty file is present.

redactedscribe commented 1 year ago

That seems to be the source of the confusion. I can see why you'd give more importance to empty files as they can be used as things for programs to read, e.g. a 0 byte portableMode file (I've seen a folder used similarly, but very rarely). So maybe it's right to exclude paths with only empty folders. It could however be desirable at times and avoid edge cases if they were always included.

mtkennerly commented 1 year ago

Ah, yes, that's by design. Ludusavi is file-oriented, like Git. My assumption has been that there aren't any games where an empty folder is useful/meaningful, whereas empty files could still be useful (e.g., when used as a flag).

redactedscribe commented 1 year ago

Ah, yes, that's by design. Ludusavi is file-oriented, like Git. My assumption has been that there aren't any games where an empty folder is useful/meaningful, whereas empty files could still be useful (e.g., when used as a flag).

In most cases, I can see why this would make sense since there are no files present. It just looked like there was an error when cross-referencing what the UI showed compared to paths on PCGW.

Also, I've created a temporary custom game path for the game in question to include an 's' and now all config/data paths are matched as expected on Windows. No detection issues remain.