The joys of json
What I've discovered so far this week is that json is awesome. For everything. We have it as our map format and we have it for saving settings. With simplejson it is just pure awesomeness. Much easier than ini or any other format.All the json elements convert strait to their python elements equivalent (thanks to javascript and python types having so much in common). I don't have to do any manual type converting from the settings file to python this way. Much better than any ini parsers I've seen.
(log in to comment)
Comments
Why is that a joke in your opinion? LOL.
But actually, looks kinda cool using a different tool outside of the norm - so more power to you :)
BTW - your game screenies look awesome O.o
This would greatly inhibit a community from creating content for your game.
Game development is like web development in this respect: never EVER trust any external data to be safe. Security though obscurity never works. (Especially when the code is open source)
Secondly I personally think using code for data structures when something else can be used is just bad practice. For instance it is much more difficult to make a level editor that has to use coded structure format apposed to something like XML, png or json.
The settings isn't nearly as big of a potential problem as the map format though. But still, it takes more code to reconstruct it for saving than json or ini. Especially json.
self.data = simplejson.load(fp) ... self.data["mute"] = True self.data["res"] = (1024, 768) ... fp.write(simplejson.dumps(self.data))
richard on 2008/09/10 21:48:
Why don't you just use Python and execfile to load? :)