Use Saved Games shell folder instead of Documents/My Games for savegames

You may post your suggestions about Capitalism Lab here
Post Reply
Berbe
Level 3 user
Posts: 94
Joined: Tue Dec 06, 2011 5:16 am

Use Saved Games shell folder instead of Documents/My Games for savegames

Post by Berbe »

I noticed saved games are stored in the My Games subdirectory of the Documents shell folder.

On Windows, there is a dedicated shell folder for savegames.

Handling shell folders can be done using the registry:
https://superuser.com/a/1132321

Trying to use the 'Shell Folders' keys instead of the 'User Shell Folders' show a warning key message telling to preferablly use the SHGetFolderPath (before Windows Vista, https://msdn.microsoft.com/fr-fr/librar ... s.85).aspx) or SHGetKnownFolderPath (starting with Windows Vista, https://msdn.microsoft.com/fr-fr/librar ... s.85).aspx) functions.

Using the registry, it seems there is no human-form key to query. Using a list of known folder GUIDs (https://msdn.microsoft.com/en-us/librar ... s.85).aspx or https://docs.microsoft.com/en-us/dotnet ... tom-places), I ended up being able to quickly query the path for the correct location of that folder:
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v {4C5C32FF-BB9D-43b0-B5B4-2D72E54EAAA4}

It's probably better to use the Shell32.dll functions though, links to which are provided above.
User avatar
David
Community and Marketing Manager at Enlight
Posts: 9379
Joined: Sat Jul 03, 2010 1:42 pm
Has thanked: 21 times
Been thanked: 53 times

Re: Use Saved Games shell folder instead of Documents/My Games for savegames

Post by David »

What is the advantage of doing so? Besides Capitalism Lab, the majority of games on the market (including the popular Civilization series) also save to the \Documents\My Games folder.
Berbe
Level 3 user
Posts: 94
Joined: Tue Dec 06, 2011 5:16 am

Re: Use Saved Games shell folder instead of Documents/My Games for savegames

Post by Berbe »

I would bet on developers ignorance as to why it is a common behavior, and even Microsoft-published games do not always follow best practices. ;)
It's a little bit of a pain to get everything ending up in Documents...

I got some examples of games doing a proper job:
  • Fable III
  • Frontier Developments (Elite Dagerous, Planet Coaster)
  • Startup Company
  • OpenTTD
Shell folders can individually be relocated, that means having savegames stored on their specific, dedicated location.
Post Reply