Commit Graph
1 Commits
Author SHA1 Message Date
N0VAN0M4LY 5786fee63b feat(ground-ai): add a replay trace and the AI lab viewer
Battle behaviour could only be judged by watching one bot at a time. The
AI now logs a replay trace and a local viewer plays it back on the map.

Game scripts:
- wto_ai_trace_common.das writes every diagnostics.traceIntervalSec the
  capture zones (WTO_AI|TRACE_CAP), every ground unit including players
  (TRACE_U) and each bot's decision state (TRACE_B: order, behavior,
  targets, what the turret looks at and why, barrel heading, fire denial,
  hit probability), plus part damage with its offender (HIT) and deaths
  (DEATH). It uses no engine module so a simulator can load it as is.
- The turret state records the reason and world direction of each look.
- New tuning diagnostics.trace and diagnostics.traceIntervalSec through
  server reader, patcher constants, launcher schema, fields and labels.

packages/ground-sim: readers for the baked .wtonav pack (mesh polygons,
cover points, tactical grid) and .pois.json, the trace parser and the
names of the logged codes.

apps/ai-lab: Vite viewer with a local API that lists nav packs and lab
logs and decrypts a chosen .clog with wtotools. It draws the nav mesh,
vehicles, barrels and wished turret directions, goals, target links,
shots, hits and deaths over a timeline, with per-bot strips for behavior,
fire denial and turret reason. Paths live in an untracked lab.local.json.
The lab has its own tsconfig and stays out of the root typecheck.

Root and launcher typechecks pass; the lab typechecks and replayed two
lab battles.
2026-12-06 13:53:52 +08:00