_remove_node_cache error in setting up Multiplayer Game

I have been going through the “Godot 4 Multiplayer: Make Your Own Online Game” tutorial and just finished setting up the multiplayer connection. However, I noticed that I am getting an error in the debugger that the tutor don’t seem to get. I don’t think it impacts the gameplay itself as I only get the error after closing down the windows for the game sessions I run. Here is the code:

E 0:00:09:0044 _remove_node_cache: Condition “!pinfo” is true. Continuing.
<C++ Source> modules/multiplayer/scene_cache_interface.cpp:57 @ _remove_node_cache()

I have failed to find a solution or even a reason to this problem, and would much appreciate any help I can get. I am happy to provide more information as well if requested. Thank you very much in advance!

1 Like

This looks analogous to what’s been happening in Kaan’s course with needing to add call_deferred() to the scene management code. From what I can tell, this error is happening because your game is trying to delete the nodes of a client that has disconnected, but the client is already gone because they hard-disconnected, so there was no opportunity to do the cleanup safely if that makes sense. This would also explain why it doesn’t affect your gameplay and only happens when you shutdown.

What little I could find seems to back this up:
https://www.reddit.com/r/godot/comments/1b1f39e/is_it_possible_to_make_multiplayerspawner_not/

Does the same thing happen if you click the Stop button in the editor window vs. clicking a game window’s X (close) button?

I would imagine that the way you prevent this error from occurring is by using something similar to call_deferred() for the process of disconnecting, but more along the lines of exception handling than waiting for the frame to finish - if the node isn’t there, break. remove_child() might be one piece of the puzzle, as that will isolate the node so that further processing on it can’t affect the rest of the scene tree, but on the other hand, this might be exactly what it’s trying to do and it can’t because the node is already gone.

Basically, I’m not sure I can help much here, but I also think that if there is one error you could live with in a production build, it would be this one. The message indicates a graceful recovery of the C++ code anyway, so don’t let it prevent you from continuing the course.

If you manage to find a solution, or experiment results, or anything else, please update this topic for us =)

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms