24 May 2008

Windows game high scores not saved

Something possessed me to install Snood on the kids' computer again. That's a great, little game. (If you want the same basic game in FreeBSD, take a look at "games/frozenbubble" or "games/monkeybubble" in ports.)

But, after a day of play, we noticed something horrible. Most high scores were not being saved! I've had this issue before with some other Windows games so it was no great mystery. On the kids' Windows XP, only I have administrative rights.* So, after I installed the game, the high scores file (whatever and wherever that was) was only writable by me. When they log in and play, their high scores are not saved.

So, let's fix this. As far as I know, this must be done via the command-line. (I'm doing all of this in XP, BTW. If you're running another version of Windows I don't know which parts of this will work, if any.) Open the "Command Prompt," found under "All Programs> Accessories" in the Windows menu.

Next, you've got to find the file where the high scores are saved. This is not necessarily as hard as it sounds. In the case at hand, I've played and saved a high score successfully, so the file in question should have a modification time that is later than any other file. I've installed the game in the directory "C:\Program Files\games\Snood 4" and if I "cd" there and then run "dir /o:d", I can easily see that "SnoodPrf.40W" is that file:
C:\Program Files\games\Snood 4>dir /o:d
Volume in drive C is SOMETHING
Volume Serial Number is X-YYYY

Directory of C:\Program Files\games\Snood 4

11/08/2001 03:27 AM 237,568 glut32.dll
07/31/2006 02:14 AM 38,928 Agency.fnt
08/08/2006 09:31 AM 6,022 HelpLB.txt
05/18/2007 12:41 AM 268,304 Lexia.fnt
01/22/2008 03:31 AM 77,204 Snood 4.0 ReadMe.rtf
03/15/2008 05:04 PM 18,182,144 Snood.exe
05/22/2008 12:37 AM 685,849 unins000.exe
05/22/2008 12:38 AM 2,332 unins000.dat
05/24/2008 08:40 PM <dir> .
05/24/2008 08:40 PM <dir> ..
05/24/2008 08:40 PM 10,820 SnoodPrf.40W
9 File(s) 19,509,171 bytes
2 Dir(s) 80,384,868,352 bytes free

Now for the fun part. We'll need to use the little known Windows program "cacls" to make that file world "changeable". Use some care with this utility. First, run "cacls /?" to see the basic usage. Of special note, always (always) use the "/E" switch so that your changes to the file ACLs don't replace ALL of the existing ACLs. (Yes, it's stupid by default.) Next, just run "cacls <file-of-interest>" to see what the existing ACLs are. There are several in most cases (and if you forget the "/e" switch, you'll have to replace them all, so be careful).

In my case, I can see that what I want is for the unprivileged "BUILTIN\Users" to change from "R" (read access) to "C" (change access). I say "in my case," only because some people may have a more complicated set-up with network users -- but I'd expect the vast majority of people to be in the same boat as myself. So, here's the command that made our high scores work correctly for Snood:
cacls SnoodPrf.40W /E /G "BUILTIN\Users:C"

I've done this once before for another old Windows game, Worms Armageddon (WA). (A great game, BTW. Check "games/wormux" in ports for an open source clone.) With WA, this process was a bit more difficult. First of all, it has a large, multi-directory structure, so it was tough to find the right file. (It was "<WA-top-level>\User\Teams\WG.WGT".) Second of all, the "C"/change access was not sufficient for the regular users to update the file. I don't know why, but in that case I had to grant full access to the file for the scores and saving to work correctly. Keep that in mind, in case you're trying to fix high scores on some other game. Good luck!

Update
I just (re)installed ThinkTanks for the kids. (Another fine game.) But, it also has score/profile saving issues in Windows. To fix, change to the "<TT-top-level>\game\client" directory and update the ACLs (as above) of these four files:

prefs.cs.dso
players.cs.dso
players.cs
prefs.cs


Update 2!
I'm not intending to catalog every Windows game with this issue. But, I've found another one that has put their save files in an unusual place. It is "Luxor 2" by MumboJumbo. It creates a directory, "C:\Documents and Settings\All Users\Application Data\MumboJumbo\luxor2", that all users need to have full access to. And, the files within and sub-directories as well. So, 'cacls luxor2 /t /e /g "BUILTIN\Users:F"' ought to do it.

* I'll have to write about Windows security some time. But, a big part of any reasonable security plan for Windows is ensuring that everyone logs in under their own username and not with administrator rights!

Labels: , ,

4 Comments:

At 27/5/08 23:31, Anonymous Dave Dobson said...

Sorry about the trouble. You can also change the default location for the preferences file in the system preferences - if you change it to a location you can write to, it will work fine.

The game is supposed to notice if it can't write and prompt you to find a better place, but maybe that's not working for some reason. I'll check on it.

-- Dave Dobson

 
At 27/5/08 23:32, Anonymous Dave Dobson said...

Oops, I meant the Game Preferences on the preferences menu, not the system preferences. Duh.

 
At 27/5/08 23:57, Blogger kace said...

No trouble at all! This issue affects many Windows games and I was glad for the reminder that I wanted to write this article about how to fix it. Snood is a great, all-around game and I enjoy competing with the kids.

The game did not throw any errors when it was unable to write the scores, though. I did notice later that you could choose another location for the pref.s file. But, I would have wanted to write this anyway, because I believe it applies to many other games as well.

Thanks for stopping by and thanks for a great game!

 
At 26/11/09 12:48, Anonymous Anonymous said...

This comment has been removed by a blog administrator.

 

Post a Comment

<< Home