Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
Deleted post

Thank you very much, I see an interesting crash report in your logs:

USER ERROR: Condition "slot >= slot_max" is true. Returning: nullptr    at: get_instance (./core/object/object.h:972)

This is 100% the cause of the crash, though I cannot cause it to happen on my PC consistently. Apparently, it has something to do with a known bug in Godot 4.0. I will try to use one of the workarounds I found in the documentation and report back.

Did the crash happen mostly between scene transitions?

(1 edit)

UPDATE: I could reproduce the crashes, if they happen at scene change. Godot crashes without showing any error, the one I thought to be responsible was a red herring, so I assume it must be an unlogged bug.

I might have pinpointed the cause of the error in the cleanup code on scene change. I have updated the build accordingly, see: https://dermondhase.itch.io/8-colors-sentai/devlog/538042/solving-some-underhand...

(1 edit)

Hey there, i am also having the exact same error on logs from people that tried my demo and had random crash when scene transitioning (can't reproduce the crash myself). Using 4.0 too. What was the cause of this error for your case and how did you fix it?

(1 edit) (+1)

Hi, I am replying from my other account. It was a bug solved in Godot 4.2 related to change_scene. If you can't upgrade, the way to fix it is to avoid using the built-in change_scene and instead have a main scene with a parent Node and your current scene as a child. When you change scene, you delete the child normally and then swap it with the newly loaded scene that should replace it. This solved the issue in Godot 4.0 for me!


Please do note that this bug ONLY happens in release versions and NOT in Debug/in-editor versions!

(+1)

Thank you very much! I will try these.

Your game looks cool btw!

(+1)

My pleasure. Let me know if you still have troubles, worst case scenario I can simply show you my code! 

Here's how I set up my project: SceneManager is a singleton that implements the goto_scene method. When the method is called, it emits a signal "switch_scene" which is wired to another goto_scene function in the MasterScene object. The MasterScene then frees the current scene (the only child) and instantiates a new child with the required scene type.

I hope this helps!

Damn that's really helpful. I tried upgrading to 4.2 but got some little issues so i will probably use your method instead. Thanks a ton!

Deleted 1 year ago