cntrl/docs/BLACKOUT_RITUAL.md
dandovlatov 1aa33d3743 FBC: NIGHT SHIFT - added the projector-screen blackout ritual
Walk into the Projector Room screen to enter a black room with 20 ringing
red-phone tables. Sweep all phones, then step into the yellow-roofed glass
case to restore the lights and claim the FLUORESCENT Light Switch skill.

- Blender: phone_table, case_frame and case_glass GLBs + reproducible
  build_blackout_props.py, concept lineup and source .blend
- Sim: BlackoutSequence state machine, Game ownership, spawn freeze during
  the pocket, FLUORESCENT active skill with unlock flag and buff effect
- Render: uAlpha glass blending, three ActorModels, blackout camera/pass,
  event VFX, HUD progress card and third skill stamp
- Dev flags: --blackout-test, --blackout-auto, --blackout-reveal
- Tests: headless blackout chain/claim test (8/8 CTest pass)
- Docs: BLACKOUT_RITUAL.md plus design/roadmap/art/README updates
2026-11-24 23:33:46 +04:00

123 lines
6.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# FBC: NIGHT SHIFT — The Blackout Ritual (Projector Screen)
**Status:** implemented (2026-11-24).
**Scope:** a self-contained pocket ritual inside the Projector Room, using the
big projector screen as a threshold. New Blender props, a blackout presentation
mode, a proximity puzzle, and the Light Switch OoP reward.
---
## 1. Design intent
The Projector Room already holds the 20 s briefing-reel ritual, but the
**projection screen itself had no collision and no purpose** — you could walk
straight through it. It is now the threshold for the game's strangest Object
of Power encounter:
> You step into the screen. The fluorescents die. The room is gone. You stand
> in black space in front of twenty little desks, each carrying a red Hotline
> phone, all ringing. Walk over every phone. When the last one goes quiet, a
> glass case with a yellow Board roof appears at the screen. Step inside it and
> the lights come back — and the Light Switch is yours for the run.
Design pillars it respects:
- **No pause screens.** The corruption clock keeps running; only the Director's
spawns are suspended and the horde freezes outside the pocket. You can still
move and Evade.
- **Mega Man reward.** Completing the ritual grants a permanent OoP (an active
skill) for the rest of the run.
- **Readable in one glance.** Unanswered phones glow red; answered ones go
dark. The HUD shows `PHONES ANSWERED n / 20` and one dot per phone.
## 2. Experience flow
| Phase | Player sees | Player does | HUD |
|---|---|---|---|
| `Idle` | Normal Projector Room; the screen is just set dressing | Walk into the screen footprint (≈18 × 6 m) | `OoP DETECTED` banner: `BLACKOUT — ANSWER ALL 20 PHONES` |
| `Active` | Black room, the agent, 20 glowing phone tables in a 5 × 4 grid | Walk over each of the 20 phones (order irrelevant) | `BLACKOUT — THE HOUSE IS RINGING`, progress dots |
| `CaseRevealed` | Same dark room; a glass case with a yellow roof appears at the screen, switch inside | Walk into the case | `LIGHT SWITCH UNGUARDED — ENTER THE CASE` |
| `Complete` | Lights snap back, normal room and horde return | Continue the run | `BLACKOUT CLEARED — FLUORESCENT LIGHT CLAIMED` |
Edge cases:
- Claimed once per run. A floor jump (`blackout.reset()`) makes it claimable
again on L2+; the FLUORESCENT skill unlock persists for the run.
- Entering the screen replaces any other in-progress ritual (one ritual at a
time). Ritual HUD prompts are suppressed while in the pocket.
- Death during blackout ends the run normally.
- Re-entering the screen after completion does nothing.
## 3. Puzzle rules
- **20 phones**, fixed 5 × 4 grid (7 × 9 m spacing) in front of the screen,
derived from the authored `PropKind::Screen` position in `floor01.json` — no
new level data, no extra anchors, deterministic per floor.
- Proximity only (radius 2.2 m), no interact key: the whole game is played by
moving. A short 0.3 s debounce prevents one standing spot answering twice.
- **No order and no wrong answers.** Any unanswered phone can be answered; the
grid simply drains from 20 to 0. This keeps the encounter a *sweep* rather
than a memory test, which suits a move-only auto-brawler.
- The last phone reveals the case at the screen mouth. Entering it (2.6 m)
completes the ritual: the scene goes back to the normal room and the reward
is granted on that transition.
- Reward: **FLUORESCENT**, a third active skill (`U`, gamepad face-left). It
floods a 6 m radius with fluorescent light: enemies in range get
`damage_taken_mult ×1.25` for 10 s, plus a bright flash. Cooldown 14 s. It
joins the same `SkillSystem` manual/autoplay path as CONCRETE CALL and WARP,
and its HUD stamp only appears once earned.
## 4. Presentation
- `Game::blackout.active()` clears the 3D target to near-black in `main.cpp`.
- `Presenter::draw_scene` branches into `draw_blackout()` before any normal
environment pass: dim floor slab, the 20 phone tables (unanswered ones with
a red ground ring, billboard glow and a pulsing hit-flash), the agent, and
the glass case once revealed. Enemies, XP shards, props and post-decay are
not drawn.
- A dedicated overhead camera (`height 44`, focus on the grid) frames all 20
desks and the player at once; the normal tactical framing resumes on exit.
- Events `BlackoutStart/Phone/Case/Complete` drive sparks and containment
waves; post FX and the containment clock stay visible throughout.
- HUD: a centred yellow-bordered progress card; the objective panel keeps
showing the floor goal so the clock's pressure remains legible.
## 5. Blender assets (`tools/blender/build_blackout_props.py`)
| GLB | Contents | Tris | Rendering in game |
|---|---|---|---|
| `phone_table.glb` | Desk, drawer, red handset, rotary dial, hot indicator, cord | 746 | opaque actor shader, pulsing flash + red glow |
| `case_frame.glb` | Plinth, brass trim, four posts, **yellow Board roof**, roof seal | 176 | opaque actor shader, 1.5× scale |
| `case_glass.glb` | Four translucent panes | 64 | actor shader with new `uAlpha` uniform (0.30) and depth-mask-free alpha blending |
Conventions: one merged mesh per GLB, painted `Color` vertex attribute, origin
at feet, facing +Z in engine (-Y in Blender), exports via `actor_kit.export_actor`.
The existing `switch.glb` is drawn inside the case (2.2× scale).
Concept: `docs/concept/blackout_props_lineup.png`.
Source scene: `assets/blender/fbc_blackout_props.blend`.
## 6. Implementation map
- **Sim:** `src/game/blackout.{hpp,cpp}` (new), `game.{hpp,cpp}` ownership,
spawn/combat suppression, reward grant, reset on floor jump.
- **Events:** `core/events.hpp` + presenter consumer.
- **Skills:** `SkillType::Fluorescent`, unlock flag, buff application.
- **Models:** three `ActorModel` entries + paths; `uAlpha` in `actor.fs`;
alpha/blend support in `ModelBank::draw`.
- **Presenter:** `blackout_mode` camera + `draw_blackout()` pass.
- **UI:** blackout progress card, third skill stamp, custom completion banner.
- **Input:** `U` / gamepad face-left (autoplay means no key is required).
- **Dev hooks:** `--blackout-test` (start inside the screen),
`--blackout-auto` (answer phones automatically),
`--blackout-reveal` (jump to the glass case for QA).
- **Tests:** `tests/blackout_test.cpp` (CTest `blackout_ritual`).
## 7. Verification gates
- `cmake --build build -j6` clean; `ctest --test-dir build` 8/8 pass.
- `./build/cntrl --blackout-test --screenshot ... --screenshot-at 2` shows the
dark room, all 20 tables and the agent.
- `--blackout-test --blackout-reveal --screenshot ...` shows the yellow-roofed
glass case with the switch inside.
- `--blackout-test --blackout-auto` completes the ritual and restores the
lights; the FLUORESCENT stamp appears on the HUD.
- A normal `--seed 42 --bot` run still reaches the key/door loop unchanged.
- No missing-model fallback warnings for the three new GLBs.