I need to save some custom game data. Map, player, etc.
All of them will have "sub objects". For example, a map and map will have an "array" of tiles. ie, hierarchical data. Hopefully nothing binary.
What would be a good format for these?
So far I'ved considered:
Serailization: This is FAST and easy, but tends to break when I change the underlying classes :(
XML: I really hate parsing this. My test case was over 100+ lines of code and seemed likes tons of "busy work" for even a very simple format.
INI: would be really clumsy for hierarchical data.
Protobuf: Never used it, but read you have to do a lot of manual mucking around and breaks if you change the class.
Other options? That's why I'm here!
Edit: this is Java btw.
Edit 2:
I settled on "Controlled Binary Serialization" (see below).
Pros:
it's fast
it's small (on disk) and can be easily compressed/decompressed during read/write.
it's super easy to read/write from game and toolset.
I can decide what to include/exclude of the object.
Objects/Data can be nested.
Cons:
Can't edit it by hand (like XML, YAML, etc)
Can't easily read/modify it with scripts
Java Serialization by default is pretty slow/bloated compared to other implentations, but it's stable and works