PDA

View Full Version : WTF does 'My Games' folder come from?


cliffski
09-29-2008, 02:20 PM
Ok semi-tech geek question, because I know there are some developers here who work at stardock and other companies that have done this:

Under vista, how the fuck do you locate this folder:

\MyDocuments\My Games

I see stardock, THQ and Rise Of Nations are putting stuff in there, but I'm fucked if I can find an API to get that folder. I can get

\Saved Games

Which no bugger uses, and of course MyDocuments.
Are people *really* just bodging in "My Games" as a hard coded addition? I don't mind if they are, I just want to stop pulling my hair out. I'm sick of my games cluttering up MyDocuments, and want to do the 'ruight thing' short of the Games for Windows logo crap and the hell of getting added to the Game Explorer. Please tell me everyone just pastes "My Games" on the end of the mydocs folder and it's everyone's dirty little secret.

Yours,
A distressed coder just 24 hours before releasing a game.

Kool Moe Dee
09-29-2008, 02:23 PM
AFAIK there is no standard for this that is accessible under XP, and it seems like everybody just adds on either the game name or "My Games". IIRC there is a standard way to deal with this in Vista, but it's been so long since I've looked at this I'm not sure what the constant name is off the top of my head...

Fugitive
09-29-2008, 02:24 PM
I think they are hardcoding it; various games use different locations, either because they're older ones before the Vista/GfW conventions were documented, or they just didn't care about them.

What I really hate are games that put saves in the AppData directories; I don't want to have to go digging around in all the hidden directories in my profile as well just to make sure I've got them all preserved...

cliffski
09-29-2008, 02:25 PM
for a long time I thought I'd found it with
FOLDERID_Games
But that's not it.
Ironically I can find
FOLDERID_SavedGames
which nobody uses, but the other one is a mystery :(

Fugitive
09-29-2008, 02:34 PM
I think FOLDERID_Games is the virtual folder you get when you open the "Games" section from the Vista start menu. FOLDERID_SavedGames is what you want, but it's new in Vista, so you might need some kind of fallback path for non-Vista users. And then worry about importing from the old path when the user switches to Vista...

Or do what the other guys did and just hardcode a path off the profile root and stick with that.

Zylon
09-29-2008, 02:37 PM
What I really hate are games that put saves in the AppData directories
And what I really, really hate are programs that take it upon themselves to presume that their config files belong in My Documents. That folder should be for exactly what I decide to put in it, and absolutely nothing else.

cliffski
09-29-2008, 02:38 PM
I think I'll hard code "My Games" onto the end of the MyDocs. That's where everyone seems to be putting stuff (ignoring "Saved Games"), and I don't want to spam the saves one place and configs somewhere else. I'm only doing an English language version so sod it.
what a mess.

Rock8man
09-29-2008, 02:41 PM
Yeah, I hate both games that put themselves in My Documents/My Games, and also games that put themselves in AppData directories. In the end it means having to search around and potentially miss save game data when it comes time to back things up so that I can reformat and reinstall Windows.

On the other hand, I love it when games detect by themselves (Interplay games used to be good about this) that I have a "Games" directory, and the default installation should be to that directory, not to Program Files. And that games should store their saves under where I chose to install them, not to some weird place on the drive where Windows is installed.

Zylon
09-29-2008, 02:53 PM
The real problem is that most games don't offer the option to export saves. Everything else is just a symptom.

Kunikos
09-29-2008, 03:03 PM
I think I'll hard code "My Games" onto the end of the MyDocs. That's where everyone seems to be putting stuff (ignoring "Saved Games"), and I don't want to spam the saves one place and configs somewhere else. I'm only doing an English language version so sod it.
what a mess.

At least there's a "gentlemen's agreement" now, which is certainly a lot less of a pain in the ass when dealing with configurations that multiple users on a single computer need (like two brothers, but one is a lefty-- FUN).

RobotPants
09-29-2008, 03:31 PM
The part I like is that the first time a game doesn't use the Games folder in Vista, the whole thing becomes pointless.

Chris Nahr
09-30-2008, 01:39 AM
And that games should store their saves under where I chose to install them, not to some weird place on the drive where Windows is installed.

I guess concepts like "non-administrator login" are alien to you? Still running Windows 98?

The installation folder is in "Program Files" by default, and that directory tree is write-protected for non-admins under every Windows version since 2000. So no, developers can't and shouldn't put save games in the installation location.

Scott Kevill
09-30-2008, 02:22 AM
I think I'll hard code "My Games" onto the end of the MyDocs. That's where everyone seems to be putting stuff (ignoring "Saved Games"), and I don't want to spam the saves one place and configs somewhere else. I'm only doing an English language version so sod it.
what a mess.

As Fugitive said, according to MSDN (http://msdn.microsoft.com/en-us/library/bb762584(VS.85).aspx), FOLDERID_Games is a virtual folder, which explains why it's not working for you.

You definitely have to hard-code it for XP which means you don't benefit from any localisation that I would have thought official special folders use.

Stupidly enough, you have to hard-code it for Vista as well. Another shining example of Microsoft's commitment to Games for Windows. :)