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.
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.
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.
Validate the selected rank against owned modifications and return the saved profile.
Use the saved rank delta for mode eligibility and room matchmaking.
Verified with typecheck and a local 2.61.0.58 server run using temporary data. In-game acceptance is pending.
Read stock weapon triggers and prerequisite modifications. Supply a suitable native preset for aircraft whose default lacks the relevant armament and preserve repeated modification names in the launch block.
Carry the queued aircraft and crew index into LocalMP, apply the native single-spawn limits to players and aircraft bots, and disable spares for single-slot modes.
Verified with root and launcher type checks, check-patches and check-gui for 2.61.0.37 and 2.61.0.43, and an isolated launch-payload check.
Everything sat in packages/: two programs next to the small libraries
they use, and the patch data loose at the root. The programs now live in
apps/ and the shared libraries in packages/:
apps/server the local server (was packages/local-service),
package @wto/server
packages/patcher builds the game copy (was packages/build),
package @wto/patcher
patches/exe exe patch definitions (was exe-patches)
patches/gui GUI script patches (was gui-patches)
Inside the server, the network layer folder becomes transport/ so it is
not server/server/, the entry module is server.ts, and startLocalService
and its types become startServer, ServerOptions and RunningServer. The
health answer names the app wto-server, and the TLS files in the data
folder are server.key and server.crt (made again on the next start).
Comments, logs and tool texts say "local server".
The patcher no longer reaches into the server's folder. It read the
default tuning/store.jsonc by a relative path to register bundle GUIDs
for the multi-vehicle packs, which also ignored the player's overrides
in <data>/tuning/. It now takes the pack ids from its caller; the
server exports multiVehiclePackIds(dataFolder), which reads them the way
the running server does. rebuildGuiPack takes the patch folder from its
caller as well.
The development build moves out of the patcher to
scripts/build-game-copy.ts, since it uses both the server and the
patcher. It needs --data (the folder the server will run with) and
defaults the patch folders and the hook library to this repository.
Checked with the root typecheck, check-patches, check-gui,
check-offsets, the native build, a run of build-game-copy.ts into a
scratch folder (12 exe patches, 35 GUI patches, 496 bundle GUIDs as
before) and a server start from apps/server answering wto-server.
BREAKING CHANGE: Use @wto/server and @wto/patcher from the new workspace paths. Run the development build with scripts/build-game-copy.ts and pass --data.