Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiplayerSpawner doesn't work with UIDs #90903

Open
Summersay415 opened this issue Apr 19, 2024 · 5 comments · May be fixed by #91084
Open

MultiplayerSpawner doesn't work with UIDs #90903

Summersay415 opened this issue Apr 19, 2024 · 5 comments · May be fixed by #91084

Comments

@Summersay415
Copy link
Contributor

Tested versions

Reproducible in: 4.3dev5, 4.2.2, latest master [4a01602]

System information

Godot v4.2.2.stable - Ubuntu 23.10 23.10 - X11 - GLES3 (Compatibility) - Mesa Intel(R) Graphics (ADL GT2) () - 12th Gen Intel(R) Core(TM) i5-1235U (12 Threads)

Issue description

MultiplayerSpawner doesn't work if auto spawn path is UID. It prints some errors in console:

E 0:00:08:0516   get_node: Node not found: "World/Players/1/MultiplayerSynchronizer" (relative to "/root").
  <Ошибка C++>   Method/function failed. Returning: nullptr
  <Исходный код C++>scene/main/node.cpp:1651 @ get_node()
E 0:00:08:0516   process_simplify_path: Parameter "node" is null.
  <Исходный код C++>modules/multiplayer/scene_cache_interface.cpp:110 @ process_simplify_path()
E 0:00:08:0516   get_node: Node not found: "World/Players/1/Inputs/InputsSync" (relative to "/root").
  <Ошибка C++>   Method/function failed. Returning: nullptr
  <Исходный код C++>scene/main/node.cpp:1651 @ get_node()
E 0:00:08:0516   process_simplify_path: Parameter "node" is null.
  <Исходный код C++>modules/multiplayer/scene_cache_interface.cpp:110 @ process_simplify_path()
E 0:00:08:0516   get_node: Node not found: "World/Players/168206040/MultiplayerSynchronizer" (relative to "/root").
  <Ошибка C++>   Method/function failed. Returning: nullptr
  <Исходный код C++>scene/main/node.cpp:1651 @ get_node()
E 0:00:08:0516   process_simplify_path: Parameter "node" is null.
  <Исходный код C++>modules/multiplayer/scene_cache_interface.cpp:110 @ process_simplify_path()

Also, after each engine restart UID is erased from Auto Spawn List with error in console:

modules/multiplayer/multiplayer_spawner.cpp:103 - Condition "!FileAccess::exists(p_path)" is true.

Can be worked around with ResourceUID.get_id_path(ResourceUID.text_to_id()), but only if spawnable scenes added in code.

Steps to reproduce

  1. Take multiplayer project with MultiplayerSpawner which uses Auto Spawn List (Multiplayer Bomber in MRP)
  2. Change paths of Auto Spawn List scenes to UIDs
  3. Run game as usual
  4. Request spawn
    Notice no scenes spawned on client, instead errors printed.

Minimal reproduction project (MRP)

bomber.zip

  1. Open world.tscn
  2. in PlayerSpawner add UID of player.tscn
  3. Run the game, create server and connect from client
  4. Start game
  5. Observe result
@AThousandShips
Copy link
Member

File access can't open UIDs like this, that's limited to the resource management system, so this is a limitation in that side of things, unsure how to proceed though

Note that UIDs are not guaranteed to be valid in the other client, as you might be communicating with a different version of the game, including having a separate server build

@Summersay415
Copy link
Contributor Author

This should be documented then?

@AThousandShips
Copy link
Member

AThousandShips commented Apr 19, 2024

Depending on what path we take yes, the team for multiplayer should evaluate if this is a feature we should add, or document that it's not supported

@AThousandShips
Copy link
Member

It seems to be an error in this case, the loading itself uses ResourceLoader so the check should be replaced by ResourceLoader::exists instead, as it works otherwise

@Summersay415 Summersay415 changed the title MultiplayerSpawnable doesn't work with UIDs MultiplayerSpawner doesn't work with UIDs Apr 20, 2024
@OwenAEdwards
Copy link

First time contributor, here's my pull request #91084

@akien-mga akien-mga added this to the 4.3 milestone Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants