Large Scenes

Overview

Large scenes contain dozens, hundreds, or even thousands of pre-placed networked nodes (doors, elevators, pickups) — each with its own FusionReplicator — as opposed to simple scenes where a single replicator handles all replication.

These scene objects use deterministic IDs derived from node names and do not require a FusionSpawner.
Any FusionReplicator not bound by a FusionSpawner is treated as a scene object when notify_scene_ready() scans the tree.

Scene Loading Modes

  • Auto (SCENE_LOAD_AUTO) — FusionClient loads the scene, parents it and registers scene objects internally
  • Custom (SCENE_LOAD_CUSTOM) — FusionClient emits scene_load_requested; you load the scene and call notify_scene_ready()

Setup (Auto Mode)

GDScript

const ArenaScene = preload("res://maps/arena.tscn")

func _ready():
    FusionClient.set_scene_load_mode(FusionClient.SCENE_LOAD_AUTO)
    FusionClient.set_scene_parent(self)
    FusionClient.scene_ready.connect(func(idx): print("Scene objects synced: ", idx))

func start_game():
    FusionClient.load_scene(ArenaScene)  # master client only

Setup (Custom Mode)

GDScript

func _ready():
    FusionClient.set_scene_load_mode(FusionClient.SCENE_LOAD_CUSTOM)
    FusionClient.scene_load_requested.connect(_on_load)

func _on_load(index: int, scene: PackedScene):
    var instance = scene.instantiate()
    add_child(instance)
    FusionClient.notify_scene_ready(instance, index)

Scene Structure

MapRoot (Node2D)
+-- Door (Node2D)
|   +-- FusionReplicator
+-- Elevator (Node2D)
|   +-- FusionReplicator

Add a FusionReplicator to nodes that need syncing and configure custom properties via the bottom panel.

Node names must be unique within the scene.
Deterministic IDs are derived from node name hashes — duplicates cause collisions.

Late-joining clients automatically receive current state from the server cache.

Back to top