Colyseus rooms
Multiplayer state is owned by a Colyseus room on the server. The template ships four
(packages/editor/template/server/rooms/), registered in server/rooms.ts.
The shipped rooms
Section titled “The shipped rooms”| Room | Purpose | Used by |
|---|---|---|
ArenaRoom | Tag game with phases (lobby → countdown → playing → scoreboard), NPC bots, server-authoritative tag logic | third-person-arena, third-person-arena-game |
TankRoom | Tank arena — server owns tank positions; clients send movement input; @colyseus/schema syncs state | tanks |
NotbloxRoom | Physics playground — server-authoritative player + box physics | notblox |
GameRoom | A worked Schema-synced room (an orb-collecting arena) to start from | — |
Each is a Room<State> using @colyseus/schema for the synced state. The client connects via
the Callbacks API (onAdd / onChange / onRemove).
Adding a room
Section titled “Adding a room”- Create
packages/editor/template/server/rooms/{name}.tswith aRoom<State>class and a@colyseus/schemastate. - Register it in
server/rooms.ts. - On the client, connect and subscribe via the
StateReplication/ Callbacks API; read live schema fields inonChange. - Set
serverRoom: '{name}'on the example’s registry entry.
See also
Section titled “See also”- Networking — the contract + Callbacks API.
- Examples gallery — which examples use which room.