Offline mode
SpawnWeaver.start_offline() runs a complete local session in-process: no account,
no project key, no network. Use it to prototype your multiplayer architecture before
signing up, run CI without a server, or ship a practice/solo mode on the same code path
as your online game.
await SpawnWeaver.start_offline() # instead of start() — that's the only change
var result := await SpawnWeaver.create_room()
print(result.room.code) # always "LOCAL"
await SpawnWeaver.set_entity(SpawnWeaver.player.id, {"x": 100})
await SpawnWeaver.storage_set("save", {"level": 2})
What works offline
| Feature | Offline behavior |
|---|---|
| Identity | A local player_offline_… id; SpawnWeaver.player works normally |
| Rooms | One local room (code LOCAL); create/join/leave/list/update; you're always host |
| State sync | Full room + entity state with the same signals and null-removes-key patches; entities survive leave/rejoin |
| SpawnSync / PlayerSpawner | Work unchanged (your own avatar spawns and syncs locally) |
| Storage | Persisted to user://spawnweaver/offline_storage.cfg across runs |
| Events / RPC | Accepted, delivered to nobody — you're the only player |
| Matchmaking, leaderboards | Return the error code "offline" immediately (never hang) |
stop() ends the offline session; a later start() goes online normally — game code
that awaits results and listens to signals doesn't change between the two.
Common uses
- Try before signing up: build your whole room/state/storage flow first; swap
start_offline()→start()when you get a key. - CI: the SDK's own
tests/headless_offline.tscnruns green with no server — yours can too. - Practice mode: run the exact multiplayer scene solo, no branching game code.