# Spec: z-planes (the tower) ``` Status: READY Status note: B2's structural spine. Written now so the Space interface's recursive shape is decided before anyone builds against the flat one. Stage: B2 — The Tower Constitution: "The shape of Misaligned" (z-planes as act structure), "Self-similar scale" (Space interface), "Act One" (stairwell/elevator as the act boundary), design principle "composable authored spaces" Depends on: basement-map.md, schedules.md ``` ## Behavior The world becomes a stack of **planes**, each a `Layout` (prefab.rs) with its own tiles, power grid, sensors, and fog: ```rust pub struct Plane { pub z: i32, // basement = 0, lab floor = 1, ... pub name: String, // "Basement", "Floor 1 — Wet Labs" pub map: GameMap, pub sensors: Vec, // fog, power: per-plane, computed by the existing systems unchanged } pub struct World { pub planes: Vec } ``` - **Recursion by composition:** `Layout` gains the ability to place other `Layout`s (a floor is a Layout of room-prefabs; a building is a stack of floor-Layouts). Same stamping system; a nested placement stamps its child's tiles (self-similar Space). - **Transitions** are paired tiles (stairwell/elevator) linking `(plane, x, y) <-> (plane', x', y')`. Humans traverse them per schedule (schedules gain a plane column); the player's *presence* extends to a plane when they control any sensor or machine on it — the process does not "walk upstairs", it spreads. - **Act gating stays diegetic:** the basement's T3 doors and badge tables gate transitions exactly like any door (access sets), so "unlocking Act Two" is the existing badge-controller beat, not a script flag. - **Per-plane systems, shared laws:** detection observers live on planes (an observer notices only its plane's signatures unless aggregate); power does not cross planes except via authored risers (a fixed object); each plane's fog is the union of controlled sensors there. - **First content:** "Floor 1 — Wet Labs" authored from existing + [TUNE] new prefabs, with 3-5 new named persons instantiated from the same `Person` template, schedules spanning both planes (Dana appears on both — continuity of cast is the point). - Save: world serializes as repeated per-plane blocks of the existing format; v4 saves load as a one-plane world (migration). ## Player surface A plane switcher (terminal: `<`/`>` keys; Bevy: PageUp/Down) showing plane name and your footprint there ("Floor 1 — 1 sensor, 0 machines"). The sidebar's counts become per-plane with a world total. Transitions render as the existing stairwell/elevator tiles with a "leads to Floor 1" inspect line (legibility). ## Acceptance criteria 1. `World`/`Plane` exist; the basement is plane 0 of a world; all B1 tests keep passing against the one-plane world (substrate unbroken). 2. Nested `Layout` placement works: a two-floor toy building built by composing floor-Layouts stamps correctly (test). 3. A second authored plane loads with its own fog, power, sensors, and at least 3 template-instantiated persons whose schedules span planes. 4. Transitions gate on access sets via the existing door system; a human without T3 never crosses; the badge-controller beat opens it for assets/player-directed movement. 5. Observers notice only same-plane signatures (aggregates unchanged); test: a Physical signature on Floor 1 never moves a basement-only observer. 6. Save/load round-trips a two-plane world; a v4 save loads as plane 0.