Plan for file format upgrade unification

From OHRRPGCE-Wiki
Jump to navigation Jump to search

Done[edit]

File format upgrade code has already been moved to the shared common.bas module, and is run by both game and custom.


There have been a long string of changes to the RPG format over the course of the history of the development of the OHRRPGCE. Some changes are implemented with extra emphasis on backwards compatability, so that old files continue to work without modification. Other format updates happen in a sub called upgrade in custom.bas, when an RPG file is first loaded into CUSTOM.EXE. Other format changes simply don't happen, because they seem like more trouble than they are worth.

Backwards compatability with old formats will be easier to achieve if the upgrade sub is cleanded up and moved to shared code where both GAME and CUSTOM can use it the same way. Then it will no longer be necessary to open and re-save an old RPG in CUSTOM before playing it in GAME.

Hazards[edit]

There are a few hazards to this approach. One is working with pre-unlumped rpgdirs. When GAME opens an RPG file it unlumps all the data to a temporary folder, and works with it there. Any modifications (format upgrades) are safe because they only change the temporary copy, not the original. With a pre-unluped rpgdir, this is not the case. the working files are the same as the original. A bad upgrade could damage the game, and even a good upgrade could render the game unplayable in the old version of GAME it was originally intended for.

See Also[edit]