Files
WT-Offline/apps/server/tuning/ground-ai.jsonc
T
N0VAN0M4LY ba947fe5b6 feat(ground-ai): follow baked navmesh paths with sliced searches
Native engine (native/wto-nav):
- Path searches are queued per slot and advanced with Detour's sliced
  search inside a per-frame time budget (navEngine.pathBudgetMsPerFrame),
  so a 4 km search no longer stalls a frame. The synchronous find_path
  op is gone.
- The battle's pack is read on a background thread when the mission
  finishes loading (prefetch); load_map only takes the result.
- New mesh queries: probe (surface, flags, room to the mesh edge),
  raycast, nearest walkable point, and dynamic cost circles for wrecks,
  jams and fresh obstacles that later searches route around.

Ground AI scripts:
- route picks the mesh tier by vehicle width and the cost filter by
  tracked or wheeled, plans on goal change, drift off the corridor, a
  timer or reported obstacles, and falls back to the stock road mesh
  only when the battle decided on the fallback.
- follow steers at a speed-scaled lookahead point and brakes ahead of
  sharp corners, narrow passages and the destination.
- avoid casts rays from both front hull corners that drive through
  objects the bake marks crushable, follows slower traffic, steps aside
  or yields by size priority in narrow passages.
- unstick escalates deterministically: back up along the corridor, mark
  a jam and replan, then log the spot and hand the order back.
- Flank lanes are built through the queued searches; rallies are not
  released while their lanes are still being built.
- Removed the 9-arc forward probing, 7-arc reverse probing, 145 m
  straight shortcuts, 165 m snapping and random sideways detours.

Tuning: new pathFollow section, navEngine.goalSnapRadiusM and
pathBudgetMsPerFrame, navBake.crushableMaxRiExtraHp passed to the
scripts; retired navigation.cornerBrakeAccel, stuckWindowSec,
stuckMinMoveM and unstickReverseSec. Launcher fields and en/zh-CN labels
updated.

Checked: root and launcher typecheck, MSVC build with no warnings in
project code, check-patches for 2.61.0.58 and 2.61.0.60, offline engine
run on avg_poland (prefetch, sliced searches within budget, slot
replacement, dynamic costs), isolated game copy build. daScript
compilation and in-battle behaviour still need the in-game run.
2026-12-05 17:38:41 +08:00

315 lines
10 KiB
JSON

