NetDeck M2: sub-net graph, link routing, ICE crack, red trace + feedback spike

Implements MVP.md §1-§3 (network half of the vertical slice) on the shared
coordinate space:
- 3-room floorplan (airlock/corridor/server room) with blast door + terminal
- 4 nodes: AIRLK root - JUNC - DOOR_CTRL (on the door tile) / HIVE (3s ICE)
- animated link builds (dotted->solid, 1.5s plain / 3.0s ICE), reachability
  tree from AIRLK; links offline until the build completes
- DOOR_CTRL toggles the blast door; X severs the hovered link (ICE progress
  resets, trace cut short resets safely)
- cracking HIVE spawns a 4s red trace to AIRLK; arrival = feedback spike:
  links drop + 3s OVERHEAT lockout (TEMP bar)
- FRENZY/BLIND daemon slots gated on HIVE link (effects land in M4)
- R instant reset via resetScenario() (also fixes root-online init bug)
- boot straight into the paused encounter
- emulator: --tap "x,y@frame" and repeatable --type "text@frame" for
  headless scenario testing

Verified headlessly: full trace->feedback run, safe sever, all gating
messages, reset; visual dumps inspected. Spec: src/netdeck/MVP.md.
This commit is contained in:
Dejvino
2026-11-14 11:23:37 +01:00
parent 3dcafa25e7
commit 6d2f593bc5
4 changed files with 670 additions and 230 deletions
+75
View File
@@ -0,0 +1,75 @@
To validate the core premise of **NetDeck: Breach & Board**—specifically whether *pausing time to manipulate a network graph while watching an autonomous squad survive a room breach* feels tense, readable, and fun on a 320x240 screen—you only need **one single room-breach encounter**.
Strip out sector maps, upgrades, multiple classes, oxygen systems, and procedural generation. Build a single, self-contained **Vertical Slice Sandbox** with these exact features:
---
### 1. Physical Deck Pane (184x192) — The Combat Arena
* **One Hardcoded 3-Room Floorplan:**
* *Room 1 (Airlock):* Where your squad spawns safely out of enemy line-of-sight.
* *Room 2 (Main Corridor):* Contains 2 low-cover crates and 2 patrolling/stationary security droids.
* *Room 3 (Server Room):* Guarded by 1 heavy droid + 1 automated ceiling turret, housing the objective terminal.
* **2 Identical Marines (No Classes Yet):**
* Represented by simple colored `8x8` or `12x12` sprites with a tiny overhead health bar.
* **Pathfinding:** Simple BFS/A* toward a single player-placed **Priority Beacon** (trackball click on any walkable floor tile).
* **Combat AI:** If an enemy is within range and line-of-sight (simple Bresenham tile raycast), stop and fire periodic hitscan/tracer lines. Standing adjacent to a cover crate cuts incoming hit chance by 50%.
* **2 Enemy Types:**
* *Security Droid:* Basic HP, shoots at marines.
* *Ceiling Turret:* Stationary, high rate of fire, shreds marines in seconds unless hacked or bypassed.
* **1 Interactive Blast Door:** Separates Room 2 and Room 3. Can be toggled open/closed via the network pane to trap droids or buy time.
### 2. Sub-Net Pane (136x192) — The Hacking Graph
* **4 Hardcoded Nodes:**
1. `[AIRLOCK]` (Your starting root node).
2. `[JUNCTION]` (Unprotected bridge node).
3. `[DOOR_CTRL]` (Connected to Junction — toggles the blast door between Rooms 2 and 3).
4. `[HIVE_CORE]` (Connected to Junction — protected by a 3-second ICE lock; controls the droids and turret).
* **Link Routing & Severing:**
* Clicking an adjacent node from an already-compromised node starts building a link (animated dotted line turning solid over 1.5s, or 3.0s if ICE-locked).
* Pressing **`X`** while hovering over a link immediately severs it.
* **Only 2 Exploit Daemons (Keys `1` and `2`):**
* You only need two contrasting verbs to test the tactical loop:
1. **`1: FRENZY` (Offensive Chaos):** Requires an active link to `[HIVE_CORE]`. For 5 seconds, droids and the turret target the closest entity (including each other).
2. **`2: BLIND` (Tactical Utility):** Requires an active link to `[HIVE_CORE]`. For 6 seconds, droids/turret cannot fire, giving your squad time to cross open floor into cover.
* **1 Enemy Counter-Measure (The Red Trace):**
* As soon as your link to `[HIVE_CORE]` finishes cracking, a red pulse spawns at `[HIVE_CORE]` and travels back toward `[AIRLOCK]` over **4 seconds**.
* If it hits `[AIRLOCK]`, your link drops, your deck locks out for 3 seconds ("OVERHEAT"), and a reinforcement droid spawns. Severing the link with `X` before it arrives resets the trace safely.
### 3. Minimal HUD & Flow Control (320x48)
* **`Space` (Tactical Pause):** Freezes the 20 Hz simulation tick instantly and draws a subtle `"PAUSED"` border/tint so you can calmly queue a link or move the squad beacon.
* **`Tab` (Pane Snap):** Warps the cursor between the center of the Left Pane and Right Pane so you never waste time scrolling the trackball across the whole screen.
* **HUD Readouts:** Just `[1:FRENZY] [2:BLIND]`, a `TEMP` bar (or cooldown timer), and a `RESET (R)` hotkey so you can replay the 60-second scenario instantly after winning or wiping.
---
### What to Intentionally Cut from the MVP
To keep this buildable in a few evenings, ruthlessly exclude:
* **RAM / Bandwidth math:** Use simple per-daemon cooldown timers instead of a resource pool.
* **Procedural map/graph generation:** Hand-tune the single 3-room layout until the timing between squad movement, ICE cracking, and the 4-second red trace feels razor-sharp.
* **Sound effects / SD card loading:** Compile your `8x8` sprites and map arrays directly into `const` headers in Flash.
* **Menus, title screens, and progression:** Boot straight into the paused encounter; on win/loss, show a 1-line banner (`BREACH SUCCESS` / `SQUAD KIA`) and let `R` reset the state struct.
### The Litmus Test for This MVP
Once this slice is running on the T-Deck, play it 5 times in a row. If you find yourself naturally hitting `Space` when the turret opens fire, slamming the blast door shut via `[DOOR_CTRL]`, cracking `[HIVE_CORE]` while your squad hugs cover, triggering `1: FRENZY` to watch the turret wipe out the droids, and hitting `X` right before the red trace reaches your airlock—you know the core game loop works and deserves a full sector generator around it.
+33 -1
View File
@@ -8,7 +8,7 @@ milestone lands.
| --- | --- | --- |
| **M0 — Emulator** | SDL2 emulator support + M1 surface tested locally | **done** |
| **M1 — Hardware Sandbox** | Full-frame sprite rendering to ST7789, shared tactical view + HUD, cursor, `Space` freeze, `P` view switch | **compiled + emulator-verified; on-device check pending** |
| M2 — Network Graph & Traces | Node graph in Network view (door nodes on bulkhead tiles), link routing, ICE crack, red trace + `X` sever | planned |
| M2 — Network Graph & Traces | 4-node sub-net in shared space (AIRLK→JUNC→DOOR/HIVE), animated link routing (1.5 s / 3.0 s ICE), door control, red trace → feedback spike + OVERHEAT, `X` sever, `R` reset | **done (emulator-verified)** |
| M3 — Squad vs. Droids | Ship floorplan in Cameras view, 3 marines → beacon, 4 droids, gunfire | planned |
| M4 — Cyber-Physical Bridge | Hive link + `1` FRENZY.EXE turns droids on each other (shared coordinate space) | planned |
@@ -56,3 +56,35 @@ milestone lands.
4. `Space` freezes (CRT scanlines, sim/packets halt); cursor stays live.
5. Trackball: smooth momentum cursor, tile snap in Cameras, node targeting
in Network; Enter = beacon drop / node select; screen tap works too.
## M2 (done — emulator-verified)
Implements the sub-net half of the MVP vertical slice (`MVP.md` §1–§3,
validation spec added in this commit) on the shared 320x192 coordinate space:
- **3-room floorplan** (airlock / main corridor / server room) with the
Room2/Room3 blast door (`+`) and the objective terminal `T`.
- **4-node sub-net** pinned to map tiles: AIRLK root (always online) —
JUNC — DOOR_CTRL (on the blast door tile) / HIVE (3 s ICE). Click an
adjacent offline node to route a link: animated dotted line turning
solid over 1.5 s (3.0 s through ICE); offline until the build completes.
- **DOOR_CTRL** (once online) toggles the blast door open/closed — open
doors also un-block LOS/movement for the combat milestone.
- **`X` severs the hovered link** (distance cursor→segment): everything
beyond it drops, ICE progress resets; severing during a trace resets
the trace safely.
- **Red trace**: cracking HIVE spawns a 4 s red pulse back to AIRLK;
arrival = feedback spike → all links drop + 3 s OVERHEAT lockout
(`TEMP` bar). FRENZY/BLIND daemons are gated until a HIVE link is up
(effects land in M4).
- **`R` resets** the scenario instantly to the paused, re-armed state
(`resetScenario()`), which also fixes the AIRLK-root-online bug.
- Boot goes straight into the paused encounter; HUD shows daemon slots,
TEMP bar, and `R: RESET`.
- Emulator host (`emulator/src/main.cpp`): headless testing support —
repeatable `--tap "x,y@frame"` screen-tap injection and repeatable
`--type "text@frame"` scheduled keyboard input.
- Verified headlessly: full route→door→ICE→trace→feedback→cooldown run,
safe-sever run (trace reset, no spike), all gating messages
(NO HIVE LINK / NO UPLINK / OVERHEAT / LINK SEVERED / NO NODE),
and `r` reset; visual frame dumps inspected.