TURNCRAFT/docs/briefs/SIDEB.md
type-two 758e9dc4d3 SIDE B briefs + contracts: crate worlds, per-world quests, stamps
Contract: src/core/worlds.ts (three pocket worlds above the booth walls,
portal/entry/exit anchors, stamp count) + additive world/stamp bus events.
Briefs: SIDEB overview + WORLDS / MACHINES / SOCIAL(ambience) / AUDIO lanes,
rescoped around the already-shipped SOCIAL_RESET (emotes, reset ritual,
avatars) and first-five-minutes (heartbeat, beacons, flythrough) phases.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-16 14:55:12 +10:00

2.8 KiB

SIDE B — the crate worlds (phase overview)

The booth is fixed and living. Now the crate opens. Three records in the under-table crate are pressed with whole scenes — dive in, do the thing the sound asks, press your stamp, come home. Plus dust bunnies and the golden finish for collecting all three.

Already shipped — do NOT rebuild (and read before touching anything adjacent): emotes (Z/X/C/V), avatar looks, the server-authoritative reset ritual + cooldown, and the Tab roster are the SOCIAL_RESET phase (docs/briefs/SOCIAL_RESET.md, commit 05c2765, src/net/avatarLook.ts, 'player:emote'/'quest:reset' events); the heartbeat, quest spark beacons, first-visit flythrough, and 'block:mining' juice are the first-five-minutes pass (commit caac3da). SIDE B must coexist with all of it.

Read first: docs/CONTRACTS.md, docs/DESIGN.md, docs/INTEGRATION_NOTES.md, and the new contract src/core/worlds.ts (world keys, pocket bounds, portal/entry/exit anchors, emote vocab — FIXED, do not edit). Bus additions are already in src/core/events.ts.

The four lanes (disjoint ownership — see your own brief)

Lane Brief Owns
W — worlds SIDEB_WORLDS.md src/worldgen/worlds/**, small additive hooks in buildBooth.ts
M — machines SIDEB_MACHINES.md src/machines/**, src/interact/**, src/net/NetClient.ts, server/relay.mjs
S — ambience SIDEB_SOCIAL.md src/fx/**, src/ui/** (NOT Avatars.ts — SOCIAL_RESET owns avatars now)
E2 — audio SIDEB_AUDIO.md src/audio/**

Merge points (integrator wires them; keep your edits additive and tiny): src/main.ts. Nobody edits src/core/** (contract), another lane's dirs, or the atlas/renderer. No new block ids — id 31 stays reserved; palette from existing 31 blocks + atlas-v2 paint variants.

Shared design laws

  1. Sound first. Every quest readable by ear; visuals confirm.
  2. Places, not points. Pockets are rooms with a mood, not obstacle courses.
  3. Nothing hard-fails. Quests are retryable; leaving mid-quest is fine.
  4. Multiplayer semantics: pockets are solo dives — your avatar simply moves there (pockets are inside the same voxel world, so peers technically could follow; that's fine — treat co-visits as a bonus, not a design dependency). Only STAMPS sync (global, like repairs).
  5. Zero binary assets. Procedural canvas/synth only, as ever.
  6. Determinism, budgets: booth build < 900 ms, chunk meshes < 700, 100+ fps.

Verification bar (every lane)

npm run typecheck clean; your demo page (or the real game via window.TURNCRAFT) exercised live with zero console errors; a handoff doc docs/SIDEB_<lane>_handoff.md listing files touched, events emitted/consumed, and anything the integrator must wire. Do not commit — shared tree; the integrator commits.