// Ground battle AI configuration.
// Per-client overrides live in <dataDir>/tuning/ground-ai.jsonc. The game copy build compiles the
// layer settings into game/wtoai/wto_ai_config_common.das; the local server reads lineupWeights.
{
// "full": every custom layer (default).
// "fire": stock movement and destinations, custom perception and fire permission.
// "drive": custom team orders and driving, stock aiming and firing (debugging).
// "stock": stock AI only, no scripts packed, stock lineup weights (troubleshooting).
"mode": "full",
// AI tank spawn ammunition selection (offline values; ignored in "stock" mode).
// Carries first-stage / autoloader ready-rack capacity, topped up when below threshold,
// split between best anti-armor primary (APFSDS preferred) and HE/HEAT secondary when available.
"loadout": {
"lowReadyRackThreshold": 15,
"topUpAmmoCount": 22,
"primaryAmmoPct": 80,
"secondaryMinRounds": 3,
"penetrationCompareDistM": 500
},
// Relative pick weights of AI tank classes in a battle's bot pool. Offline values; ignored in
// "stock" mode, where every vehicle keeps the stock weight of 1.
"lineupWeights": {
"spaa": 0.12,
"lightTank": 0.85,
"tankDestroyer": 0.55,
"heavyTank": 0.85,
"mediumTank": 1.0,
"other": 0.85
},
"cadence": {
"maxBots": 64,
"macroTickSec": 0.5,
"tacticsTickSec": 0.25,
"navTickSec": 0.2
},
// Team commander role quotas and timing (offline values).
"commander": {
"rebalanceSec": 5.0,
"roleHoldSec": 20.0,
"bttlAssaultPct": 45,
"bttlFlankPct": 15,
"bttlOverwatchPct": 20,
"conqAssaultPct": 50,
"conqFlankPct": 20,
"conqHoldDefendPct": 30,
"conqHoldOverwatchPct": 30,
"domAssaultPct": 70,
"domMaxDefendersPerCap": 1,
"overwatchStandOffM": 95.0,
"flankStandOffM": 75.0,
"spaaFollowOffsetM": 160.0,
"flankMaxLengthRatio": 1.6,
"flankMinSeparationM": 45.0,
"rallyProgressFrac": 0.40,
"rallyWaitSec": 25.0,
"rallyMinFrac": 0.66,
"rallyRadiusM": 55.0,
"recallSafeHoldSec": 15.0
},
"macro": {
"openingSplitSec": 40.0,
"capMaxInsiders": 3,
"recaptureMinBots": 2,
"recaptureMaxBots": 4,
"capStickyBonusM": 165.0,
"deathZoneRadiusM": 55.0,
"deathZoneTtlSec": 60.0,
"deathZoneMinKills": 3,
"spaaRearOffsetM": 185.0,
"spaaRelocateSec": 28.0,
"enemySpawnAvoidM": 180.0
},
"crowd": {
"personalSpaceM": 14.0,
"clusterRadiusM": 28.0,
"clusterMaxAllies": 2,
"disperseStepM": 24.0,
"disperseHoldSec": 4.2
},
"terrain": {
"maxClimbSlopeDeg": 25.0,
"maxDropSlopeDeg": 20.0,
"maxWaterDepthM": 0.6,
"collisionMarginM": 0.3,
"crestLookaheadM": 28.0,
"ridgeMaxDwellSec": 10.0,
"ridgeMaxShots": 6
},
// Offline map baking parameters. These are copied into the generator's per-level POI input.
"coverMap": {
"minCoverHeightM": 1.55,
"peekMinM": 3.5,
"peekMaxM": 6.0,
"retreatMinM": 8.0,
// Low dry-stone fence models observed to give unreliable shot protection.
"excludedCoverRendinst": ["stone_fence_a", "damaged_stone_fence_a", "damaged_stone_fence_b"]
},
// Offline navigation mesh baking parameters, copied into the generator's per-level POI input.
"navBake": {
// Placed objects whose stock destructionImpulse (config/rendinst_dmg.blk) is at most this
// value are knocked down by tanks and baked as crushable rather than solid (N*s).
"crushableMaxImpulse": 45000,
// riExtra objects with no destructionImpulse are crushable when their stock hp is at most
// this value (wooden fences 2, dry-stone fences 12, car wrecks 20; buses 40).
"crushableMaxRiExtraHp": 20,
// Passages narrower than this many standard-tier vehicle widths are flagged as chokepoints.
"chokepointMaxWidthVehicles": 2.0
},
"navigation": {
// "vehicle_phys" uses custom inputs with native ownership. "movesys" keeps stock movement.
"driveMode": "vehicle_phys",
"maxPhysBots": 64,
"steerSign": 1.0,
"deadEchoSec": 1.2,
"controlTimeoutSec": 1.0,
// Speed error at which the moving-fire controller applies full throttle or braking.
"movingFireSpeedRampMps": 1.0,
"pivotAngleDeg": 75.0,
"tacticalReverseDistM": 34.0,
"tacticalReverseMaxSec": 9.5
},
// Baked navigation packs (tools/navgen), loaded once per battle by the native engine.
"navEngine": {
"enabled": true,
// When the battle's pack is missing or broken: true keeps the script's own navigation for the
// whole battle, false leaves the bots standing so the problem shows (testing). Decided once at
// battle start, never in the middle of a battle.
"allowFallback": true,
// Farthest a path's start or goal may lie from the mesh.
"snapRadiusM": 12.0,
// A goal farther than snapRadiusM from the mesh (a position chosen by tactics inside a building
// or on a slope) is moved to the nearest walkable point within this distance; beyond it the
// goal counts as unreachable. Also used to find the way back onto the mesh.
"goalSnapRadiusM": 40.0,
// Path searches are spread over frames; this is the search time allowed per frame.
"pathBudgetMsPerFrame": 0.5
},
// Path cost multipliers per surface for tracked vehicles; chokepoint multiplies the surface cost
// of passages narrower than navBake.chokepointMaxWidthVehicles.
"navCostsTracked": {
"road": 0.75,
"bridge": 0.9,
"ground": 1.0,
"rough": 1.65,
"forest": 2.1,
"crushable": 2.4,
"shallowWater": 2.6,
"chokepoint": 1.8
},
// The same for wheeled vehicles.
"navCostsWheeled": {
"road": 0.55,
"bridge": 0.75,
"ground": 1.15,
"rough": 3.2,
"forest": 2.8,
"crushable": 3.5,
"shallowWater": 4.0,
"chokepoint": 2.2
},
// Following the path, local avoidance and unstick (offline values).
"pathFollow": {
// Plan again after this long, when the goal moved this far, or when the bot is this far off its path.
"replanIntervalSec": 3.5,
"replanGoalMoveM": 15.0,
"offCorridorReplanM": 12.0,
// Steering point: speed times lookaheadTimeSec, kept within the range of the vehicle kind.
"lookaheadTimeSec": 1.4,
"trackedLookaheadMinM": 6.0,
"trackedLookaheadMaxM": 18.0,
"wheeledLookaheadMinM": 10.0,
"wheeledLookaheadMaxM": 24.0,
// Path corners sharper than cornerAngleDeg are taken at the speed the sideways acceleration
// allows; the vehicle brakes toward it (and toward its destination) at cornerBrakeDecelMps2.
"cornerAngleDeg": 35.0,
"cornerLateralAccelMps2": 2.8,
"cornerBrakeDecelMps2": 2.0,
"arriveRadiusM": 3.0,
"arriveMinSpeedMps": 1.5,
// The mesh already keeps the vehicle's half width from walls; less room than this beyond it,
// or a baked chokepoint, counts as a narrow passage.
"narrowWallMarginM": 1.5,
"narrowSpeedMps": 4.5,
// Rays from both front corners of the hull for obstacles the baked mesh does not know.
"bumperRayM": 7.0,
"bumperStopM": 1.5,
"bumperBlockSec": 0.6,
// Vehicles and wrecks that come within reach in trafficTtcSec: follow, step aside, or give way.
"trafficTtcSec": 2.5,
"avoidShiftM": 3.0,
"yieldWaitMaxSec": 3.0,
// Less progress than stuckMinProgressM within stuckWindowSec while wanting to move is stuck.
"stuckWindowSec": 3.0,
"stuckMinProgressM": 0.8,
"unstickReverseM": 6.5,
"unstickReverseSec": 3.0,
"unstickRepeatSec": 8.0,
"unstickMaxAttempts": 3,
// Temporary path costs: jams found by unstick, fresh obstacles hit by the front rays, wrecks.
"jamRadiusM": 10.0,
"jamCostMul": 4.0,
"jamTtlSec": 45.0,
"rubbleRadiusM": 6.0,
"rubbleCostMul": 8.0,
"rubbleTtlSec": 90.0,
"wreckRadiusM": 6.0,
"wreckCostMul": 6.0,
"wreckTtlSec": 120.0
},
// Exposure-based visual perception (offline values; foliageTransparency matches stock infantry AI).
"perception": {
"foliageTransparency": 0.01,
"nearSpotRangeM": 190.0,
"firingSpotRangeM": 750.0,
"fastSpotSec": 0.25,
"normalSpotSec": 0.60,
"farSpotSec": 1.45,
"decayPerSec": 1.5,
"frontConeHalfDeg": 60.0,
"peripheralCloseM": 100.0
},
// Per-bot hull state machine timings and thresholds (offline values).
"stateMachine": {
"preaimAngleDeg": 8.0,
// Time a ready gun can be held up by speed or aim before attempting a short halt.
"movingShotWaitSec": 1.0,
"shortHaltMaxSec": 3.0,
"shortHaltCooldownSec": 4.0,
"turnLaunchSpeedMps": 2.1,
"coverMinDistM": 6.0,
"coverMaxDistM": 24.0,
"coverRetreatBudgetSec": 6.0,
"reloadAdvanceAngleDeg": 18.0,
"hullAngleTriggerDeg": 20.0,
"hullAngleTargetDeg": 10.0,
"maxTotalHaltSec": 12.0,
"stalemateMissShots": 2,
"stalemateNoShotHalts": 2,
"repositionMinMoveM": 20.0,
"repositionStepM": 48.0,
"repairSafeEnemyDistM": 140.0
},
"tactics": {
"visionRangeM": 1250.0,
"visionFovDeg": 115.0,
"peripheralRangeM": 230.0,
"engineAudioRangeM": 65.0,
"shotAudioRangeM": 380.0,
"radioShareRangeM": 450.0,
"memoryTtlSec": 12.0,
"targetStickinessSec": 4.5,
"peekCooldownSec": 6.0
},
// Target velocity estimation from own visual samples, last-seen watch, and bounded shot bias.
"estimation": {
"watchMinSec": 2.0,
"watchMaxSec": 5.0,
"velSampleMinSpanSec": 0.25,
"velStableSpanSec": 1.2,
"velJumpResetMps": 4.5,
"baseAimSigmaM": 0.28,
"leadErrorFrac": 0.26,
"maxBiasM": 2.2
},
"fireControl": {
"maxEngageRangeM": 1250.0,
"closeRangeM": 100.0,
"midRangeM": 300.0,
"longRangeM": 800.0,
"midSlowSpeedRatio": 0.45,
"midSlowMaxMps": 5.5,
// Moving-fire speed rises from the mid-range limit through the close-range boundary to point blank.
"closeRangeMaxSpeedKmh": 30.0,
"pointBlankMaxSpeedKmh": 35.0,
"stopSpeedMaxMps": 0.45,
"longRangeWindowSec": 4.0,
"baseAlignDeg": 0.42,
"closeHitRadiusM": 0.85,
// Outside close range, the rate at which barrel alignment drifts relative to the aim direction.
"barrelSettleDegSec": 1.8,
"closeSettleHoldSec": 0.08,
"settleHoldSec": 0.20,
"unstabilizedStopSpeedMps": 0.45,
"stabilizedCreepSpeedMps": 5.5,
"friendlyCorridorM": 3.2,
"ballisticStepMaxM": 25.0,
"ballisticSweepRadiusM": 0.12,
"maxPreFireChecksPerTick": 2
},
"diagnostics": {
"telemetry": true,
"telemetryIntervalSec": 5.0
}
}