What are good options for storing level, score, and star rating data

I am creating an astroids like game. I have a good bit of the logic complete. I am now to the point where I want to store data about each level of the game. I want to follow the same type of concept that Angry Birds has for it’s levels. I am going to have a star rating, scoring and best score, unlocked or not.

I looked at a nice little lib on the code share for game logic and saw “Ice” I have it working but I am not sure this is the cleanest best way to go. I want to make a good choice now before I do a tone of implementation. Eventually I will get OpenFeint integrated and Game Center but I don’t want to be tied to them. I will mainly use them for achievements I think.

Other logic that I plan on implementing is allowing the user to earn better weapons, ships and so on. This logic I assume will also be tied to the star ratings of the levels, scores and so on.

Anyway, This is for sure my first time implementing this type of logic and could use any suggestions you guys and gals would have.

[import]uid: 7501 topic_id: 16924 reply_id: 316924[/import]

You could go with SQLite database, but for a game with levels, I’d personally go with JSON:

http://blog.anscamobile.com/2011/08/tutorial-exploring-json-usage-in-corona/

I’d just store all the data in a table, convert it to a JSON string, and save that string to a file (in a sub-directory). [import]uid: 52430 topic_id: 16924 reply_id: 63462[/import]

I use SQLite for things like purchases, high scores, and levels being unlocked or not.
I use XML files for “levels” and parse them.

I do not store things like “Star Ratings”, since if you know the score, you can reverse engineer the rating at runtime.

The best tip I can give you is to create re-usable modules for all your common tasks. Then when you start a “new” game, you’re really like 60% done already lol.
[import]uid: 36054 topic_id: 16924 reply_id: 63466[/import]

What @Jonathan said. Just make a table using the memento pattern, convert to JSON, and save her out. Do the reverse when loading up.

Memento Pattern - Video | Article

Writing Files

Save your files in zee Documents [import]uid: 23693 topic_id: 16924 reply_id: 63469[/import]

great suggestion. thanks! [import]uid: 7501 topic_id: 16924 reply_id: 63471[/import]

I was going to use SQLite for a game in development, but I’ve decided to use JSON instead. Its a great simple way to save/load Lua tables.
[import]uid: 19626 topic_id: 16924 reply_id: 63474[/import]

Well after it’s all said and done I ended up using the “Ice” module. It uses JSON to do pretty much what everyone was suggesting I do and it seems to work perfectly.

http://developer.anscamobile.com/code/ice [import]uid: 7501 topic_id: 16924 reply_id: 63480[/import]