I always wonder how to do this.
I release demo of my game twice, and my beta testers complain that they cannot use old save files to continue a game in newer versions; they have to play a whole new game instead. Is it possible to overcome this?
Well, let's say in game v0.1 I have this class:
In v0.2, I modified the class to add one more data member:
When loading save files from v0.1, the game will always crash because of end of file (EOF) error. It also applies when I added more classes to newer versions.
Or, if it doesn't come to EOF error, the game will be eventually stop when it tries to access var3 that is unexpectedly nil.
Any idea to counter this? I planned to release third demo which will include more additions to the script along with more storyline.
Anyway, how does Marshal.load($game_time) work? How can my $game_time be restored with each data members holding their previous values? I wish I had that method in Flash's ActionScript...
Thank you.
I release demo of my game twice, and my beta testers complain that they cannot use old save files to continue a game in newer versions; they have to play a whole new game instead. Is it possible to overcome this?
Well, let's say in game v0.1 I have this class:
Code:
class Game_Time
attr_reader :var1
attr_reader :var2
# And so on...
end
In v0.2, I modified the class to add one more data member:
Code:
class Game_Time
attr_reader :var1
attr_reader :var2
[b]attr_reader :var3[/b] # now here's the new data member
# And so on...
end
When loading save files from v0.1, the game will always crash because of end of file (EOF) error. It also applies when I added more classes to newer versions.
Or, if it doesn't come to EOF error, the game will be eventually stop when it tries to access var3 that is unexpectedly nil.
Any idea to counter this? I planned to release third demo which will include more additions to the script along with more storyline.
Anyway, how does Marshal.load($game_time) work? How can my $game_time be restored with each data members holding their previous values? I wish I had that method in Flash's ActionScript...
Thank you.