Runtime analysis of CTask__AppendChild (0x4fdc70) and CTask__UnlinkChild
(0x4fdce0) reveals the true semantics of the children sub-struct:
+0x08 children_capacity — starts 0x10, doubles on overflow
+0x0C children_dirty — flag set to 1 when any child is unlinked
+0x10 children_watermark — insertion counter, never decremented on remove
+0x14 children_data — sparse pointer array; dead slots are nulled
The append-only watermark means CTaskFilter's "(N children)" label was
rising unboundedly as sea bubbles spawned. Fixed by computing live count
from non-null slots rather than reading children_watermark directly.
Also adds dump_ctask_children() to validation (F8 hotkey) for live
verification of these fields. Ghidra functions renamed accordingly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: update debug UI with TurnGameCtx and CTaskTeam new fields
- CTaskTeam (0x460 bytes, vtable 0x669EE4, class_type=10): per-team entity
with team_index (+0x38), _item_slots[100] (+0x88), worm_count (+0x218)
- Size confirmed from malloc(0x460) in FUN_005528c0 (the factory function)
- Secondary interface vtable at +0x30 (Ghidra 0x669F00)
- Registered in SharedData with type code 0x15 (team_index as key)
- Rename CTaskTurnGame._ctaskteam → _game_ctx with detailed comment
explaining it's the intermediate game-context base (class_type=5, vtable
0x669C44), NOT the per-team CTaskTeam — different class, different size
- Add CTaskTeam offset_of! checks in validation (team_index, worm_count)
- Add CTaskTeam inspector section in debug UI (team_index, worm_count)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: add CTaskFire and CTaskTurnGame structs with runtime validation
- CTaskFire (0xD8 bytes, class_type=0x18): spawn coords, timer, burn_rate,
spread_counter, lifetime, slot_index fields
- CTaskTurnGame (0x2E0 bytes): 15 named fields covering timers (turn_timer
+0x18C, idle_timer +0x184, retreat_timer +0x178), team tracking
(current_team, current_worm, arena_team, arena_worm), and frame counters
(active_worm_frames, retreat_frames, _timer_scale); all offsets runtime-
validated via offset_of! checks (15 PASS)
- dump_turngame(): finds TurnGame via vtable scan + SharedDataTable, dumps
known fields and full 0x2E0-byte raw region via dump_region
- dump_region refactored from DDGame-specific to generic *const u8 base
- replay-test.ps1: fix launcher invocation (pass $waExe explicitly so
replay file is forwarded as a WA.exe arg, not misinterpreted as exe path)
- Debug UI inspector sections for CTaskFire and CTaskTurnGame
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: add CTaskFire struct and debug inspector support
- Add CTASK_MISSILE_VTABLE (0x664438) to address.rs
- Add CTaskMissile to KNOWN_VTABLES in debug UI census
- Remove shared_data/owns_data/ddgame from CTask base inspector (same for every entity)
- Ghidra: label CTaskMissile__vtable and rename 6 overridden methods
(Init, Free, HandleMessage, PhysicsUpdate_Maybe, vt12, vt18_GetField130)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat(debugui): task tree entity census, transient filtering, scrollable inspector
- Replace SharedDataTable-based census with full DFS from CTaskTurnGame root,
so parent-hierarchy entities (CTaskTurnGame etc.) are included and the
liveness check no longer wrongly prunes them
- Filter transient entities (CTaskSeaBubble) from census by default; toolbar
checkbox toggles visibility and shows hidden count in the entity label
- Wrap inspector body in a ScrollArea so long entity trees are fully reachable
- Make census ScrollArea fill panel width (auto_shrink disabled, num_columns=3)
- Add CTASK_SEA_BUBBLE_VTABLE (0x669E88) to address.rs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix(debugui): clear stale entity selection when entity is destroyed
Build a live-entity snapshot once per frame and prune selected_entity and
nav_history before rendering, preventing UAF crashes when the inspected
entity is freed (match ended, worm died, etc.).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: add egui debug UI window with entity census, inspector, and log panel
Spawns a floating egui/eframe window in the same process as WA.exe (DLL
injection) when OPENWA_DEBUG_UI=1. Shows a live entity census from the
SharedData hash table, a struct inspector with navigation history, and a
scrollable log stream.
- New crate: openwa-debugui (egui 0.28 + glow backend, winit any-thread)
- Entity type names resolved via vtable map with ClassType fallback
- Children tree reads sparse slot array (children_size = high-watermark)
- Add CTASK_MINE/OILDRUM/CLOUD_VTABLE constants to address.rs (derived
from runtime vtables: delta 0x6C0000)
- debug-ui feature gate in openwa-wormkit; deploy-debug.ps1 / start-debug.ps1
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>