Backward compatability

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
Locked
trendtimer
Posts: 21
Joined: Wed Jun 08, 2016 9:31 pm

Backward compatability

Post by trendtimer »

Hello again!

So I believe I've ran into this issue before, but I want to make sure I understand how ES2 is expected to work.

I have a custom class named "ObjectDescriptor.cs" and have used "Manage Types" to specify all the variables that are saved for this class.

I have creates several save files for this class.
I then have modified ObjectDescriptor.cs and added some new fields that need to get saved.
After adding the new fields, the load for older files isn't working, and I get a "Failed to read past end of stream" error.
Is this expected? If so, this creates a headaches because it difficult to add new features to my game and retain compatibility with older save files.

Can you explain how to handle something like this? I need my game to be able to load both older and newer save files. Thanks!
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Backward compatability

Post by Joel »

Hi there,

I describe a method of doing this in the second post of this thread which should guide you in the right direction: http://www.moodkie.com/forum/viewtopic. ... 853&p=2195

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
trendtimer
Posts: 21
Joined: Wed Jun 08, 2016 9:31 pm

Re: Backward compatability

Post by trendtimer »

Thanks. I'm saving a version number in my files now and will implement the solution you proposed. This should work. It's definitely good to get this kind of thing sorted out before releasing! It would be a real problem if you got stuck in a situation were adding to the game caused old save files to break.

On another happy note, I'm finally starting to test saving and loading games from a Built game instead of the editor. I've been disappointed at how slow the loading and saving has been while running in the editor, but it's much much faster (maybe 8-10 times?) when running a Built game! I'm not sure what causes the slowness in the editor. It's not necessarily ES2 being slow. I'm doing a lot of object instantiation, and animation script instantiation, and also doing a ton organizing objects into parent/child hierarchies.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Backward compatability

Post by Joel »

Glad to hear that solved your problem. You'll be glad to hear that Easy Save 3 (which will be a free update for all existing users) will automatically do this for you.

With regards to performance, I believe the Editor is much slower than at runtime (not just for Easy Save but for all code) as there's a lot of debugging/sandboxing going on which doesn't happen in a built player. I've found that having the Profiler open especially reduces performance.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Locked