CG-Tespy / FungusSlotBasedSaveSystem_Unity

A replacement for the built-in Fungus Save System that is closer to the standard save systems you see in games.
MIT License
14 stars 3 forks source link

Flowcharts "falling out" from Saver #18

Closed amalgamhpc closed 5 months ago

amalgamhpc commented 6 months ago

I am using the save system made by <@95287070720786432>. Rarely but every once in awhile (maybe once a year) the data in a flowchart stops saving and reverts to its default values. Not only that, any data in that flowchart CANNOT save and this appears to be a permanent state. I don't know why this happens or if I'm doing something to trigger it.

Removing the flowchart from the saver list and putting it back doesn't restore the data nor does it restore the ability to save that data. Putting a second copy doesn't fix it. The only thing I know so far that fixes it at all is renaming the flowchart. This restores the ability to save that data, however, all that data stored in prior saves is returned to default values. This is a pretty nasty bug

CG-Tespy commented 6 months ago

It's a pretty nasty bug indeed... If it happens once in a year, then this is going to be real tricky to solve :/ Until you provide an example project that reproduces the issue reliably and quickly, I can only speculate as to what causes it. Here are my guesses at the time of this writing:

amalgamhpc commented 6 months ago

It's a pretty nasty bug indeed... If it happens once in a year, then this is going to be real tricky to solve :/ Until you provide an example project that reproduces the issue reliably and quickly, I can only speculate as to what causes it. Here are my guesses at the time of this writing:

  • Some async operation by other code in your project that affects things being saved
  • The stuff you want saved isn't in some kind of global Flowchart set. A set that's in every scene

    • This is your safest bet when using this system, since it only takes into consideration what's in the scene at the time of saving

I only have one scene because I don't know how to work with multiple scenes XD

Anyway, I've been paring down a copy of the project so it's in some form that can be easily uploaded and downloaded and in the course of deleting things, I did come across some (I guess) combination of remaining components that allowed the damaged flowcharts to start saving again that didn't require me to rename them, so I hope that this might mean my players don't have to restart their playthroughs. So I imagine that lines up with your hunch.

amalgamhpc commented 6 months ago

Here is my project. A lot stripped out, including the library so it may need to rebuild.

I think you should find that the flowchart "Kelly" does not save properly. Other flowcharts like Ann and Tea1 do. However, if you rename Tea1 to just Tea, it should stop saving. If you rename Kelly to Kelly1 or anything else it should start to save again.

https://mega.nz/file/8EYHRRSA#en94lidjXhn1PkdnZN0enz2nFuwufCvSeRXSr_lrRSY

amalgamhpc commented 6 months ago

HOLY SHIT I FIGURED IT OUT

The Kelly flowchart is only the most recent problem I was dealing with. But I decided to tackle it in particular. I went in and deleted or renamed every game object with an identical name. Not only is the Kelly flowchart saving again, all the old lost data was restored.

CG-Tespy commented 6 months ago

Glad to see your problem's solved ^^ Given the cause of the issue, I suggest making sure each of your meant-to-be-saved Flowcharts have unique names from now on.

amalgamhpc commented 6 months ago

Glad to see your problem's solved ^^ Given the cause of the issue, I suggest making sure each of your meant-to-be-saved Flowcharts have unique names from now on.

Well, I think "solved" is slightly a strong word though it's certainly a workaround. To be clear, these conflicting objects were NOT flowcharts. Some of these were just empty game objects meant to contain other objects in the hierarchy. It is still definitely a problem

amalgamhpc commented 6 months ago

Thanks for the help regardless! I wouldn't have my project if it wasn't for your save system