Error when trying to load save

After I died and tried to savescum with an autosave, I got this error message

I have also found that if you try to load the same save right after you die, the game will freeze in the loading screen (if this error message does not show up)

If I try to load an earlier autosave (saved in the editor) it loads without issues

EDIT: Looks like even that is not completely working. If I load that earlier save that I made in the editor and make any addition to the cell, the game freezes as soon as you leave the editor

There’s an open issue about that error:

Could you provide this save? Reproducible issues are the most likely to be fixed.

Where should I upload the file?

Any file hosting site you usually use is fine.

Done

I also just experienced another error with a different save, happened when I loaded the save, moved patches and left the editor

Error

Second save

This is the relevant part of the error:

System.NullReferenceException: Object reference not set to an instance of an object 
at NodeHelpers.DestroyDetachAndQueueFree (IEntity entity) [0x00000] in <5208d8567ee64dd29346dd4ccb964802>:0 
at Microbe.ClearEngulfedObjects () [0x00049] in <5208d8567ee64dd29346dd4ccb964802>:0 
at MicrobeStage.UpdatePatchSettings (System.Boolean promptPatchNameChange) [0x00040] in <5208d8567ee64dd29346dd4ccb964802>:0 
at MicrobeStage.SetupStage () [0x00098] in <5208d8567ee64dd29346dd4ccb964802>:0 
at MicrobeStage._Ready () [0x00065] in <5208d8567ee64dd29346dd4ccb964802>:0 
at (wrapper managed-to-native) Godot.NativeCalls.godot_icall_2_441(intptr,intptr,intptr,bool) 
at Godot.Node.AddChild (Godot.Node node, System.Boolean legibleUniqueName) [0x00011] in <255400c4320c44b8897009d693c12504>:0 at SceneManager.SwitchToScene (Godot.Node newSceneRoot, System.Boolean keepOldRoot) [0x00027] in <5208d8567ee64dd29346dd4ccb964802>:0 
at EditorBase`2[TAction,TStage].OnEditorExitTransitionFinished () [0x00092] in <5208d8567ee64dd29346dd4ccb964802>:0 
at TransitionManager+Sequence.StartNext () [0x00094] in <5208d8567ee64dd29346dd4ccb964802>:0 
at TransitionManager+Sequence.Process () [0x00087] in <5208d8567ee64dd29346dd4ccb964802>:0 
at TransitionManager._Process (System.Single delta) [0x00019] in <5208d8567ee64dd29346dd4ccb964802>:0 Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object 
at NodeHelpers.DestroyDetachAndQueueFree (IEntity entity) [0x00000] in <5208d8567ee64dd29346dd4ccb964802>:0 
at Microbe.ClearEngulfedObjects () [0x00049] in <5208d8567ee64dd29346dd4ccb964802>:0 
at MicrobeStage.UpdatePatchSettings (System.Boolean promptPatchNameChange) [0x00040] in <5208d8567ee64dd29346dd4ccb964802>:0 
at MicrobeStage.SetupStage () [0x00098] in <5208d8567ee64dd29346dd4ccb964802>:0 
at MicrobeStage._Ready () [0x00065] in <5208d8567ee64dd29346dd4ccb964802>:0 at (wrapper managed-to-native) Godot.NativeCalls.godot_icall_2_441(intptr,intptr,intptr,bool) 
at Godot.Node.AddChild (Godot.Node node, System.Boolean legibleUniqueName) [0x00011] in <255400c4320c44b8897009d693c12504>:0 
at SceneManager.SwitchToScene (Godot.Node newSceneRoot, System.Boolean keepOldRoot) [0x00027] in <5208d8567ee64dd29346dd4ccb964802>:0 
at EditorBase`2[TAction,TStage].OnEditorExitTransitionFinished () [0x00092] in <5208d8567ee64dd29346dd4ccb964802>:0 
at TransitionManager+Sequence.StartNext () [0x00094] in <5208d8567ee64dd29346dd4ccb964802>:0 
at TransitionManager+Sequence.Process () [0x00087] in <5208d8567ee64dd29346dd4ccb964802>:0 
at TransitionManager._Process (System.Single delta) [0x00019] in <5208d8567ee64dd29346dd4ccb964802>:0

Seems like a null got into the list of engulfed things. @KasterisK do you think that problem is solved or should I open a separate issue for that?

No pull requests or fixes has been made relating to that as far as I know, you could open an issue. What’s weird to me is that even with EntityReference it still errors out.

Well it’s a null reference exception. I think it seems like something in the engulfed variable or underneath it is null. Loading a save doesn’t enforce nullability so even though the list items are not nullable (and their fields aren’t either), it’s plausible that one of them is null.

Opened an issue:

I tested this save by placing a cytoplasm and then exiting the editor. Performance is not exactly great but I didn’t get a game freeze:

I also tested a second time, but all I can see is that exiting the editor takes a little bit longer than normally before the stage loads in. I’ll say that you probably got a random physics crash:

