Check the live barrel trajectory against the exposed target and shorten
fire delays. Resolve automatic and secondary guns using stock weapon data.
Keep short halts and withdrawals coherent, follow the order while engaged,
and reverse on the route with direction-aware obstacle recovery.
Verified daScript loading and native AI script readiness in the guarded
2.61.0.64 lab client. Battle behavior requires manual acceptance.
Estimate hit probability and request movement speed from the weapon solution.
Use visible aim samples, stock shell penetration, and separate burst paths.
First step of the single-bot decision layer. Not yet checked in game:
the decision layer is coupled, so it is tested once its hull and fire
parts are in.
Perception is layered: the gun sight covers perception.gunFovHalfDeg
either side of the barrel; within nearAwareM the crew notices enemies
around the hull except a rear blind arc, which a periodic look-around
opens; within midAwareM the commander covers the hull's front half.
Near and mid layers take longer to see an enemy clearly. Each track
remembers when and where its enemy was last in sight.
Each bot keeps a threat table of the enemies it has discovered, rated
by distance, whether seen clearly, whether aiming at it or recently
hitting it, and whether it is in their sight. Penetration is left out
until the engine damage test is usable.
The turret no longer rests on the hull's front: without a clearly seen
target it looks at the most dangerous discovered threat, then the last
exit, the remembered target, cues, and otherwise sweeps across the
route. A threat clearly more dangerous than the engaged target takes
the turret first.
Bot slot bookkeeping moves out of the runtime entry into
wto_ai_slots_common.das, and battle statistics count an enemy as known
when it is in the threat table.
Tuning: perception gains nine settings and loses frontConeHalfDeg and
peripheralCloseM, tactics loses visionFovDeg and peripheralRangeM, and
the new threat and turret sections are wired through the server
reader, generated constants and launcher fields in both languages.
The decision layer rework is judged against a baseline, so the
runtime now accumulates per vehicle role and logs WTO_AI|BATTLE_STATS
every diagnostics.statsLogIntervalSec and when the battle ends:
- time from acquiring a ground target to the first shot at it, and
targets let go without a shot;
- time with a target in sight within range and the gun ready, split by
the last reason a shot was refused (WTO_AI|BATTLE_STATS_FIRE);
- shots by distance band and how many were fired on the move, and the
autocannon rate;
- every statsSampleSec, the nearest enemy in line of sight within
statsSampleRangeM: whether the bot knows it, how far the turret is
off it, and whether a tank or tank destroyer shows it its rear
(statsRearArcDeg).
The five diagnostics settings go through the server reader, the
generated script constants and the launcher fields in both languages.
Takes main's mounted gun traverse limits, capture and hit feedback,
LocalMP air AI sync, mod tech tree insertions and launcher changes.
Conflicts resolved:
- wto_ai_runtime.das: fire update runs before navigation, as on main,
so a hull-aim request is driven in the same frame; navigation keeps
the navmesh state and slot arguments of this branch.
- wto_ai_nav_common.das: main's wto_try_hull_aim replaces the old
limited-traverse pivot and uses this branch's drive command helper
and stuck-watch reset.
- build.ps1 and local_mp_internal.h: keep both sides' sources and
declarations.
A bot pressed against the same wreck or stopped vehicle backed off,
planned the same path again and drove into it once more, every few
seconds for minutes, because a contact reset the stuck watch and left
no trace for path searches.
A second contact within pathFollow.contactRepeatSec near the same
place now marks the body for path searches and switches the passing
side; after unstickMaxAttempts repeats the bot gives its order up and
the place is avoided like any other unreachable spot. NAV_CONTACT logs
the repeat count and the body position.
First in-game run of the path follower on Berlin and Poland showed whole
teams queueing on one road, bots ramming stopped teammates and wrecks,
bots clipping building corners, bots sliding into the Poland river and
the same bot getting stuck at the same spot dozens of times.
Native engine (native/wto-nav):
- Team traffic: a bot's finished path counts for its team for
trafficHoldSec; the team's later searches pay trafficCostPerPath more
per counted path through a polygon (up to trafficCostMaxMul), so
teammates spread over parallel routes. A slot's previous path stops
counting when it asks for a new one.
- Path corners are moved up to cornerOffsetM away from the edge they
turn around, when the mesh allows both legs; off-mesh link endpoints
stay put.
- path_request takes the team; load_map takes the new settings;
get_stats reports live traffic paths and moved corners.
Bake (tools/navgen):
- Water deeper than navBake.maxFordDepthM (0.9 m, was a fixed 0.6 m)
is a wall before erosion, so walkable ground keeps the tier radius
from it, plus deepWaterMarginM on banks lower than
deepWaterBankHeightM above the water line. Quays and ramps above it
keep only the radius. The preview marks deep water from the terrain.
Ground AI scripts:
- The lookahead point is pulled back along the path until the mesh
allows the straight line to it, so corners are no longer cut through
buildings.
- New traffic module replaces the fixed sideways step: hull length and
width along the heading; stopped vehicles, wrecks and parked players
are passed on the side with room, or the bot stops short and after
blockWaitSec marks the spot and plans again; moving traffic ahead is
followed; oncoming traffic is passed in the open and in narrow
passages the bigger vehicle goes first. Wrecks carry their heading.
- A hull pressed against a vehicle or wreck backs off after
contactReverseSec instead of the full stuck window.
- Jams and confirmed obstacles cost far more, and a given-up place is
all but closed (giveUpRadiusM, giveUpCostMul), so replanning leaves
instead of returning to it.
Tuning: navEngine trafficCostPerPath, trafficCostMaxMul, trafficHoldSec,
cornerOffsetM; pathFollow stationarySpeedMps, passMarginM, passSpeedMps,
blockWaitSec, blockTtlSec, contactGapM, contactReverseSec, giveUpRadiusM,
giveUpCostMul; avoidShiftM removed; jamCostMul 4 -> 12, rubbleCostMul
8 -> 25; navBake maxFordDepthM, deepWaterMarginM, deepWaterBankHeightM
(bake only). Launcher fields and en/zh-CN labels updated (978/978 keys).
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, rebake of
avg_berlin, avg_poland and avg_hurtgen (all spawn-to-zone pairs still
connected on every tier), offline run on the new avg_poland pack (eight
same-team paths spread over different roads, traffic released after
the hold time, corners moved, pump within budget), isolated game copy
build. daScript compilation and in-battle behaviour still need the
in-game run.
Accept manifest declarations for inserting vehicles into an existing research link. Compose shared links in mod load order after ordinary overlays and write matching shop and economy prerequisites. Validate anchors, rank order, and cycles, and document the manifest field.
Verified type checks, a 2.61.0.64 build with shared, folded, and cross-column insertions, load-order and disable readback, and the local server health endpoint. In-game acceptance remains pending.
Read the selected gun mount limits from the vehicle data and constrain its aiming commands. Send out-of-traverse aim requests to the chassis driver and require alignment before firing.
Verified type checks, executable patch checks and builds on 2.61.0.37 and 2.61.0.64, and guarded daScript initialization on 2.61.0.64. In-battle acceptance remains pending.
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.
log_commands defined decrypt-clog but the cli entry point never registered it, so the command was rejected as an invalid choice. Verified by decrypting a lab .clog through python -m wtotools.cli.
Statically link upstream Detour into wto_ws.dll with a navigation engine
(native/wto-nav) that loads one .wtonav pack per battle, reads the level
file's eVER fingerprint and answers path queries through a cost filter
that multiplies chokepoint polygons. Start and goal points that do not
sit on the ground are retried over the mesh's height range.
The ground AI script talks to it through call_mission_action("wtoNav")
with load_map, unload_map, find_path and get_stats. Requests are string
parameters; replies use the DataBlock setters local_mp_awards already
resolves, with coordinates as centimetre ints, so no new native site is
needed. The local server writes the battle level into customBots
wtoLevel, and the build writes the pack folder as nav.dir in wto_ws.cfg
(build-game-copy.ts --map-nav).
The first load_map of a battle decides it once: loaded, fallback to the
script's own navigation, or refused when navEngine.allowFallback is off,
in which case bots do not plan or drive. A fingerprint mismatch is
logged and the pack is still used. The script proves the round trip
with one path per team at battle start and logs query statistics.
Add the navEngine, navCostsTracked and navCostsWheeled tuning sections
through the server reader, generated daScript constants and the
launcher's bot tuning page in both languages.
Verified with root and launcher type checks, MSVC builds without
warnings in project code, check-patches 14/14 on 2.61.0.58 and
2.61.0.60, native module resolution 14/14 on 2.61.0.37, .58, .60 and
.64, a scratch game copy build packing 29 ground AI modules, and an
offline run of the engine: all three maps load with matching
fingerprints and every spawn-to-capture path on every tier succeeds.
Read both damage tables in config/rendinst_dmg.blk. riExtra blocks are
named after each destructible object and often carry hp without a
destructionImpulse, so dry-stone and wooden fences, metal railings,
sandbags and car wrecks were baked as solid walls. Stock damage data now
decides before model-name guesses, with the impulse and hp limits in the
navBake tuning section.
Flag chokepoints on the eroded voxel field instead of per polygon. A span
is a chokepoint only when no passable span within reach has room for a
passage chokepointMaxWidthVehicles wide, so long polygons touching a wall
no longer mark open yards. Chokepoints become WTO_FLAG_CHOKEPOINT on all
three tiers and keep their surface area.
Let roads cover rough slopes, map Poland's concrete streets as road, and
add an extractor --report with ground material shares and per-object
classification. Previews draw short cover ticks and record 300 DPI.
Verified with Rust release and MSVC builds without warnings, TypeScript
checks, and rebakes of Berlin, Poland and Hurtgen on 2.61.0.58 with
15/15, 416/416 and 840/840 spawn-to-capture connectivity on every tier.
Credit completed zone captures to the units counted by the mission engine and send the local capture fact through the existing settlement flow. Filter hit markers and shell-change hints using the actual attacker and active view.
TypeScript checks and the MSVC build passed. Verified exe, Quirrel, and native patches on 2.61.0.37, 2.61.0.58, 2.61.0.60, and 2.61.0.64. Rebuilt the .58 and .64 copies and verified local service health on .58. In-game verification is pending.
Record the verified executable, GUI and native patches for the Steam build. All patches apply, modified Quirrel scripts compile, and the patched copy builds with a healthy local server.
Add the local_mp_air_ai_sync native module to serialize calls to
TeamAiManager::addToUnsortedPlanes with an exclusive SRWLOCK on LocalMP
hosts.
Root cause (verified on 2.61.0.60, 2.61.0.58, and 2.61.0.37):
Aircraft physics and AI updates run concurrently across worker threads
via threadpool::parallel_for. When bot aircraft finish their behavior
tree (such as right after an aircraft crashes), AirAi::update tail-calls
TeamAiManager::addToUnsortedPlanes, which locks the global unit table
for lookup but mutates the team's shared unsortedPlanes
dag::Vector<uint32_t> (including reserve/HeapReAlloc) without a lock.
Under 32-bot LocalMP air battles, concurrent reallocations on this
vector corrupt the Windows heap (0xC0000374).
Also guard resolve_offender_killer in local_mp_kills.c with an
install-time check that LMP_OFFENDER_STRIDE <= LMP_OFFENDER_BUF_SIZE so
future struct growth skips cleanly instead of overflowing the stack
buffer.
Checks:
- MSVC /W4 build of wto_ws.dll (0 warnings in repository C files)
- Root and @wto/launcher npm run typecheck
- 15/15 native module resolution on 2.61.0.37 (0x807be0), 2.61.0.58
(0x80a2b0), and 2.61.0.60 (0x80a150), checkPatchSet, wtotools
check-patches on 2.61.0.60 (14/14), and temporary copy build
verification (build-game-copy.ts)
- Pending live multi-match air/nuclear-escalation acceptance in an
isolated copy.
Store the selected LocalMP backup token in a separate wtoLastBackup handler field instead of mutating requestData.wtoBackup. Mutating requestData caused respawn.nut checkReady() u.isEqual(lastRequestData, getSelectedRequestData()) to always evaluate false for backup spawns, preventing doRespawnPlayer() from ever running.
Also fix downstream ground and naval backup accounting where native UnitInfo::name carries folder prefixes (e.g. tankModels/cn_type_59) that mismatched bare unit IDs in session.spareSlots, by stripping path prefixes in local_mp_awards.c, record-local-battle-awards, battle-spares.ts, and battle-queue-requests.ts. Update hook_is_slot_ready_at_host to check USED_SPARES_MASK rather than BROKEN_SLOTS_MASK so unrepaired slots remain eligible for a backup spawn.
Verified root and launcher typecheck, 2.61.0.37 and 2.61.0.58 check-gui (50 patches / 37 .nut), check-patches (14/14), checkPatchSet, battle-spares runnable check, and MSVC temp build of wto_ws.dll (0 warnings in project C sources). Pending regular-terminal build of build/native/wto_ws.dll and in-game acceptance.
Retain road identity on narrow polygons, bake upward support faces on the verified fountain model, and attach directional Detour links for two dry canal-bank descents. Keep map-specific inputs in the Berlin tuning file and show both surfaces and links in the preview.
Verified three-tier bakes, platform approaches, and downhill and reverse route queries on 2.61.0.58.
Extend resolvePlayerDecalCacheFolder to resolve <game>/cache/content when the player picks a game root folder directly. Add read-only decals:detectSource IPC so the install wizard auto-fills a detected decal cache from the chosen source (with one-click reset to placeholders) and the client details view offers one-click import from the recorded online sourcePath.
Write a self-describing wtoffline/client.json origin marker (copy, hardlink, or in-place) on install, space-saving compaction, and hardlink-detaching updates, and read it with lightweight hardlink nlink sampling when inspecting existing folders. Allow deleting existing folders only when backed by a valid copy/hardlink marker outside Steam and disjoint from all registered source paths, and add an atomic restore-stock-and-remove option that restores the four stock core files and removes only wto_ws.{dll,cfg,log} and wtoffline/.
Report actual disk-copied bytes separately from NTFS hardlinked asset bytes during space-saving installation, display both counts clearly in the installer progress view, and note that Windows Explorer folder properties double-count hardlinked space.
Split deleteFiles from deleteData in copy maintenance requests with safe false defaults. Block disk deletion for non-copy (in-place/existing) and Steam-library clients on both main and renderer sides, and allow pure list removal to bypass stockBackup/root checks so missing or damaged client entries can always be removed.
Add tuning/store.jsonc freePaymentLabel (default Direct Claim in Chinese and English) and apply it consistently across the local web store, local marketplace, and the in-game payment dialog via cln_get_entitlements_price_ex top-level metadata.
Fix two 1970 squadron timestamps by sending nextRewardDayId as a 64-bit Unix timestamp in seconds and emitting dynamic bi-monthly season fields (clanDuelNextReward, clanSeasonStart, clanSeasonOrdinal, clanSeasonInYear) in clientProfile. Backfill preset normal squadrons to 58-60 deterministic NPC members so the client activity reward cap reaches 20,000, default startingPeriods and startingActivity to 0 in tuning/clans.jsonc, remove the hardcoded 20,000 empty-history fallback, and wire battle RP into squadron activity accumulation and period settlement.
Persist per-category dialog directories under userData/dialog-paths.json and resolve existing parent fallbacks for folder pickers, save archive import/export, online backup selection, and mod preset/folder dialogs.
Scan locally cached .ddsx files under cache/content (<first2>/<rest>.ddsx) when building char.vromfs.bin from player decal snapshots or regional.vromfs.bin. Repair single-LOD cache hits by falling back missing lodN/hdrN pairs to available LODs, fall back uncached stock decals to built-in placeholders, and drop uncached extra decals and incomplete downloadable skins.
Strip isCrossPromo and crossPromoBanner from config/shop.blk entries alongside tech-tree hiding flags so cross-promotion gift vehicles (bf-109c_1_promo, us_m4_sherman_promo, jp_destroyer_hatsuzuki) can be ordered directly through their generated local store packs while keeping showOnlyWhenBought intact.
Recheck continuous hull cover at the final parking height and validate both corner approaches on the navigation mesh. Preserve terrain and driving collision for low stone fences while excluding their geometry from cover traces. Add a preview raster size option.
Verified with Rust and MSVC builds, TypeScript checks, and 300 dpi 8K bakes for Berlin, Poland, and Hurtgen.
Accept the full client-writable hangar/<vehicle> field set emitted by AircraftInfo::serialize (mode 0x20/0x80) in cln_update for owned vehicles: lastSkin, lastWeapon, lastBullets0..5 (strings), and aileronTrim/elevatorTrim/rudderTrim (finite reals). Ownership and server-authoritative hangar fields remain untouched, matching the stock chard guard (2.61.0.37 0x938081) and serializer (2.61.0.37 0x940510, 2.61.0.58 0x942f80).
Extends the camouflage persistence fix from PR #17 to cover weapon presets, ammo belts, and flight trims reported on the same cln_update path. Verified root and launcher typecheck and SaveStore + clientProfile round-trip persistence. In-game acceptance is pending.
Co-authored-by: duduyagame <[email protected]>
Decode LMp2 terrain materials and decals into navigable road areas. Preserve usable cover bearings and verify left and right corner approaches independently on the standard tank mesh.
Verified with Rust and MSVC builds, TypeScript checks, and offline baking on Berlin, Poland, and Hurtgen for 2.61.0.58.
Share a distance-based speed cap between tactics and the fire gate.
Brake toward it and try a short halt when speed or aim keeps blocking
a ready shot.
Measure tracking drift relative to the aim direction and use the
close-range alignment window for quick shots. Expose the controls in
the launcher and record measured and permitted speeds in diagnostics.
Verified both TypeScript typechecks, 2.61.0.58 and 2.61.0.60 patch
checks and builds, and daScript loading in the guarded 2.61.0.58 client.
Set the shipped defaults to the saved launcher values for lineup
weights, perception, capture assignments, ridge firing and hull
angles. Enable the saved diagnostics setting by default.
Use the signed i64 profile encoding identified in PR #13. Make attached backups selectable in LocalMP after the daily quota, and debit backups only after the engine confirms the selected slot entered play.
Record the stock daily allowance once per room and slot. Settle owned backups using the confirmed spawn facts and keep repeat settlement from charging the same battle again.
Verified server and launcher types, MSVC compilation, three client builds for patch and Quirrel checks, and a temporary 2.61.0.58 build. In-game acceptance is pending.
Co-authored-by: duduyagame <[email protected]>
Use the native health update identified in PR #10 to report enemy mini-base damage and destruction. Preserve fractional personal score across hits and use the selected mode to gate both the HUD reward and settlement.
Verified server and launcher types, MSVC compilation, Quirrel bytecode, and patch resolution on 2.61.0.37, 2.61.0.58, and 2.61.0.60. In-game acceptance is pending.
Co-authored-by: duduyagame <[email protected]>
Ignore HUD kill feed entries with killer == -1 (mission air defense SAM/AAA and NPC units, common in Nuclear Escalation) when awarding firstKill, matching avengeAwards.
Also re-read the offenders vector count after orig_iground_award_assists in local_mp_events.c so the post-call scan never reads past a shrunk array.
Verified with root typecheck, MSVC x64 wto_ws.dll rebuild (0 warnings in project C code), and a runnable streak check.
Detect optional UHQ texture packs whose content/pkg_uhq_*.rq2 lacks a matching .ver file (PACKAGE_STATUS_REQUESTED) or whose grp_hdr.vromfs.bin has no .dxp.bin files.
planCopy now skips incomplete UHQ packs during copy installs and incremental updates (cleaning previously copied incomplete files on update), and planLaunch refuses to launch clients containing incomplete UHQ headers with a localized error instead of letting aces.exe crash with fatal error 81110007.
Verified with root and launcher typecheck, electron-vite build, en/zh-CN locale key parity (905/905), and a temp-folder runnable check.
Extend readLauncherTuning/writeLauncherTuning and launcher IPC schemas to read, validate, and atomically persist battle.botPoolLimitPerType and nested ground-ai.jsonc overrides (including mode, vehicle class lineupWeights, spawn loadout, and all advanced ground AI sections). Add a dedicated Bot parameters section under Tuning with collapsible groups, bilingual labels, cross-field validation, and per-section reset. Verified with root/launcher typecheck, electron-vite build, 904-key locale parity check, and temp-dir read/write/reset round-trip.
Use the stock effective-hit flag to award normal hits and show ineffective hits without rewards. Route enemy parts feedback by the actual attacker or recipient and the active spectator state.
Verified both TypeScript projects, the native DLL build, and patch and Quirrel checks on 2.61.0.37, 2.61.0.58, and 2.61.0.60. Built fresh 2.61.0.58 and 2.61.0.60 copies. In-game verification is pending.
Skipping Unit::setBehaviorTree left unit->behTree null on LocalMP bot tanks, which prevented VehiclePhysActor from applying producedCT to appliedCT (100% dead_echo in sinai_Conq1). Hook driveToPos::update (.37 0x861370, .58 0x863a90) instead and return ER_SUCCESS (1) when the ground AI script is ready, keeping the BehTree initialized while completely suppressing stock tankBot driving. Verified MSVC build (0 warnings) and .37/.58 native module resolution (0 failures).