Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  A good way to make save games that doesn't have version portability probs  (Read 5453 times)
0 Members and 1 Guest are viewing this topic.
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Posted 2005-08-16 03:35:52 »

To anyone who wants to know how to do this, check my conclusion post in this thread. It's page 2 post #17

Hello friends,

I have a game and currently we save levels with the ObjectOutputStream, where it just writes all the objects in the level to a data file.  This works fine, except for if I update any of the classes saved at all, like adding in a new method or modifying the parameters of an old one. There's the issue. In something other than a game, I'm sure you can ignore this, but that is simply impossible in a game that may release patches or new versions.

So, what's a solution? I was thinking I would save all the specific primitives to a file in a certain order, and then construct each object upon loading of the level, but this would get very tedious for so many classes and would mean modifying the load level code each version update. I will do this if nobody can think of a better way, but I wouldn't be surprised if I'm not the first one who's dealt with this.

If there is an way in LWJGL, I'll try that also, as I will eventually convert much of the game to it.

Thanks.

See my work:
OTC Software
8: Undefined index: online
File: /home/jgo/public_html/Themes/default/Display.template.php (main sub template - eval?)
Line: 161