r/gamedev•
unhappyrobot

Thoughts on game saves?

As I work on my game I keep wondering what I should do about saved games from previous versions. I have not released yet (will very soon) so this is a problem for the future, but I would like to have some ideas in place before its a problem.

I am developing in Java with LibGDX so I can target Desktop and Android platforms. At this time I have two options I am considering. The first, and currently in use, is json serialization. Right now this is working, but because I have to store some type information in the json file I sometimes run into issues when renaming classes. I could probably solve this by having a magic value for each type that never changes. Alternatively I could also write converters as I need them. Right now I really like the schemaless nature of the json. I use polymorphism heavily so its great to add attributes to a subclass and have it automatically serialized.

The second option is sqlite. While this is available on every platform, it does come with some drawbacks. I will have to add custom bindings to sqlite for every target platform, and can use the native ones on android. However this is a very fixed schema and will be quite ridged I think. I can use polymorphism still, but I will have to write the code to handle that directly.

I was curious what everyone else is using for game saves in their game.

Posted Feb 22, 2012, 7:40 AM UTC

49
Loading comments…