Commit Graph
4 Commits
Author SHA1 Message Date
Dejvino ce668a8005 Refactor: replace hardcoded unit array size 7 with nd::MAX_UNITS
- Replace hardcoded  with  in NetDeck.ino (8 occurrences)
- Add  to nd_layout.h
- Update test expectations in unit_tests.h and integration_tests.h from units[6] to units[7] to match the new reinforcement slot indexing

This enables supporting more than 7 units in the future.
2026-11-15 09:30:37 +01:00
Dejvino 6c7572bfae Fog of war: LOS-derived current/historical visibility bitmaps + rendering
Replace the fading visibility[] stub with two bitmaps over the tile grid:
fogNow (visible this tick) and fogSeen (persistent historical memory),
re-derived each sim tick via revealLos() Bresenham raycasts from:
- each living marine's 8-tile sight window (= marine fire range, so the
  squad never shoots into darkness), and
- each online network node uncovering its connected tiles (3-tile window).

Rendering (renderMap): never-seen -> flat dark gray, historical ->
luma grayscale via gray565(), current -> full palette. Hostiles on
non-visible tiles are hidden in renderUnits. Ad-hoc revealTile() stamps
(marine step, door/HIVE links, hand-placed airlock tiles) removed; fog
refreshes on door toggle and scenario reset.

Tests: 5 new unit tests (initial reveal, wall blocking with face render,
historical persistence, node uncover/sever, gray565 channels) plus a
regression pinning fog sight >= marine fire range.
2026-11-14 23:26:04 +01:00
Dejvino 7ef629d5df Fix Frenzy.EXE: use tile coordinates instead of pixel positions for HIVE frenzy radius check 2026-11-14 23:11:36 +01:00
Dejvino a1d0730124 NetDeck: headless test runner — unit + integration suites, E2E as separate build
- emulator/tests/: harness.h (TEST/EXPECT framework, input + serial +
  framebuffer helpers), shim_globals.cpp (shim externs for test binaries,
  replacing main.cpp ownership)
- unit_tests.h (14): map/door/LOS/BFS/cover/link state machine/trace/
  spike/reinforcement/win/loss/reset — deterministic fixed-seed, sim
  stepped tick by tick
- integration_tests.h (7): keyboard->pollKeyboard->handleKey pipeline,
  beacon clicks -> squad movement, full network journey via clicks,
  hover-sever (incl. safe sever during trace), daemon gating
- e2e_tests.cpp (separate NetDeck-e2e build): real setup()/loop() journeys
  with device-pipeline input injection (boot grace, 0x55 keyboard, GT911
  tap, trackball ISRs), transcript + pixel assertions (HUD, freeze tint)
- shim SerialSim: opt-in transcript ring for test assertions (off by
  default, interactive emulator unchanged)
- make netdeck-test / -unit / -e2e (root) and make test / test-unit /
  test-e2e (emulator/); tests/README.md documents the structure
- STATUS.md: test-structure note

Verified: make netdeck-test -> 14 unit + 7 integration + 3 E2E, 0 failures
2026-11-14 13:02:41 +01:00