godotengine / godotengine/godot
MultiplayerSynchronizer throws error when synchronizing Node changes on first peer connection
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Reproducible in v4.3.stable.arch_linux
### System information
Godot v4.3.stable unknown - Arch Linux #1 SMP PREEMPT_DYNAMIC Sat, 05 Oct 2024 17:53:31 +0000 - Wayland - GLES3 (Compatibility) - AMD Radeon RX 7600 (radeonsi, navi33, LLVM 18.1.8, DRM 3.54, 6.6.54-1-lts) - 13th Gen Intel(R) Core(TM) i9-13900T (32 Threads)
### Issue description
The `MultiplayerSynchronizer` throws an error on the third peer that it can't find the second peer's Player Node and the same for any subsequent peers except the host.
The synchronization doesn't work for those nodes then.
I don't understand why it throws that error. My expectation is that it shouldn't and synchronize properly.
```
E 0:00:02:0346 get_node: Node not found: "Network/Players/1994578314/MultiplayerSynchronizer" (relative to "/root").
Method/function failed. Returning: nullptr
scene/main/node.cpp:1792 @ get_node()
```
```
E 0:00:02:0346 process_simplify_path: Parameter "node" is null.
modules/multiplayer/scene_cache_interface.cpp:118 @ process_simplify_path()
```

### Steps to reproduce
Run the project.
Click `Host` in one window and `Join` in the others.
Observe the error and check the `score` value for each Player in the `Remote` SceneTree tab.
In all Sessions every Player Node should have their score set to 1, but it isn't.
### Minimal reproduction project (MRP)
[bug-multiplayersynchronizer-playerstate.zip](https://github.com/user-attachments/files/17326390/bug-multiplayersynchronizer-playerstate.zip)
Contributor guide
Research direction
Start by running the linked minimal reproduction project with one host and multiple joining peers, then inspect the reported paths in modules/multiplayer/scene_cache_interface.cpp and scene/main/node.cpp. Confirm which peer's MultiplayerSynchronizer lookup fails and compare the Remote SceneTree score values. Done means all Player Nodes synchronize their score correctly without the reported errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100