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.