Skip to content

Multiple MultiplayerSynchronizer's under MultiplayerSpawner with different public_visibility states prints error #68508

@DragonAxe

Description

@DragonAxe

Godot version

v4.0.beta.custom_build [f814e15] (built after alpha 4)

System information

Linux 5.15.76-1-MANJARO x86_64 GNU/Linux --- Vulkan API 1.2.0 - Using Vulkan Device #1: Intel - Intel(R) UHD Graphics 620 (KBL GT2)

Issue description

I am setting up an authoritative server/client real-time strategy game using MultiplayerSpawner and MultiplayerSynchronizer. My player scene has several properties that need synchronized to the clients. My player scene also has a 'module' system for easily bolting on functionality to a player. These player modules also have several properties that need synchronized with clients. My first thought was to add a MultiplayerSynchronizer to the player module, so I wouldn't have to pass a reference to the player's synchronizer into the module. That's when I came across these errors.

With a player structure as shown in the images below.
image
image
image

These errors are printed to Godot's console after a client connects:

E 0:00:00:0483   get_node: Node not found: "World/MultiplayerSpawner/Player/Nested/PublicVisibilityOn" (relative to "/root/Main/Client").
  <C++ Error>    Method/function failed. Returning: nullptr
  <C++ Source>   scene/main/node.cpp:1360 @ get_node()

E 0:00:00:0483   process_simplify_path: Condition "node == nullptr" is true.
  <C++ Source>   modules/multiplayer/scene_cache_interface.cpp:77 @ process_simplify_path()

Also, when swapping out the "Nested" node with a "Gun" node containing a MultiplayerSpawner which spawns bullets containing a MultiplayerSynchronizer, I get the errors below.

image
image

E 0:00:00:0450   get_node: Node not found: "World/MultiplayerSpawner/Player/Gun/BulletSpawner" (relative to "/root/Main/Client").
  <C++ Error>    Method/function failed. Returning: nullptr
  <C++ Source>   scene/main/node.cpp:1360 @ get_node()

E 0:00:00:0450   process_simplify_path: Condition "node == nullptr" is true.
  <C++ Source>   modules/multiplayer/scene_cache_interface.cpp:77 @ process_simplify_path()

E 0:00:00:0450   get_cached_object: ID 1 not found in cache of peer 1.
  <C++ Error>    Condition "!F" is true. Returning: nullptr
  <C++ Source>   modules/multiplayer/scene_cache_interface.cpp:249 @ get_cached_object()

E 0:00:00:0450   on_spawn_receive: Condition "!spawner" is true. Returning: ERR_DOES_NOT_EXIST
  <C++ Source>   modules/multiplayer/scene_replication_interface.cpp:484 @ on_spawn_receive()

I get the feeling that I am using MultiplayerSpawner and MultiplayerSynchronizer incorrectly. That I should not nest MultiplayerSpawners and not have more than one MultiplayerSynchronizer in a spawned scene.

Perhaps the error messages could be improved to help users better understand what they are doing wrong? Or add documentation to suggest the intended node structure usage?

Steps to reproduce

See minimal reproduction project for details, but here are screenshots of the final remote node structure after running the attached demos.

Final running scene tree:
image

Final running scene tree with nested bullet spawner:
image

Minimal reproduction project

problem_demo_multiplayer_spawn_sync_gd4.zip

problem_demo_multiplayer_spawn_sync_gd4_bullet_spawner.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions