Select realistic ready-rack dual-shell loadouts for AI tanks on the local server, inject them natively on bot spawn, and switch between anti-armor and soft-target shells in battle: - Add the loadout section to tuning/ground-ai.jsonc (lowReadyRackThreshold, topUpAmmoCount, primaryAmmoPct, secondaryMinRounds, penetrationCompareDistM), validated in ground-ai-tuning.ts. - Add the tank-bot-ammo v2 dataset (apps/server/src/game-data/datasets/ tank-bot-ammo.ts) reading primary cannon weapon name, capacity, firstStage/autoLoad shell ready-rack counts (excluding separate charges), and selectable shell modifications (using Lanz-Odermatt kinetic fields, cumulativeDamage, armorpower, and transitive reqModification chains). - Add selectBotTankLoadouts (apps/server/src/battle/bot-tank-loadouts.ts): carry ready-rack count when >= 15 (top up to 22 when smaller or absent, clamped to gun capacity), skip SPAA/belt autocannons, pick highest-tier APFSDS/anti-armor primary (~80%) plus HE/HESH/HEAT secondary (~20%, min 3 rounds) when available, and attach required addModification entries and per-tank wtoAmmo_<unit> strings to customBots when mode != stock. - Hook Unit::changeAircraft (already located dynamically on .37 and .58) in native/wto-net/src/local_mp_loadout.c to assign the 24-byte ChangeUnitReflection.bullets entries via bullet_vec_assign for LocalMP bot spawns (async == 0, non-local bot MPlayer), leaving player spawns untouched. - Track soft-target vs anti-armor shell classes in wto_ai_specs_common.das and write gun.nextBulletType in wto_ai_fire_common.das to queue HE/HESH against light/narrow targets and APFSDS/AP against MBTs/heavy armor. 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, 12/12 LocalMP module installation, clean daScript load (wto_ai_runtime.das loaded in 211 ms, 0 compile errors), and real 2.61.0.58 loadout selection on cn_ztz_96a (18 APFSDS + 4 HE), germ_leopard_2a4 (12 DM23 + 3 HEATFS), ussr_t_80bvm (22 3BM60 + 6 HE), us_m1a2_abrams (14 M829A2 + 4 HEAT-MP), ussr_t_34_1941 (18 APHEBC + 4 HE), and ussr_zsu_23_4 (stock belt kept). Live battle acceptance begins in Step 9.
200 lines
5.6 KiB
JSON
200 lines
5.6 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.45,
|
|
"tankDestroyer": 0.55,
|
|
"heavyTank": 0.85,
|
|
"mediumTank": 1.15,
|
|
"other": 1.0
|
|
},
|
|
|
|
"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": 2,
|
|
"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": 2
|
|
},
|
|
|
|
"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,
|
|
// When false, failed or timed-out bots brake in place and log the cause instead of
|
|
// handing movement back to stock tankBot (intended for testing).
|
|
"returnToStockOnFailure": true,
|
|
"cornerBrakeAccel": 1.75,
|
|
"pivotAngleDeg": 75.0,
|
|
"stuckWindowSec": 3.6,
|
|
"stuckMinMoveM": 2.0,
|
|
"unstickReverseSec": 3.0,
|
|
"tacticalReverseDistM": 34.0,
|
|
"tacticalReverseMaxSec": 9.5
|
|
},
|
|
|
|
// Exposure-based visual perception (offline values; foliageTransparency matches stock infantry AI).
|
|
"perception": {
|
|
"foliageTransparency": 0.01,
|
|
"nearSpotRangeM": 90.0,
|
|
"firingSpotRangeM": 650.0,
|
|
"fastSpotSec": 0.25,
|
|
"normalSpotSec": 0.60,
|
|
"farSpotSec": 1.45,
|
|
"decayPerSec": 1.5,
|
|
"frontConeHalfDeg": 30.0,
|
|
"peripheralCloseM": 100.0
|
|
},
|
|
|
|
// Per-bot hull state machine timings and thresholds (offline values).
|
|
"stateMachine": {
|
|
"preaimAngleDeg": 8.0,
|
|
"shortHaltMaxSec": 3.0,
|
|
"shortHaltCooldownSec": 4.0,
|
|
"turnLaunchSpeedMps": 2.1,
|
|
"coverMinDistM": 6.0,
|
|
"coverMaxDistM": 24.0,
|
|
"coverRetreatBudgetSec": 6.0,
|
|
"reloadAdvanceAngleDeg": 18.0,
|
|
"hullAngleTriggerDeg": 30.0,
|
|
"hullAngleTargetDeg": 15.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,
|
|
"stopSpeedMaxMps": 0.45,
|
|
"longRangeWindowSec": 4.0,
|
|
"baseAlignDeg": 0.42,
|
|
"closeHitRadiusM": 0.85,
|
|
"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": false,
|
|
"telemetryIntervalSec": 5.0
|
|
}
|
|
}
|