Intermediate path: a complete online game
You can connect two players and sync movement (beginner path). Now build something shippable: matchmaking, a real gameplay loop, disconnect resilience, and persistence. The 2D arena tutorial is the worked example for most of these steps.
Step 1 — A menu that matches players
- Find match button →
await SpawnWeaver.find_match("your-mode")with a Searching… state and a Cancel button (cancel_matchmaking()) (matchmaking guide) - Keep the friend path: create/join by code
- Optional: public lobbies with
create_room({"visibility": "public"})+list_rooms()(rooms guide)
Checkpoint: two instances both press Find match and land in the same room.
Step 2 — A gameplay loop
- Pick your loop (shoot/tag/collect/race). Route each piece of shared data through the right channel: transient → events, per-player → entity state, shared/lasting → room state (concepts)
- Implement an authority rule for conflicts (e.g. victim applies its own damage; host owns the scoreboard — see the 2D arena steps 5–6)
- Win condition + rematch (host sets
{"phase": "over", "winner": id}in room state; everyone reacts toroom_state_changed)
Checkpoint: a full round start-to-winner works with two players.
I'm designing the data flow for my SpawnWeaver game. Channels available:
send_event (transient, relayed to others), set_entity/patch_entity (per-player owned
state, replicated + snapshot for late joiners), set_room_state (host-only shared
state). My game: <DESCRIBE YOUR LOOP>. For each mechanic, which channel should carry
it, and who should have authority?
Step 3 — Survive real networks
- Show
player_disconnected/player_reconnectedin your UI (grey the avatar out) - Test it: play a round, then call
SpawnWeaver.simulate_connection_loss()on one side — verify it resumes into the same room with state intact - Handle
room_left("expired")and matchmaking timeouts with friendly messages
Checkpoint: killing one player's connection mid-round self-heals within seconds.
Step 4 — Persistence
- Save the player's name and stats with
storage_set/storage_get(storage guide) - Restart the game and verify identity + saves survive
Checkpoint: wins recorded in one session are visible in the next.
Step 5 — Ship a playtest
- Watch a session end-to-end in the dashboard's Live activity and Sessions while you play (debugging guide)
- Fix everything in the Errors page (each has a suggested fix)
- Export builds and hand them to two friends with your quickstart notes
Checkpoint: two people who aren't you played a round on their own machines.
Next: the advanced path — smoothness, bandwidth, authority hardening, and production deployment.