Which save did you load? In the first save I sent you, for me it still crashes if I place anything. I think you are using the second save (named abc), in that case you should first move patches and then exit the editor to see the crash

I loaded the chonker save, works just fine for me.

Game log to confirm I loaded the right file (I did not rename anything to Chonker.thrivesave, the file is just as I downloaded it):

Starting load of save: Chonker.thrivesave
Ignoring save property at: MicrobeEditor.patchMapTab.canStillMove
Ignoring save property at: MicrobeEditor.ReturnToStage.Camera.ObjectToFollow.engulfedObjects[0].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[3].attemptingToEngulf[0].NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[3].attemptingToEngulf[1].NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[3].attemptingToEngulf[2].NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[3].attemptingToEngulf[3].NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[3].attemptingToEngulf[4].NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[3].attemptingToEngulf[5].NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[3].attemptingToEngulf[6].NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[3].engulfedObjects[0].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[3].engulfedObjects[1].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[3].engulfedObjects[2].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[3].engulfedObjects[3].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[3].engulfedObjects[4].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[3].engulfedObjects[5].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[3].engulfedObjects[6].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[4].engulfedObjects[0].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[4].engulfedObjects[1].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[16].engulfedObjects[0].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[19].engulfedObjects[0].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[19].engulfedObjects[1].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[22].engulfedObjects[0].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[22].engulfedObjects[1].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[22].engulfedObjects[2].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[24].engulfedObjects[0].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[24].engulfedObjects[1].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[24].engulfedObjects[2].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[35].engulfedObjects[0].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[35].engulfedObjects[1].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[35].engulfedObjects[2].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[35].engulfedObjects[3].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[35].engulfedObjects[4].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[35].engulfedObjects[5].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[35].engulfedObjects[6].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[35].engulfedObjects[7].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[35].engulfedObjects[8].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[35].engulfedObjects[9].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[35].engulfedObjects[10].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[35].engulfedObjects[11].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[35].engulfedObjects[12].Object.engulfedObjects[0].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[35].engulfedObjects[12].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[35].engulfedObjects[13].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[37].engulfedObjects[0].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[37].engulfedObjects[1].Object.NodeGroups
Ignoring save property at: MicrobeEditor.ReturnToStage.DynamicEntities[38].engulfedObjects[0].Object.NodeGroups
Starting microbe editor with: 27 organelles in the microbe
Jukebox now playing from: MicrobeEditor
load finished, success: True message: Load finished elapsed: 00:00:07.2291100
Jukebox: starting track: res://assets/sounds/microbe-editor-theme-4.ogg position: 0
Placing organelle 'cytoplasm' at: 2, -5
MicrobeEditor: applying changes to edited Species
MicrobeEditorReportComponent: applying changes of component
MicrobeEditorPatchMap: applying changes of component
CellEditorComponent: applying changes of component
Edited species name is now Primum thrivium
MicrobeEditor: updated organelles for species: Primum thrivium
Player Microbe spawned
World generation settings: [LAWK: False, Difficulty preset: Custom, Life origin: Vent, Seed: 59047299, MP multiplier: 1, AI mutation multiplier: 2.5, Compound density: 1, Player death population penalty: 1, Glucose decay: 0.8, Osmoregulation multiplier: 1, Free glucose cloud: True, Map type: Procedural, Include Multicellular: True, Easter eggs: True]
Jukebox now playing from: MicrobeStage
Applying patch (Zairutic Coastal) settings
Number of clouds in this patch = 9
Registering new spawner: Name: ammonia density: 0.6
Registering new spawner: Name: glucose density: 0.02199021
Registering new spawner: Name: phosphates density: 0.6
hydrogensulfide spawn density is 0. It won't spawn
oxygen spawn density is 0. It won't spawn
carbondioxide spawn density is 0. It won't spawn
nitrogen spawn density is 0. It won't spawn
sunlight spawn density is 0. It won't spawn
temperature spawn density is 0. It won't spawn
Number of chunks in this patch = 4
Registering new spawner: Name: FLOATING_HAZARD density: 1
Registering new spawner: Name: SMALL_IRON_CHUNK density: 0.8
Registering new spawner: Name: BIG_IRON_CHUNK density: 0.5
Registering new spawner: Name: GOOGLY_EYE_CELL density: 0.001
Number of species in this patch = 14
Registering new spawner: Name: 5 density: 0.03633367
Registering new spawner: Name: 7 density: 0.0350255
Registering new spawner: Name: 14 density: 0.03105483
Registering new spawner: Name: 57 density: 0.02650421
Registering new spawner: Name: 185 density: 0.02607124
Registering new spawner: Name: 153 density: 0.02457878
Registering new spawner: Name: 24 density: 0.02440606
Registering new spawner: Name: 168 density: 0.02360854
Registering new spawner: Name: 12 density: 0.02345644
Registering new spawner: Name: 9 density: 0.02227861
Registering new spawner: Name: 131 density: 0.02054124
Registering new spawner: Name: 88 density: 0.02033398
Registering new spawner: Name: 36 density: 0.01880991
Registering new spawner: Name: 1 density: 0.006931472
Applying patch (Zairutic Coastal) settings
Number of clouds in this patch = 9
hydrogensulfide spawn density is 0. It won't spawn
oxygen spawn density is 0. It won't spawn
carbondioxide spawn density is 0. It won't spawn
nitrogen spawn density is 0. It won't spawn
sunlight spawn density is 0. It won't spawn
temperature spawn density is 0. It won't spawn
Number of chunks in this patch = 4
Number of species in this patch = 14
Jukebox: starting track: res://assets/sounds/microbe-theme-4.ogg position: 0
Jukebox: starting track: res://assets/sounds/soundeffects/microbe-ambience2.ogg position: 0

