feat(ground-ai): add sample-based lead estimation, exit watch, and bounded bias

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.
This commit is contained in:
N0VAN0M4LY committed 2026-12-03 18:23:12 +08:00
1 parent 80113bdd2e
commit 45ff082a36
8 files changed
+223 -14

No files matched your search

@@ -121,6 +121,16 @@ export interface GroundAiConfig {
readonly targetStickinessSec: number;
readonly peekCooldownSec: number;
};
readonly estimation: {
readonly watchMinSec: number;
readonly watchMaxSec: number;
readonly velSampleMinSpanSec: number;
readonly velStableSpanSec: number;
readonly velJumpResetMps: number;
readonly baseAimSigmaM: number;
readonly leadErrorFrac: number;
readonly maxBiasM: number;
};
readonly fireControl: {
readonly maxEngageRangeM: number;
readonly closeRangeM: number;
@@ -278,6 +288,14 @@ function collectConfigEntries(c: GroundAiConfig): readonly DasEntry[] {
['WTO_AI_TACTICS_MEMORY_TTL_SEC', 'float', c.tactics.memoryTtlSec],
['WTO_AI_TACTICS_STICKY_SEC', 'float', c.tactics.targetStickinessSec],
['WTO_AI_TACTICS_PEEK_COOLDOWN_SEC', 'float', c.tactics.peekCooldownSec],
['WTO_AI_EST_WATCH_MIN_SEC', 'float', c.estimation.watchMinSec],
['WTO_AI_EST_WATCH_MAX_SEC', 'float', c.estimation.watchMaxSec],
['WTO_AI_EST_MIN_SPAN_SEC', 'float', c.estimation.velSampleMinSpanSec],
['WTO_AI_EST_STABLE_SPAN_SEC', 'float', c.estimation.velStableSpanSec],
['WTO_AI_EST_JUMP_RESET_MPS', 'float', c.estimation.velJumpResetMps],
['WTO_AI_EST_BASE_SIGMA_M', 'float', c.estimation.baseAimSigmaM],
['WTO_AI_EST_LEAD_ERR_FRAC', 'float', c.estimation.leadErrorFrac],
['WTO_AI_EST_MAX_BIAS_M', 'float', c.estimation.maxBiasM],
['WTO_AI_FC_MAX_RANGE_M', 'float', c.fireControl.maxEngageRangeM],
['WTO_AI_FC_CLOSE_RANGE_M', 'float', c.fireControl.closeRangeM],
['WTO_AI_FC_MID_RANGE_M', 'float', c.fireControl.midRangeM],