Game Development Community

Registry?

by James Jacoby · in Torque Game Engine · 11/14/2005 (8:26 pm) · 4 replies

Do macs have a registry or similar to the windows registry ? What is the best way to track information about a program independent of the install files?

#1
11/14/2005 (10:28 pm)
Usually, people dump things in ~/Library/Preferences. They're ".plist"s (XML files) so they're pretty easy to parse.

Either that, or store a plist inside the application's bundle. If the app is removed, then the prefs are, too. It keeps the system cleaner.
#2
11/14/2005 (11:14 pm)
You should never store plist information or save files in the applications bundle. There are some api to use to parse the plist, you don't need to do this yourself. The new plist files in 10.4 are binary, but you can change them to text or use the plist editor if necessary. Check macosxhints.com for the utility examples.

If you want a save game file, they should be put in ~/Library/Application Support/. This is the method that Quake III uses.

You can use the global /Library/Application Support/ as well.
You many have to add this stuff to torque though.

I hope this helps.
#3
11/16/2005 (1:04 pm)
Thanks for the info. I will definatley have to add this to torque. It shouldn't be to hard though. I have already created some console functions that expose the windows registry functions so you can get and set key/value pairs from script... I'll just create an alternate set of code that compiles in for mac using the method above.

I'll post a resource when I'm done.
#4
11/16/2005 (9:57 pm)
Will you be adding in functions for Linux/Unix as well?

Good luck on your resource.