feat(ground-ai): add ready-rack dual-ammo bot spawn loadouts and shell switching
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.
This commit is contained in:
1 parent
d5008baeff
commit
ac35c25851
14 files changed
+601
-10
No files matched your search
@@ -27,6 +27,7 @@ export function readGroundAiTuning(reader: TuningReader): GroundAiTuning {
|
||||
const diag = reader.object('diagnostics');
|
||||
return {
|
||||
mode: readMode(reader),
|
||||
loadout: readLoadoutSection(reader.object('loadout')),
|
||||
lineupWeights: readLineupWeights(reader.object('lineupWeights')),
|
||||
cadence: {
|
||||
maxBots: cadence.int('maxBots', { min: 1, max: 64 }),
|
||||
@@ -60,6 +61,16 @@ function readMode(reader: TuningReader): GroundAiMode {
|
||||
return known;
|
||||
}
|
||||
|
||||
function readLoadoutSection(loadout: TuningReader): GroundAiTuning['loadout'] {
|
||||
return {
|
||||
lowReadyRackThreshold: loadout.int('lowReadyRackThreshold', { min: 1, max: 60 }),
|
||||
topUpAmmoCount: loadout.int('topUpAmmoCount', { min: 4, max: 80 }),
|
||||
primaryAmmoPct: loadout.int('primaryAmmoPct', { min: 50, max: 100 }),
|
||||
secondaryMinRounds: loadout.int('secondaryMinRounds', { min: 0, max: 20 }),
|
||||
penetrationCompareDistM: loadout.int('penetrationCompareDistM', { min: 100, max: 2000 }),
|
||||
};
|
||||
}
|
||||
|
||||
function readLineupWeights(weights: TuningReader): TankLineupWeights {
|
||||
const range = { min: 0.01, max: 10 };
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user