Replace direct reads of true enemy velocity with an own-sight sample
estimator, add 2-5 s last-seen exit watching, and sample bounded aiming
bias once per shooting opportunity:
- Add the estimation section to tuning/ground-ai.jsonc (watchMinSec,
watchMaxSec, velSampleMinSpanSec, velStableSpanSec, velJumpResetMps,
baseAimSigmaM, leadErrorFrac, maxBiasM), validated in
ground-ai-tuning.ts and compiled into WTO_AI_EST_* constants.
- Add wto_ai_estimate_common.das:
- Maintain a 6-sample timestamped ring buffer from each bot's own
visual sightings; compute smoothed observed velocity and convergence
quality, dropping quality and re-seeding bias on sudden braking/turns
or target switches.
- On LOS loss from an active ground engagement, freeze watchPos at the
last-seen exit point, clear observed velocity, and draw one random
2-5 s watch duration; stationary overwatch/defend bots hold their
post while watching, whereas pushing/retreating bots keep moving
while keeping their turret on the exit.
- Compute lead from observed velocity and loaded-shell flight time,
sampling one bounded bias vector per shooting opportunity (target,
shot count, state, 12 m position cell) that narrows as observation
quality improves and still passes the single fire-permission gate.
Verified root and launcher type checks, isolated 2.61.0.58 build (25
ground AI modules packed), and clean in-engine daScript compilation/load
(wto_ai_runtime.das loaded in 184 ms, 0 compile errors). Live battle
acceptance deferred until the full pipeline is wired.
Complete the single-vehicle tactical loop for reload survival, stalemate
breaking, and vehicle damage repair:
- Add cover, reload, hull-angle, stalemate, reposition, and repair-cover
parameters to tuning/ground-ai.jsonc, validated in ground-ai-tuning.ts
and compiled into WTO_AI_SM_* constants.
- Add wto_ai_cover_common.das: continuously record the last hard-concealed
hull position before peeking, and evaluate 9 cover candidates around
the tank (with enemy-clearance scoring when searching for a repair
cover).
- Add wto_ai_tactics_actions_common.das and wire wto_ai_tactics_common.das:
- Damage retreat & repair (plan 6.1): when gun is inoperable while
mobile, retreat to an enemy-free cover and send
EventRepairSystemRequestRepair(repair=true) once safe; when engine or
tracks immobilize the chassis, halt in place, request repair, and keep
gun self-defense active; stay halted while
repair_system_remaining_repair_time > 0.
- 3-way reload action: pull back into remembered/nearby cover (up to 6 s
budget, uninterrupted by flashes/new orders) -> zigzag advance at
+/-18 deg when pushing without cover -> angle hull front +/-15 deg
when side-exposed >30 deg with pivot room.
- Stalemate reposition: confirm outgoing effective damage via
EventUnitDamage (uint(hpFixed) < uint(prevHpFixed)) and enemy death;
trigger lateral reposition after 2 no-effect shots, 2 no-shot halts,
or 12 s cumulative halt time, unlocking short-halt only after 20 m
progress or reaching the new position.
- Split periodic telemetry out of wto_ai_runtime.das into
wto_ai_diag_common.das to keep every module under 300 lines.
Verified root and launcher type checks, isolated 2.61.0.58 build (24
ground AI modules packed), and clean in-engine daScript compilation/load
(wto_ai_runtime.das loaded in 228 ms, 0 compile errors). Live battle
acceptance deferred until the full pipeline is wired.
Replace the legacy tactics posture heuristics with an explicit per-bot
hull state machine driven by WtoTaskOrder and the 100/300/800 m distance
tiers, and fix chassis steering bugs:
- Add the stateMachine section to tuning/ground-ai.jsonc (preaimAngleDeg,
shortHaltMaxSec, shortHaltCooldownSec, turnLaunchSpeedMps), validated in
ground-ai-tuning.ts and compiled into WTO_AI_SM_* constants.
- Replace WTO_POSTURE_* with the unified WTO_STATE_* hull state enum in
wto_ai_types_common.das and decouple wto_perceive_update into
wto_ai_runtime.das so perception runs independently of hull tactics.
- Rewrite wto_ai_tactics_common.das as a priority-arbitrated state
machine: safety/SPAA -> ridge withdrawal -> active SHORT_HALT budget
(3 s limit with cooldown on timeout) -> crowd dispersion -> distance-tier
combat (RUN_AND_GUN <=100 m and high-urgency 100-300 m slow-move-fire;
PREAIM keeping the hull moving while gun reloads or turret error >8 deg;
SHORT_HALT only when ready and permitted by order.maxStopRangeM / 800 m
4 s window; RELOAD_ADVANCE when reloading away from cover) -> MARCH.
Log every state transition with reason, distance and speed.
- Fix the inverted neutral-pivot condition in wto_ai_drive_common.das,
add 2nd-gear straight-launch before full steering when turning with
open front clearance, and use full throttle when accelerating to target
speed so the automatic gearbox upshifts cleanly.
Verified root and launcher type checks, isolated 2.61.0.58 build (21
ground AI modules packed), and clean in-engine daScript compilation/load
(wto_ai_runtime.das loaded in 195 ms, 0 compile errors). Live battle
acceptance deferred until the full pipeline is wired.
Replace the old foliage-ignoring LOS check and 45 m pre-fire ray with
separate vision/hard-occlusion queries, exposure-integrated spotting, and
a single fire-permission gate for every ground weapon:
- Add perception and fire-gate distance/ballistics/budget parameters to
tuning/ground-ai.jsonc, validated in ground-ai-tuning.ts and compiled
into wto_ai_config_common.das.
- Extract wto_ai_combat_types_common.das and add wto_ai_sight_common.das:
visual checks use smoke occluders, ETF_ALL with aimRay material,
traceTransparencyRayRIGenNormalized foliage transparency, and vehicle/
wreck checks; hard-occlusion checks test terrain/structures plus both
ETF_RI and ETF_RI_PHYS without skipping soft foliage, plus swept
sphere_cast and wreck/vehicle bounds along the full shot distance.
- Rewrite wto_ai_perceive_common.das with per-target exposure integration
(fast/normal/far fill times and occlusion decay), 4-point visibility
sampling with continuous >=2-point LOS tracking for the 800 m 4-second
window, frozen last-seen coordinates with zeroed velocity on LOS loss,
and impact-time hit direction (no live offender lookup).
- Record per-shell ballistics profiles (speed, Cx, mass, ballisticCaliber)
in wto_ai_specs_common.das and sync the currently loaded shell from
gun.chosenBulletType / bulletSets at runtime.
- Add wto_ai_fire_gate_common.das as the sole ground trigger exit: checks
visual lock, weapon readiness, distance-tier measured chassis speed
limits (100/300/800 m), 800 m 4-second window, aim settle, per-frame
check budget, straight muzzle hard-ray, drag-integrated ballistic arc
sweep, predicted friendly corridor, and every barrel in the primary
trigger group. Confirm real shot departure from loaded ammo/readiness,
remove the pure-launcher stock bypass and add_unit_for_target leak, and
log exact deny/shot reasons.
Verified root and launcher type checks, isolated 2.61.0.58 build (21
ground AI modules packed), and clean in-engine daScript compilation/load
(wto_ai_runtime.das loaded in 186 ms, 0 compile errors). Live battle
acceptance deferred until the full pipeline is wired.
Replace the per-bot greedy cap scorer (wto_ai_macro_common.das) with a
whole-team commander and explicit task order contract, and fix the world,
spec, and navigation bugs found during the codebase audit:
- Classify ground battle modes (bttl, conq, dom) in multiplayer-missions
v5 from mislist.blk categories (with suffix fallback for event maps) and
emit wtoGroundMode in customRules/customBots.
- Add the commander section to tuning/ground-ai.jsonc with range and sum
validation, compiled into WTO_AI_CMD_* constants.
- Split zone/mode/spawn refresh into wto_ai_world_zones_common.das and fix
four world snapshot bugs: stop double-recording deaths in wreck scans
and deduplicate with a ring cursor, refresh units before spawn fallback
while retrying real respawn points, fall back battleCenter to spawns
when capCount is 0, and relax cap radius clamping to 10..180 m.
- Fix limited-traverse yaw overwrite in wto_ai_specs_common.das and
compute pivot turn angle against wishDir in wto_ai_nav_common.das.
- Introduce WtoTaskOrder (wto_ai_order_common.das) and whole-team
commander v1 (wto_ai_commander_common.das +
wto_ai_commander_anchors_common.das): mode-aware role quotas (Bttl,
Conq, Dom), deterministic distance + vehicle-suitability matching,
20-second role hysteresis, separate total-assigned vs cap-insider
counters, frontline-relative SPAA anchors, EventZoneCaptured immediate
rebalance, and per-team WTO_AI|CMD telemetry.
Verified root and launcher type checks, multiplayer-missions v5 dataset
extraction (1140 missions with Bttl/Conq/Dom classification), isolated
2.61.0.58 build (18 ground AI modules packed), and clean in-engine
daScript compilation/load (wto_ai_runtime.das loaded in 155 ms, 0 compile
errors). Live battle tuning and acceptance deferred until the full
pipeline is wired.
Address two issues found in the first isolated 2.61.0.58 live runs and add
a test switch to disable silent fallback to stock movement:
- Add navigation.returnToStockOnFailure in tuning/ground-ai.jsonc (default
true), compiled into WTO_AI_NAV_RETURN_TO_STOCK and written to wto_ws.cfg
as ground_ai_return_to_stock=0 when disabled. When false, failed or
timed-out bots keep stock movement paused, brake in place and log the
failure once instead of silently handing control back to stock tankBot.
- Allow holdMs=0 release actions even after local_mp_is_host() flips false
during mission unload, add eid=0 bulk release on wto_reset_runtime(), and
match slots by eid rather than live owner lookup so match exit cleans up
the native control table immediately.
- Stop releasing drive ownership when a vehicle is immobilized by damage or
repair; brake in place and pause the echo watchdog instead, avoiding the
1-second release/re-acquire flapping observed during combat. Log exact
release reasons and back off for 1 second if MoveSystem.inactive is
cleared externally.
Verified MSVC build of wto_ws.dll (0 warnings in project C sources), root
and launcher type checks, 14/14 check-patches on 2.61.0.58, and a temporary
2.61.0.58 game copy build confirming ground_ai_return_to_stock=0 in
wto_ws.cfg and 15 packed daScript modules. Live battle re-check pending.
Stock tankBot only drives each bot to a capture point, so the custom AI is the intended player default. Stock mode stays available for troubleshooting, and per-vehicle control still returns to stock movement on failure. Verified the shipped tuning loads with mode full.
Ground AI layers could be enabled in any combination, including ones the
scripts cannot run (fire control without perception disabled stock aiming
and never fired). The configuration now selects one of four complete modes:
stock, fire (stock movement, custom fire permission), drive (custom orders
and driving, stock firing) and full. The build derives the compiled layer
constants from the mode, and an unknown mode is rejected at load time.
The offline tank class weights for the AI bot pool move from code into
tuning/ground-ai.jsonc (lineupWeights). They apply only when a custom mode
is active; stock mode keeps the stock weight of 1 for every vehicle.
Verified root and launcher type checks, mode-to-constant compilation for
all four modes, rejection of an unknown mode, bot pool weights in stock and
custom modes, and temporary 2.61.0.58 game copy builds in full mode (15
script modules packed) and stock mode (no game pack written).
BREAKING CHANGE: ground-ai.jsonc drops "enabled" and "layers". Override
files set "mode" to "stock", "fire", "drive" or "full" instead.
Grant custom physics control per LocalMP bot and let the native layer release it when the script stops renewing control. Verified both TypeScript checks, the MSVC build, native resolution and check-patches on .37 and .58, and isolated .58 script loading.
Add ground-ai.jsonc tuning validation, realistic tank class weights for
customBots pools, on-demand game.vromfs.bin / ailist.blk injection in
@wto/patcher, and launcher/CLI build integration while keeping all
ground AI layers disabled by default in shipped configuration.