GD-Sync / GD-Sync-Demo-Project

BSD 2-Clause "Simplified" License
3 stars 3 forks source link

Second player disconnects when game launches.. #2

Open Brandt-J opened 2 months ago

Brandt-J commented 2 months ago

Hi, I was trying to get the demo running. Testing with Godot 4.2.1, just cloned this commit (https://github.com/GD-Sync/GD-Sync-Demo-Project/commit/a5aa7471a844219fe5ac6b95db55a8bed9077be8) and only entered my API keys.

I am connecting two players (making Godot to launch two instances of the project) and am creating a lobby with Player1, where Player2 then connects. image

When I then launch the game, I can see both players in the window of Player1, but only for a short time: image Player2 then disconnects and returns back to the main menu screen of the demo (with the "connect" and "quit" buttons)

There are a few error messages in the debugger: Player 1: image

Player2: image

Any ideas/hints?

ThomasUijlen commented 2 months ago

Hi there!

I have a suspicion on what might be causing this. It is an issue we discovered relatively recently. Just to confirm: Are the players staying connected when in the lobby? Do they only disconnect during scene transition when pressing start?

Brandt-J commented 2 months ago

Hey, yes, I just stayed in the lobby for a few minutes with both players, but this seems to work as expected. The disconnect only happens when I launch the actual game.

ThomasUijlen commented 2 months ago

I suspect it is a timeout issue. The second client is probably loading for longer than 5 seconds, which causes the connection to timeout.

During scene transition/loading the game completely freezes, preventing the plugin from polling the connection. We are still figuring out a good solution for this issue. Either the plugin has to be reworked so that it somehow keeps polling while the game is frozen or the demo project has to be reworked to reestablish the connection in case it drops.