Each player sees a local picture. A server keeps the shared state. Move a character, add delay, then break a connection to see how those pictures come apart and meet again.
Published
Simplified teaching simulation. Everything runs in this browser. Delay, positions and the closed gate are illustrative choices, not measurements or an exact replay of Somewhere Together.
Make it work.
Still mode
One starting world
Player A’s view
Connected
A knows the accepted positions.
Shared server state
Revision 0 · accepted positions
The move has not reached authority.
Player B’s view
Connected
B waits for the server’s update.
○No message in flight
Ready to moveBoth players have the same starting state. Make a move to see where their views separate.
A’s position
2 · shared
Server’s position for A
2 · accepted
A’s connection
Current state
The useful distinctionResponsive to your input and agreed with everyone else are separate jobs.
Each message leg uses the selected delay. Manual reading time between steps is extra. This model uses a fixed delay, explicit snapshots and one coordinate per player; it omits continuous physics, packet loss, interpolation, authentication and offline input replay.
A waiting-for-server-only design makes every action wait for a round trip. Here A draws a predicted move immediately. That improves the local response, while B still needs an update. Prediction is a temporary estimate of what the server will accept.
02 · Authority
A shared decision keeps the worlds compatible.
The server applies the rule and records an accepted position. Try the closed gate: the local estimate reaches cell 8, but the server stops A at cell 5. This deliberately simple rule creates a visible disagreement. A real game must choose which decisions each system owns.
03 · Correction
The reply can confirm or change your picture.
A snapshot is a description of the shared state at a point in time. When it arrives, A replaces its estimate and B learns where A is. The clear path confirms prediction; the closed gate corrects it. A fuller system can soften visual corrections or replay pending inputs. This model replaces the position directly.
04 · Recovery
Reconnecting is the start of catching up.
A disconnected screen still has a picture, but it can be old. B moves while A is away. Rejoining restores the connection first; A is current only after a new snapshot arrives. Here the client fetches a fresh snapshot without replaying offline moves. Real systems need explicit rules for identity, missed actions, authority and stale messages.
Where Somewhere Together fits
Building Somewhere Together made these distinctions useful to me. Its source uses Three.js for 3D rendering, Rapier for physics and Cloudflare Durable Objects for room authority. This teaching model runs locally with simple grid positions. It does not execute those engines, reproduce the game’s protocol or measure its performance.
The responsibilities differ: Three.js draws the world; Rapier simulates physics. Cloudflare’s Durable Objects WebSocket example shows how one object can coordinate connected clients. Those tools still need game-specific rules for accepting movement and recovering state.