Giter Club home page Giter Club logo

Comments (9)

hhyyrylainen avatar hhyyrylainen commented on June 7, 2024 1

I'd really love to see the json_debug.txt file content. This second error seems very different:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at EditorBase`2.set_EditorReady(Boolean value) in /home/hhyyrylainen/Projects/Thrive/src/general/base_stage/EditorBase.cs:line 181
   at InvokeStub_EditorBase`2.set_EditorReady(Object, Span`1)
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at BaseThriveConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in /home/hhyyrylainen/Projects/Thrive/src/saving/serializers/ThriveJsonConverter.cs:line 594

That shouldn't able to be any kind of save data reading bug. This looks more like a rare bug in the Godot engine where it has incorrectly loaded a scene with not all of its resources. The game log file from when that error occurred might have errors from the engine that are related to the save load problem.

I had kind of similar problem where the Godot engine refused to consistently load about 3 NodePath variables. Switching those to use direct node references fixed those cases. We have not switched all of our code to use those direct references yet as it is a lot of work, but if this is done it might also fix the save load problem: #4940

from thrive.

Teashrock avatar Teashrock commented on June 7, 2024 1

Ok, The current json_debug.txt is unrelated, as I played further already, but I'll attach it if I encounter the bug again. Also, if it's really that Godot bug, then I just have to wait until it's fixed.

from thrive.

hhyyrylainen avatar hhyyrylainen commented on June 7, 2024

I think your save file has data that cannot be correctly loaded for some reason.

For reference this is the error:

Newtonsoft.Json.JsonException: Scene loaded JSON deserialized type can't be assigned to target type
   at BaseThriveConverter.CreateDeserializedFromScene(Type objectType, InProgressObjectDeserialization objectLoad) in /home/hhyyrylainen/Projects/Thrive/src/saving/serializers/ThriveJsonConverter.cs:line 432
   at InProgressObjectDeserialization.CreateInstance() in /home/hhyyrylainen/Projects/Thrive/src/saving/serializers/InProgressObjectDeserialization.cs:line 389

Meaning that the game was able to read the save file but the data structure ends up it trying to do an invalid data assignment after loading one part of the save.

Loading the provided save file works for me without any errors. Could you verify that that is the save file that doesn't work for you?

Edit: alternatively if there exists a JSON debug log file in the game logs folder, you could provide that as it has quite good information for me to investigate further.

from thrive.

Teashrock avatar Teashrock commented on June 7, 2024

@hhyyrylainen
Like I said, this bug happens suddenly after the save was loaded successfully multiple times. Since some point, it just fails to load the save. Restarting the game is what helps, making it load the save successfully (again).
The save itself is valid. It's just a bug in the loading mechanism or whatever else, I may be mistaken.

from thrive.

hhyyrylainen avatar hhyyrylainen commented on June 7, 2024

I see. I've tried loading the save multiple times but I didn't see any problems. The one thing that could theoretically cause this is that the save file read closes early leaving part of the data unread, but I would suspect more that that would fail with JSON parse error. I can try double checking save file reading to make sure it should read the entire file. Have you seen a similar error in the museum page? That has exact same file loading code as the saving system.

from thrive.

Teashrock avatar Teashrock commented on June 7, 2024

@hhyyrylainen

I've tried loading the save multiple times but I didn't see any problems.

I don't think it's easy to reproduce, as it happens occasionally. I don't even know the frequency of the bug, as it's the first time ever me encountering it. All I can assume is me trying to load the save too quickly after it was loaded.

Have you seen a similar error in the museum page? That has exact same file loading code as the saving system.

No. How can I check for it?

from thrive.

hhyyrylainen avatar hhyyrylainen commented on June 7, 2024

Open the thriveopedia and go to the museum page. Things work correctly if you see cells there (of course you need to have fossilized some for them to appear at all) and can click on one to see the properties:

2024-04-28_13 57 42 6764

from thrive.

Teashrock avatar Teashrock commented on June 7, 2024

@hhyyrylainen
I checked, it loads normally. I think I should do it multiple times to do it. OR may be, it some in-game thing. Like I said, I can assume is me trying to load the save too quickly after it was loaded.

from thrive.

Teashrock avatar Teashrock commented on June 7, 2024

Just happened again. Here's the log: https://pastebin.com/WT4BxMW8
It seems it's not too difficult to reproduce. I think I understand what can be causing this: I mistakenly confirmed the cell in the editor without any changes, so the game continued. I opened the menu immediately when the game loaded, then deleted the autosave and loaded the editor one. And the crash happened!

It seems the bug has some relation to the time that passes after a non-editor save is loaded. Maybe some background process doesn't manage to initialize something or free some data before I pause the game and load anything?

UPD: Save file here: https://www.mediafire.com/file/xomxym90ust04v2/auto_save_1%25282%2529.thrivesave/file

UPD: Strange, this time the save loaded normally after just exiting to main menu. No restart was needed.

from thrive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.