Page 1 of 1

Changing the questData file format

PostPosted: 15 Jan 2011, 05:50
by Fnoed
Can we change the questData file format? Right now it is just a serialized object, this makes making even minor changes hard as it would break users' existing saves. With a more flexible file format, perhaps a SQLite database or even an XML file, it would be possible to modify fields without breaking backwards-compatibility.

How were changing file formats handled before?

Re: Changing the questData file format

PostPosted: 15 Jan 2011, 09:54
by silly freak
hi! i changed the old serialized deck format to a text based one.

the steps i took were:
- define an interface for reading and writing decks (basically extract all the methods already there
- let the "old" DeckIO implement that interface
- implement the "new" text-based DeckIO
- write a converter which reads all the decks from the old IO and writes them to the new IO
- Let the converter look for the old deck file on forge startup

the files were necessarily in the default package, since changing the FQCN breaks deserialization

now replace "deck" with "quest", have a deep read into the quest data structure right now, and how it's read and written, and then try to define a suitable data format ;)

good luck!