Hacker News new | ask | show | jobs
by SpaceManiac 2687 days ago
It's senseless to store files that don't have user-facing meaning in My Documents. I know games that use it varyingly for web caches, shader caches, binary config files, debug logs, Lua scripts, downloaded mods, and even executables. And while arguably most gamers understand what save files are, they can't be double-clicked to open them, so I don't consider them documents (Maybe this is pedantic).

All this kind of stuff is what Appdata\Roaming and Appdata\Local are supposed to be for.

2 comments

Save games is a poor example.

Users often need to back them up. Backup systems often include Documents by default but not AppData.

Files in AppData are hidden, and you would not expect users to find them.

Further, many save games can be opened with a text editor just fine :)

I understand not backing up AppData/Local, but everything in AppData/Roaming is supposedly important enough to sync it over the network (if you use domains or another mechanism to give you the same Windows account on multiple computers). Any default policy which doesn't back up AppData/Roaming seems ill advised.
It's ill advised to synchronize game saves by default. Quite a few popular games generate gigabytes of saves.

My witcher saves were 10GB, until I realize that problem and deleted them, no wounder backups were slow. Skyrim is not that far off.

Pretty sure backup is already integrated in steam for these two games.

I don't know what they save but 10GB is surely not purely saved games. It's those games fault not about 'saving saved games by default'.
Nope, Witcher 1 saves are just really large (for some reason in addition to all the flags they also contain some locale data and such). 10GiB is actually pretty reasonable for a Witcher playthrough.
It's similar in the Witcher 2, 3 and Skyrim. The saves start small and they grow to 10MB as you progress in the game. I guess there is a lot of world state and items to hold in an RPG. Count a few hundred saves, manual or autosave and that's a lot of space.

In the witcher 1 there is also an uncompressed BMP thumbnail with each save that is about a megabyte. It's PNG compressed in the witcher 2. They learned from their mistake.

My "Roaming" is 12GB. I don't think Chrome and Firefox listen to that advice.
My AppData/Local is 14GB, mostly caches from Chrome, Firefox and Spotify. My AppData/Roaming is 3.3GB, mostly my emails (with my Browser's localstorage a distant second).

Chrome's cache is in AppData/Local/Google/Chrome/User Data and Firefox's cache is in AppData/Local/Mozilla/Firefox/Profiles/. The only big offender on my system is npm with a cache in AppData/Roaming/npm-cache

Thunderbird infamously places the local copy of IMAP mails (i.e. Effectively a cache) into Appdata\Roaming. It's the single largest directory I have there. Everything else is quite reasonable in size.
As noted below there's a special folder called "Saved Games" that's specifically meant for this purpose. A lot of games still don't use it.
To be fair it's widely used now, it just took a while to adopt because of compatibility issues.

Finding the directory requires new APIs introduced in Vista and Server 2008. See SHGetKnownFolderPath

Sure but in the non-game software world we'd do a runtime check to see if the OS was Vista or later and fallback if not.
You can't do it as a runtime check. You have to compile the software with the flags to import and link to the latest windows library. The program will hard crash if run on an older version.

I just tried to use the API. I literally couldn't find a working example on the internet in 2 hours so I guess noone figured it out in a decade.

Wrote https://stackoverflow.com/a/54499257/5994461

What's wrong with calling IsWindowsVistaOrGreater[0]?

[0] https://docs.microsoft.com/en-us/windows/desktop/api/version...

Why did they have to narrow it down to games? Could just go with "Saved config (and data)", so other apps could just dump small config files which can be effectively backed up.
And here I am, still wanting my save files to reside next to the games exe...
Fair enough but on multi-user systems you can surely see the value in separate save game folders?
when was the last time a gaming machine is a multi-user system?!
Since when every person in a house has their own gaming PC?
I'm currently typing this on a machine that's used for gaming by more than one person.
There's no reason there couldn't be separate per-user folders within the game's installation path for that.
Do you also store your birth certificate in your car's glovebox?
What a misleading comparison...

I don't even get what you want to say.

A game's exe dir is a long-lived but potentially replaceable thing, like a car. Saved games may be persisted across game versions, so you don't necessarily want them to be in the same directory. Admittedly not the best analogy, but was just observing that it's strange and incongruent to store the 2 together.
I haven't used My Documents for documents for years now. The directory is useless because of all the cruft, I store useful things elsewhere now.
My Documents meant as /var/tmp to me ever since it existed. Never put my own files there.