Changing the questData file format
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
2 posts
• Page 1 of 1
Changing the questData file format
by Fnoed » 15 Jan 2011, 05:50
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?
How were changing file formats handled before?
Re: Changing the questData file format
by silly freak » 15 Jan 2011, 09:54
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!
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!
___
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
- silly freak
- DEVELOPER
- Posts: 598
- Joined: 26 Mar 2009, 07:18
- Location: Vienna, Austria
- Has thanked: 93 times
- Been thanked: 25 times
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 6 guests