GodotClientServer icon indicating copy to clipboard operation
GodotClientServer copied to clipboard

Error when lauching game

Open RamsaySummer opened this issue 5 years ago • 5 comments

When I try to 'Start game' on client, I can't use the diffferent up down left movement and the server says:

MYNamePLAYER on_register_player: 87419819 Creating player in lobby Total players: 1 ERROR: Node not found: Game. At: scene/main/node.cpp:1381 ERROR: _process_get_node: Failed to get path from RPC: Game. At: core/io/multiplayer_api.cpp:256 ERROR: Invalid packet received. Requested node was not found. At: core/io/multiplayer_api.cpp:204 Entering game Creating player game object ERROR: Signal 'remove_player' is already connected to given method 'remove_player' in that object. At: core/object.cpp:1464

I am on W10 and i export the server project on the server folder '.exe and pck' and the client exe on client folder.

Is this a bad export of me ?

RamsaySummer avatar Jul 17 '20 15:07 RamsaySummer

Does the game crash or malfunction in some way? Or is it just printing these errors?

Wavesonics avatar Jul 17 '20 16:07 Wavesonics

I am having the same issue. The windows server export does seems to malfunction - it will not take input from the clients. Of note, the server seems to hit this error while attempting to change the scene to ServerGame. I am attempting to export this via Godot 3.2.2 stable.

If there's any additional info I can help provide, let me know. I'm just getting my feet under me with Godot but hopefully I can be of help

edit: I've tried 3.2.3 as well but no luck

Drazuam avatar Sep 24 '20 00:09 Drazuam

Some more information - Server seems to work correctly when run as a scene directly from Godot, but not in the exported .exe

Interesting... I wonder if we're messing up the export somehow? I didn't change any of the settings.

Drazuam avatar Sep 24 '20 04:09 Drazuam

I figured it out! Line 31 of Game.gd may end up firing on the client before the server has loaded the ServerGame scene! In cases where this happens, the scene is unavailable and therefore is unable to be referenced by the client's RPC. I figured this out by placing a 500ms sleep before the RPC call, and it works fine. In theory, you could either preload the ServerGame node or send a signal to clients that the Game node is available, and only after that would they attempt RPCs

Drazuam avatar Sep 24 '20 22:09 Drazuam

Ah good catch! I never encountered this in my own project because there is a count down in the lobby when the game starts, and the server goes before the count down starts.

Wavesonics avatar Oct 02 '20 03:10 Wavesonics