-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CommonPaths: Add Steam-specific user directory and clean up #11459
Conversation
c396908
to
c4e3d90
Compare
This seems a bit odd. Is there any particular reason to separate the user folder of regular builds vs Steam builds? Couldn't we just point the Steam Cloud API to the regular user folder? |
This is what I've set up already in the backend, but it has been broken with the merging of #10708. There are two ways to set up Steam Cloud: automatic ("auto-cloud") and manual (via the API). With automatic, I can just can point Steam Cloud to a specific path and tell it to sync that directory. Unfortunately, this system is very limited. I can't have logic that says "use this path if it exists, otherwise use this path", which is necessary to sync the correct user directory on Windows now that there are two possible paths. We would have a lot more control with a manual implementation, but it isn't possible to add one at the moment because it would necessitate linking with the Steamworks SDK. This would cause a violation of the GPL. Even if we could, a rewrite of our file handling code to add Steam Cloud support is needed. |
What folders are you syncing to the Steam Cloud, by the way? I have a feeling just syncing the whole user folder is going to result in a lot of cruft being synced (savestates are huge, the Load folder could be huge if the user puts texture packs in there, shader caches are pointless to sync -- though shader UID files might not be), which is probably not ideal. Syncing the config files themselves is probably not a great idea either, since there's a lot of system-specific stuff that you probably don't want to share eg. between your gaming PC and your Steam Deck. |
Aren't these all the same reasons the folder shouldn't be roamed? :-P |
@AdmiralCurtiss Just |
How does Steam Cloud handle a Wii NAND? Does Steam Cloud allow 512MB? |
@MayImilae It should handle NANDs fine. The total storage space allocated for an application is set by the developer. Right now I have it set to 1GB, which is probably a little excessive. |
Well... yes, not wrong. I'm not sure if we can change this now, and I'm not sure how easy it would be to add this to the code, but it would have probably been a good idea to split the user folder into a 'local' and a 'roaming' one, and then Steam could just sync the roaming one. But,
yeah this seems like a decent solution anyway. |
…o accomodate macOS
…path on Windows builds for Steam
c4e3d90
to
234de8a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just so that the Mac and Windows names match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a case to be made for only using folders that correspond to each Steam user
// 1. GetExeDirectory()\portable.txt exists | ||
// -> Use GetExeDirectory()\User | ||
// 2. AppData\Roaming exists | ||
// -> Use AppData\Roaming\Dolphin Emulator (Steam) as the User directory path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would actually suggest the Steam builds not use AppData\Roaming at all, and instead rely on Steam user-specific folders. Using folders outside the Steam directory could cause conflicts if multiple Steam users sign into the same OS user. (Sorry I didn't think to say this sooner...)
How often do people run into this? I looked up some random big name games off the top of my head out of curiosity, and most of them store their save files under The one exception I found was Resident Evil 4 (2023), which synchronizes saves with Steam Cloud via the Steamworks API. |
If we want to change the user directory for steam builds, we should probably do that before steam builds end up in users hands and we have an article telling them how to transfer saves and what not. So, decide fast I guess. IMO, per Steam user would be better than not, as that matches what we already do with desktop Dolphin (per OS user). |
Yeah, I agree it would be best. Unfortunately, this is going to take some effort to resolve. I can set up separate per-Steam account user folders by using the Steam account ID. (This is the sole variable I have access to when setting up Steam Cloud.) The only way I can find to fetch this is via the Steamworks SDK, which we can't link to directly because of the GPL. I've been working on a steamshim-alike program which should sidestep direct linking while letting us use the Steamworks SDK, but it won't be ready for a little bit. |
Having a Steam-specific user directory will allow us to enable Steam Cloud, so that users can have their save files synchronized across machines. The paths are as follows:
%appdata%\Dolphin Emulator (Steam)
~/Library/Application Support/Dolphin (Steam)
~/.config/dolphin-emu-steam
,~/.local/share/dolphin-emu-steam
, and~/.cache/dolphin-emu-steam
In addition, the user directory logic has been simplified for Windows builds on Steam. Basically, the registry keys and the old user directory are ignored. (We cannot check the user directory registry key because it is set to the non-Steam path on newer installs.)
While I was here, I also took the opportunity to clean up
CommonPaths.h
, since the names used for the defines were a bit outdated.