Auto Save prefab gameobject dies after 3rd restart

Discussion and help for Easy Save 3
Post Reply
JoeKer992
Posts: 2
Joined: Sun Feb 07, 2021 12:22 am

Auto Save prefab gameobject dies after 3rd restart

Post by JoeKer992 »

Hi Joel, and anyone else who can help :D

I've been struggling with this issue for a few hours now, I searched on the forum and noticed there are other "Auto Save prefab" issues but I think none of them is similar to what I'm experiencing.

Here's what I'm trying to do:
I have a button in my scene that I use to instantiate a prefab, the prefab is composed of 4 children objects with various components, including TextMeshPro text. I click the button and said prefab is generated, and the TextMesgPro text shows its name, let's call it Room 1.
I can see Room 1 in my hierarchy, and I can see both ES3 Prefab and ES3 Auto Save scripts are attached to it, ES3 Auto Save scripts are also attached to its child gameobjects.
I then stop the game and restart it. All good this first run, Room 1 is still there, but ES3 Prefab script is missing now, which I guess is ok. I don't do anything else, I stop and start again and this time I have ~16 warnings and ES3 Auto Save script has disappeared too. Again I stop and restart, Room 1 is still there but this time I get this error:

Code: Select all

FormatException: Stream isn't positioned before a property.
ES3Internal.ES3JSONReader.ReadPropertyName () (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs:74)
ES3Reader+ES3ReaderPropertyEnumerator+<GetEnumerator>d__2.MoveNext () (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:414)
ES3Types.ES3Type_GameObject.ReadObject[T] (ES3Reader reader, System.Object obj) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:134)
ES3Types.ES3ObjectType.ReadInto[T] (ES3Reader reader, System.Object obj) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:77)
ES3Types.ES3Type_GameObject.ReadObject[T] (ES3Reader reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:126)
ES3Types.ES3ObjectType.Read[T] (ES3Reader reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:54)
ES3Reader.ReadObject[T] (ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:249)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:278)
ES3Types.ES3CollectionType.ReadICollection[T] (ES3Reader reader, System.Collections.Generic.ICollection`1[T] collection, ES3Types.ES3Type elementType) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3CollectionType.cs:52)
ES3Types.ES3ArrayType.Read (ES3Reader reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ArrayType.cs:36)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:274)
ES3.Deserialize (ES3Types.ES3Type type, System.Byte[] bytes, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:775)
ES3.Deserialize[T] (System.Byte[] bytes, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:764)
ES3File.Load[T] (System.String key, T defaultValue) (at Assets/Plugins/Easy Save 3/Scripts/ES3File.cs:243)
ES3.Load[T] (System.String key, T defaultValue, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:413)
ES3AutoSaveMgr.Load () (at Assets/Plugins/Easy Save 3/Scripts/Auto Save/ES3AutoSaveMgr.cs:81)
ES3AutoSaveMgr.Awake () (at Assets/Plugins/Easy Save 3/Scripts/Auto Save/ES3AutoSaveMgr.cs:100)


I stop and start one last time and Room 1 is gone, disappeared, instead, there is a new empty game object called "New Game Object" in the scene with nothing attached to it

Note, sometimes it takes 2 restarts, other times 3 restarts before Room 1 disappears.

As per your guide, I followed the correct setup (right-click on prefab-> Easy Save 3 -> Enable Easy Save Prefab) and then I went in the Auto Save tab and selected all the components I wanted to be kept saved.
I also tried the demo scene that you provided on this forum and my prefab works well with that scene. In my scene I'm not doing anything crazy with it, I just instantiate it with a button. Could you give me a hand please? I can't see where I'm doing wrong.
I'm happy to send you the invoice number and my scene too if you wish.

Many thanks
JoeKer
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Auto Save prefab gameobject dies after 3rd restart

Post by Joel »

Hi there, and thanks for getting in contact.

Unfortunately I've not been able to replicate this from what you've said. Please could you create a new, basic project with a simple scene which replicates this and private message it to me with instructions?

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
JoeKer992
Posts: 2
Joined: Sun Feb 07, 2021 12:22 am

Re: Auto Save prefab gameobject dies after 3rd restart

Post by JoeKer992 »

Hi Joel, thanks for your quick response.

I was generating a basic project to share with you, now I get this error however, even if I disable auto save on each object in the scene it will pop up the moment I reload the scene :(

Code: Select all

FormatException: Stream isn't positioned before a property.
ES3Internal.ES3JSONReader.ReadPropertyName () (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs:74)
ES3Reader+ES3ReaderPropertyEnumerator+<GetEnumerator>d__2.MoveNext () (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:414)
ES3Types.ES3Type_GameObject.ReadObject[T] (ES3Reader reader, System.Object obj) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:134)
ES3Types.ES3ObjectType.ReadInto[T] (ES3Reader reader, System.Object obj) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:77)
ES3Types.ES3Type_GameObject.ReadObject[T] (ES3Reader reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:126)
ES3Types.ES3ObjectType.Read[T] (ES3Reader reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:54)
ES3Reader.ReadObject[T] (ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:249)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:278)
ES3Types.ES3CollectionType.ReadICollection[T] (ES3Reader reader, System.Collections.Generic.ICollection`1[T] collection, ES3Types.ES3Type elementType) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3CollectionType.cs:52)
ES3Types.ES3ArrayType.Read (ES3Reader reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ArrayType.cs:36)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:274)
ES3.Deserialize (ES3Types.ES3Type type, System.Byte[] bytes, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:775)
ES3.Deserialize[T] (System.Byte[] bytes, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:764)
ES3File.Load[T] (System.String key, T defaultValue) (at Assets/Plugins/Easy Save 3/Scripts/ES3File.cs:243)
ES3.Load[T] (System.String key, T defaultValue, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:413)
ES3AutoSaveMgr.Load () (at Assets/Plugins/Easy Save 3/Scripts/Auto Save/ES3AutoSaveMgr.cs:81)
ES3AutoSaveMgr.Awake () (at Assets/Plugins/Easy Save 3/Scripts/Auto Save/ES3AutoSaveMgr.cs:100)
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Auto Save prefab gameobject dies after 3rd restart

Post by Joel »

Hi there,

I would first recommend deleting any existing save data incase it's become corrupted. You can do this by going to Window > Easy Save 3 > Tools > Clear Persistent Data Path.

If this doesn't resolve the issue, if you private message me the project I'll look into it further.

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