---
id: connection-and-sync/006
title: Local play — your home when there is no realm
epic: connection-and-sync
state: ready
priority: 1
blocked_by: ["connection-and-sync/005"]
estimate: L
created: 2026-08-18
updated: 2026-08-19
claimed_by: null
claimed_at: null
delivers: []
review_artifact: null
---

## What to do

- `game/world/local_authority.gd`: the simulation half of `area_server.gd` — grid, ground,
  portals, entities, `_apply_intents`, movement budget, `_area_payload`, `_serialize_state` —
  driven in-process; the one outbound seam `_send_to_peer` becomes `deliver(type, payload)`;
  `area_server.gd` keeps the transport and builds on it.
- Client: `_send_game` / `_poll_game` behind a `GameTransport` (the WebSocket implementation,
  and a `LocalTransport` that calls the authority synchronously); `_handle_game_message`
  unchanged; `_ready()`'s "no session = fail" gate gains an explicit `LOCAL` mode.
- Behaviour: at Start with the director OFFLINE (or "Play offline"), the home (`either`) loads
  locally from `user://areas/home.json` (written from the last online `hello_ack`; else the
  default 16×16 grass home). Walking works; doors to `multiplayer` Areas bump `OFFLINE`; an
  "Offline — your home only" banner. When the realm returns, "Go online" re-enters the
  *server's* home; the local walk-only state is discarded (decision, 2026-08-18).
  `single_player` Areas use the same machinery once one is authored.

## Definition of done

The local authority passes the server's movement / portal / budget checks in `test_runner.gd`;
a headless client run with `--offline` reaches a home with no director and its door bumps; the
web and Android builds start offline in airplane mode.

## Where the work lands

`land-of-lor/game/world/`.