Save states and game updates

I have just realised that the Save states method of saving and loading might not be a good fit for my project. While the Save states system is easy to implement, I can’t find an easy way to get updates to work. I was worried that updates would wipe out the save. But no, the save overrides the update and the new content doesn’t appear. Here’s what I did:

  • I did a test apk export and the save/load worked perfectly
  • I then updated the project with new objects and changed the background color and then updated the apk on my phone
  • the previous save state was there and the new objects or background color change did not appear

If you are thinking ‘that is expected behaviour and if you want new objects in the scene, you have to specifically create them in a Load just succeeded event’. Then my answer would be well okay but if that is the case, I think the documentation should be changed so that people understand what save states can and can’t do. Also, if there needs to be specific create actions then they would need to be there for every update afterward so that people who skipped some updates wouldn’t miss out. Which means they would be doubled up for people who did every update.

If I’ve missed something obvious and save states and updates with new objects can easily work, please let me know. Otherwise, it’s back to jsons for me.

I’m trying to wrap my last few brain cells around this. It’s late.

Is this similar to the issue of saving a structure to storage and then modifying the default structure in the variable editor? Changes made in the editor are replaced when you load the structure from storage.

In my example, you’d need to add the new structure children at runtime after the structure was loaded from storage at least the first time after an update.

Maybe you need some sort of merge or update option. Although, I don’t know how that would work. How would it know what was new or old? Maybe the new objects could have a flag. Something that says to GD “Hey, I’m new here. Keep me this this time” I would say something that locked the object from being deleted when the save was loaded but you only want it locked the first time. If it was locked forever then the 2nd time, you’d have an extra copy.

I think there’s no easy way around it but having an update routine that compared the saved version number to the current version number and then added the new objects and any new variables.

I haven’t used the new save state much but I guess that’s where profiles come into play. You only save the bare minimum. Like, you wouldn’t save the UI or any game menus.

As you well know, I’ve been struggling with this for months…
so I understand your decision to go back to JSON (which is more reliable), but it still forces you,at least in my case,to use a ton of extra events.

Keep in mind that I use JSON together with the inventory system + advanced inventory system, etc…

so imagine all the JSON changes and reads. All of this would disappear with save state… so it’s worth it.

The problem is that since its release… it’s just stayed like that.

-off topic removed cos problem fixed in ver 5.6.254

1 Like

You mean to get linked objects to be re-linked after loading with save states? It is possible. I didn’t think of it, ChatGPT helped me, so for anyone who has objections to ai help, look away now.

In my situation, my (multiple) Objecst already had an id assigned to it on creation. So then I assigned the same id to the OtherObject

Then on load just succeeded, I used the action Unlink all OtherObjects from Object.
Then in a subevent of that, it was neater that way, I had a
for each instance of Object where OtherObject id = Object Id, → Link Object and OtherObject.

Do you have the red editor and game labels the wrong way round? But yeah, not a good result.

Yeah, if this is correct then Save states ease of use is a bit misleading.

workaround found…rests removed cos off topic…

hope you gonna find a workaround for yours too…in that case let me know…gonna add it to workarounds thread

,…btw i …too switched back to JSON…

1 Like

:astonished:
Yeah, I don’t actually mind switching back. And you’re right, there’s been no progress with it since release. And if my experiences with it are correct and it can’t cope with simple game updates, I’m not sure who it’s actually useful for.

1 Like