Skip to content

MultiplayerSpawner hangs main thread when loading a large scene #102325

Open
@aldemoth

Description

@aldemoth

Tested versions

4.3 stable and all previous versions

System information

Windows 11 Home 23H2 - Vulkan (Forward+) - NVIDIA GeForce GTX 1650 - AMD Ryzen 7 4800H with Radeon Graphics (16 Threads)

Issue description

Scene replication blog post suggests spawning levels with MultiplayerSpawner, but spawning a large level hangs main thread if scene is not cached. MultiplayerSpawner uses ResourceLoader.load() instead of ResourceLoader.load_threaded_request(), so there is no way to show a loading screen in current situation.

Steps to reproduce

  • Spawn a large level in host.
  • Connect to host in another instance. Godot will stop responding until all MultiplayerSpawners load and spawn everything.

In MRP I used a 4 mb tscn file to simulate slow loading, I cannot use large assets because of 10 mb limit. It causes 1-2 secs of hang on my machine.

Minimal reproduction project (MRP)

multiplayerspawner-test.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