Hi, I was able to get both saves to crash with a bit of effort on the first and the second one resolved it’s self if you remain at the current patch for an additional evolution.

The first save was a bit tricky, it didn’t crash when I followed the instructions so I started testing each organelle by leaving the editor and reloading the save inbetween. however the autosave on load was taking so long so that I had to disable it (later testing and shows this to be irrelevant) and immediately after that it crashed when I placed Chemo synthesizing Proteins however when I booted it again it didn’t crash so I loaded it a few more times and noticed that it was crashing on the 4th load from there I was able to crash it 3 consecutive times with the same method 4 loads turns into a crash. I also tested with cytochrome, adding nothing at all, even having a break between the loads (e.g. loaded save to cell stage, loaded to editor 4 times, loaded to cell stage 3 times in a row, crash) furthermore I have reproduce it on a different save by creating the same cell powering through evo for a bit saving on the editor and reloading it loading 4 times. the number of loads before could also might related to system specs but I would need another computer to test for that.
(Dropbox - 4th load crash testing.thrivesave - Simplify your life) (First save (chonker) - Pastebin.com)

Compared to the first save the second save was practically begging to crash and it did after I moved to the patch directly above and I exited the editor and it was reproduceable but to be sure I stayed on the same patch for an additional evo however that fixed it and I was able to transfer without it crashing (second save (abc) - Pastebin.com)

If specific steps don’t consistently cause the same issue, then it is a random issue, and I’d very much say that it is a random physics caused crash, whenever a bunch of physics node setup happens it can crash, and that gets more likely the longer the game has been running. Also it seems the physics crash doesn’t occur on Linux so I’m unlikely to get it even if I tried for 30 minutes.

I didn’t question this, but to be nice I ran this with a debugger and found the method where the problem is, commented on Github where the fix for that needs to be done: Engulfed objects clear null reference error when exiting the editor after loading a save · Issue #3599 · Revolutionary-Games/Thrive · GitHub

I did some more testing (something just felt off) and I think the first one might be a combination of a threading/memory issue multiplying a physics/calculation issue.

so after hearing that the physics crash doesnt occur on linux I decided to get a linux VM to test it on, after which I loaded the first save, and after 2 loads it froze (it might have recovered but I didn’t want to wait and see after 5-10 mins). Here I remembered setting the VM to only use 2 of my cores so I checked the proformace tab and saw 2 threads, which got me thinking…

I went back to windows and thrive was set originally to 4 threads, a theory was born, I manually set the number of threads to 2 and it crashed after 2 loads, so I then went to 8 threads and it took 8 loads for it to crash.

That isn’t random, and all I am doing is clicking through to gameplay from a save in the editor once I am in I immediately go to the menu and select load game and click on the same save, and after reapeating this for the number of the threads (set in the profromance tab) it crashes or frezes.
despite that I do think that the physics issue is the main cause, mainly because there seems to be a minimum save file / cell size requirement for the load loop above because simple saves dont seem to have this issue.

So I think each time you load, a thread something is left behind processing in the background and if this takes long enough you could fill all the available threads with redundant calculations so the whole game grinds to a hult.
Or I could be totally wrong.

Also sorry about that second save reiteration I jumped the gun and tried to get more data to help find the bug but I glanced over the github issue link by accident.

The performance metrics menu (at least on Linux) shows the number of C# threads there are, which is the only kind we create. I’m almost certain I haven’t seen that number balloon out of control.

While testing another PR I found an issue that editor entry gets stuck while auto-evo runs with just 1 background thread. I’ve made a PR that removes the mitigation from another bug:

So with that change the game doesn’t anymore always get stuck with one background thread when going to the editor.


So by lowering the thread count I think I was also able to reproduce your problem. And it looks like auto-evo runs that are still processing in the background take up all of the processing threads. So the fix is to make sure auto-evo runs are abandoned more reliably (there’s only a few specific cases that abort them properly). It might be possible to modify the background task executor to get around the problem as well, but that isn’t exactly easy either.


Edit: that PR I linked above is now merged.

Also I made a pretty simple fix to stop an auto-evo run if the microbe stage is exited:

So all problems in this thread should now be taken care of.

1 Like