Commit Graph
3 Commits
Author SHA1 Message Date
wushenghua 2408bda84d fix: audit-driven battle, perf and save correctness batch
Three parallel read-only reviews (save/boundary, perf/lifecycle, battle/economy)
produced verified findings; each was confirmed with a probe before fixing.

Battle logic:
- storm_cooldown was set to 10s on use but never decremented, disabling the
  button for the rest of every battle. Now ticks with speed-scaled delta.
  touch_input_test verifies 9.8s -> 0 after 12s.
- set_p3a_scenario ignored the per-wave seed passed to setup(), so every wave
  of a multi-wave node reused seed 10001. Now accepts an explicit seed from
  GameRoot.

Performance:
- set_roster rebuilt all hero cards every frame (~35 nodes + styleboxes/frame,
  ~2100 nodes/sec at 60fps). Now diffs by hero id and updates labels/energy
  in place; visible_node_test asserts card instance ids are unchanged across
  an identical set_roster call.
- VfxView.configure() called _ready() before add_child() triggered Godot's
  _ready() again, creating two Sprite2Ds per effect (double overdraw). Added
  an _ensure_sprite validity guard like UnitView.
- VFX manifest was reopened + JSON-parsed per effect spawn (~16/sec under held
  taps); now cached in a static.
- SfxPlayer._played (test-only telemetry) grew unbounded; capped at 64.

Save/profile:
- muted and low_power were written by settings but absent from DEFAULT_PROFILE,
  so _normalize() dropped them on every save -> settings never persisted.
  Added to defaults + migration; save_corruption_test verifies.
- An unclaimed offline report was overwritten by the next launch after any
  intervening save, silently losing earned gold. build_offline_report now
  preserves a pending report; p3b test models claim/clear between scenarios.
- hero_levels values are clamped to 1..10000 (negative/huge values gave free
  or overflowing upgrade costs) and unlocked_heroes is deduped (repeat ids
  triple-counted roster DPS).

Robustness:
- hit-stop restore coroutine now uses a generation token so a stale coroutine
  cannot end a newer hit-stop after clear_all.

Full gate P2_CHECKS_PASS. All logs still 0 script/parse errors and 0 lambda-
capture errors. prototype/ untracked.
2026-11-18 04:48:58 +08:00
wushenghua 2d513bffb7 art: give every launch character a visible runtime sprite
Only H01, EG01 and B01 had reviewed pixel art, leaving most of the launch
roster invisible in the battle stage. create_filler_sprites.py generates
deterministic 96px silhouettes for the remaining five heroes and eight
enemies, keyed by signature so each role reads differently. They are written
with status "temporary_placeholder" in their manifests and must be replaced
with reviewed art before release; they are not being passed off as final.

Adding art for all characters exposed a real cap bug: the stage limited enemy
units to five but let all six hero units spawn. The HUD now clamps both to
five, and the visible-node test asserts exactly five hero units under an
over-cap input.

tools/run_p2_checks.sh still runs 15 gates; all pass.
2026-11-17 02:07:40 +08:00
wushenghua 7a101173ea feat: add pixel VFX, event binding and visible-node caps; close P2 locally
VFX. The three feedback effects existed only as IDs in the contract. They
are now generated as low-resolution transparent sprite sheets (16/32/64px,
hard pixel clusters, nearest filtering) with their own manifest. VfxView
advances frame indices without interpolation, finishes deterministically, and
drops intermediate frames in low-power mode while keeping the final state.
The battle scene maps authoritative sim events to effects: shield_break,
cast_ultimate and hit. Feedback can no longer disagree with the simulation.

Node caps. The stage now clamps visible enemies to five and visible heroes to
five, with a test that supplies seven enemies and six heroes, checks the real
node counts and verifies stale nodes are released when content shrinks.

tools/run_p2_checks.sh now runs 13 gates; all pass. PRODUCTION/38 records
P2-VFX-01 and the node-count portion of P2-BAT-03 as PASS, so P2 local
acceptance is complete. Open gates are the real-device ones (safe-area inset,
frame time, memory, heat) plus human comprehension and willingness to
continue; no local automation can grant those.
2026-11-17 00:03:47 +08:00