Confirm drive ownership through the LocalMP mission-action reply. Keep
stock driveToPos gated for slot bots and let the game manage
MoveSystem.inactive so it can start and stop their engine audio.
Verified root and launcher type checks, the native DLL build, compile-only
checks of the changed daScript functions, and the 2.61.0.64 game-copy
build. Executable patch checks and native module resolution passed on
2.61.0.37, 2.61.0.60, and 2.61.0.64. In-game audio and driving acceptance
are pending.
- Capture unit_mgr, agent_unit_idx, unit_count, and unit_array inside driveToPos::update (patches/native/local_mp_ground_ai.jsonc) so local_mp_ground_ai.c short-circuits stock movement only for MPlayer slot bots (userId < -1) and leaves non-MPlayer mission wave AI (such as Ground Assault enemy tanks) on stock mission control.
- Return customBots/wtoPveMode from wtoGroundAiScriptReady so ground AI scripts in Assault PvE take over only Team A friendly defenders (army 1) and synthesize a friendly defense anchor from the mission safe_zone area.
Verified: MSVC wto_ws.dll build (0 project warnings), .37 check-patches (14/14), .37/.64 native module resolution (18/18), and temporary game-copy build packing 55 ground AI modules; in-game acceptance pending.
Check the intended recipient of ground part damage messages in the LocalMP proxy. Keep the firing player's slot available when the ground model sends damage feedback directly to the HUD.
Verified both TypeScript projects, the native DLL build, executable patch checks on .37, .60, and .64, and native patch resolution on .37, .58, .60, and .64. Built .37 and .64 copies and checked local service health on .64. In-game verification is pending.
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.
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.
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.
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.
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.
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.
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.
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.
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).
Replace per-bot mid-battle movement handback to stock AI with a clean
binary startup gate:
- Locate Unit::setBehaviorTree (ground_ai_set_beh_tree: .37 0x4e89b0,
.58 0x4e8f60) in patches/native/local_mp_ground_ai.jsonc and hook it
in native/wto-net/src/local_mp_ground_ai.c.
- Announce readiness from [init] in wto_ai_runtime.das via
wtoGroundAiScriptReady once the ground AI scripts finish compiling
cleanly with custom movement enabled. When announced, hook_set_beh_tree
suppresses attaching "tankBot" to LocalMP bot tanks and keeps their
MoveSystem.inactive pinned to 1 for the life of the vehicle, ending
all tug-of-war (external_inactive_reset) with stock AI.
- If scripts fail to compile, are missing, or mode is "stock" / "fire",
ownMovement stays 0 and stock tankBot runs untouched.
- Remove per-bot handback, timeout release, and the now-obsolete
navigation.returnToStockOnFailure config plumbing; on genuine script
failure a bot halts in place and logs DRIVE_FAIL instead of silently
switching to stock. Also initialize newly spawned bot ticks to run on
frame 0 to eliminate spawn-frame invalid_drive_cmd noise.
Verified MSVC build of wto_ws.dll (0 warnings in project C sources), root
and launcher type checks, native module resolution on both 2.61.0.37 and
2.61.0.58 (0 failures), isolated 2.61.0.58 startup confirming 12/12
LocalMP modules installed, wto_ai_runtime.das loaded in 213 ms (0 compile
errors), and "ground AI script ready (ownMovement=1; stock tankBot
disabled)" in wto_ws.log.
BREAKING CHANGE: removes navigation.returnToStockOnFailure from
tuning/ground-ai.jsonc; stock tankBot is now controlled strictly by
whether the custom ground AI script loaded with custom movement enabled.
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.
Address two issues found in the first isolated 2.61.0.58 live runs and add
a test switch to disable silent fallback to stock movement:
- Add navigation.returnToStockOnFailure in tuning/ground-ai.jsonc (default
true), compiled into WTO_AI_NAV_RETURN_TO_STOCK and written to wto_ws.cfg
as ground_ai_return_to_stock=0 when disabled. When false, failed or
timed-out bots keep stock movement paused, brake in place and log the
failure once instead of silently handing control back to stock tankBot.
- Allow holdMs=0 release actions even after local_mp_is_host() flips false
during mission unload, add eid=0 bulk release on wto_reset_runtime(), and
match slots by eid rather than live owner lookup so match exit cleans up
the native control table immediately.
- Stop releasing drive ownership when a vehicle is immobilized by damage or
repair; brake in place and pause the echo watchdog instead, avoiding the
1-second release/re-acquire flapping observed during combat. Log exact
release reasons and back off for 1 second if MoveSystem.inactive is
cleared externally.
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, and a temporary
2.61.0.58 game copy build confirming ground_ai_return_to_stock=0 in
wto_ws.cfg and 15 packed daScript modules. Live battle re-check pending.
Grant custom physics control per LocalMP bot and let the native layer release it when the script stops renewing control. Verified both TypeScript checks, the MSVC build, native resolution and check-patches on .37 and .58, and isolated .58 script loading.
Hook AcesApp's local MPI proxy dispatch to drop enemy-part-damage messages (0xf104 / 0xf118, captured dynamically) whose recipient_pid does not belong to the local player or watched hero, preventing AI-vs-AI aircraft damage from leaking into the local kill feed.
Remove the mistaken !is_kill gate in hook_dispatch_hit_crit: the 5th argument from Unit::flushOffenderHitAward is a repeat-flush flag rather than a kill flag, which dropped follow-up aircraft hits because fixed-wing units flush exclusively through the timer path. Add a same-team guard to match the severe-damage hook.
Verified: MSVC build.ps1 (0 warnings in project code), check-patches (14/14) and 12/12 native module resolution on 2.61.0.37 and 2.61.0.58. Pending in-game acceptance.
Copy allowedKillStreaks and set useKillStreaks for Ground Arcade in battle-mission-settings.ts, and add a dedicated dynamic native module (local_mp_air_events) that preserves MissionSettings.useKillStreaks across prepare_local_mission, credits local player AI kills toward native killstreak counters, delivers UnitRespawn (0xf030) to the LocalMP host via shared unit_on_event, and recovers invalid surface poses from gameplay.blk spawnPos parameters for the match rank.
Based on PR #3 by Rivfflot, who diagnosed the LocalMP Ground Arcade air-event gaps and verified the fix in-game; refactored here onto patches/native dynamic resolution for cross-version and MSVC build compatibility.
Checked: root and launcher typecheck, MSVC native/wto-net/build.ps1, native resolution across 2.61.0.37 and 2.61.0.58 (12/12 modules), 2.61.0.58 check-patches (14/14), and temporary 2.61.0.58 copy build all passed. Pending in-game acceptance on the refactored module.
Co-authored-by: Alem Bek <[email protected]>
Pressing ID_SQUAD_TARGET_DESIGNATION ("Set target for squad") checks
MPlayer+0xab0 (squadId) and returns early when it is zero (2.61.0.58
0x1600a4f). The LocalMP host already retains the 0xf10f relay and
0xf142 HUD indicator path (0xcb045c -> 0xcb1646 -> 0xcafffb ->
0x19a65e0), which also requires a non-zero squadId from matchingInfo+0x0.
Set matchingInfo+0x0 (squadId) to 1 for the local player when zero in
hook_mplayer_init_from_matching so MPlayer::initFromMatching (0x59e660
on 2.61.0.37, 0x59f370 on 2.61.0.58) copies it into MPlayer+0xab0 and
restores the yellow squad target marker without extra hooks or exe patches.
Verified with native wto_ws.dll build; pending in-game verification.
Connect Air Realistic sub-mode 103 (Nuclear Escalation) mission launch
settings and LocalMP respawn/airfield-cooldown handling:
- Server: support mode-level maxRespawns (UNLIMITED_RESPAWNS = -2) and
per-mode missionRuleKeys so Nuclear Escalation forwards customHUD,
stage thresholds, useSpawnDelay, afterRespawnDelaySec, and battle
display flags from the stock missions; reject queues when no candidate
mode is eligible for the lineup; disable spares and emit
wtoUnlimitedRespawns for unlimited-respawn modes.
- Native: keep slots usable when wtoUnlimitedRespawns is set and emit
wtoLocalMpAirfieldSpawn with the unit name and spawn base ID when the
local player actually enters pilot control.
- GUI patches: track confirmed LocalMP airfield departures in
scripts/respawn/respawnbases.nut and feed the computed per-base delays
into scripts/respawn/respawn.nut slot countdowns and spawn checks.
Stage-unlocked dedicated event aircraft allocation by faction and room
BR is not yet wired and remains pending research. Verified with root and
launcher typechecks, check-patches and check-gui on 2.61.0.37 and
2.61.0.58, and native wto_ws.dll build; pending in-game verification.
Unit::loadCrew previously skipped reading the player's equipped crew from
the profile whenever Multiplayer+0x60 (host flag) was non-zero, leaving
human players with default skills and no Expert/Ace bonuses. Calling
UnitCrewSkills::initFromSave after Unit::changeAircraft in the native
loadout hook ran too late to affect live vehicle crew state.
Add exe patch battle/load-local-host-player-crew to check both the host
and LocalMP flags (+0x60 and +0x61) in Unit::loadCrew so only non-LocalMP
hosts skip directly to the default crew while preserving the owner check.
Remove the late initFromSave workaround from local_mp_loadout.c (keeping
its native patch sites for compatibility with 0.1.2 hook DLLs) and add
the E-Crew skills in battle feature labels to the launcher locales.
Verified with check-patches on 2.61.0.37 (0x10025dd) and 2.61.0.58
(0x100700d), native wto_ws.dll build, launcher typecheck and build;
pending in-game verification.
Add a quick ZIP log export button to the About page (also bundling the latest embedded browser -browser.log while excluding player saves) and add a runtime logging toggle under Settings -> Diagnostics that controls launcher file logs, local server traffic logs, and wto_ws.log via log=0 in wto_ws.cfg. Update the v0.1.2 release note accordingly.
Replace the ineffective hero_unit comparison with producer-side hooks on the two stock LocalMP leaks:
1) Avionics/electronics failure dispatcher (2.61.0.37 0xfca8b0, .43 0xfce8e0): track the damaged Unit* from [component + unit] on the current thread and suppress HUD_MSG_DAMAGE notices and optic-view exits (0x15cd9c0) for non-local units while keeping native failure effects intact.
2) Unit::onEvent hit-parts fallthrough (2.61.0.37 0x103fbc0, .43 0x1043fe0): track the hit event on the current thread and filter enqueue_enemy_parts, hit_cam_important, and naval_hit_state to attacks from the local controlled unit, local MPlayer's units (in-flight munitions after switching), or the watched spectator unit.
Checked: native/wto-net/build.ps1 compiles with zero warnings in project sources; checkPatchSet, root and launcher typechecks, 2.61.0.37 check-patches, and native module resolution on both 2.61.0.37 and 2.61.0.43 (11/11 modules ready, 0 failures) pass. In-game verification pending.
Switch ws2_32 and LocalMP hook installers to MH_QueueEnableHook with two MH_ApplyQueued passes (mandatory network hooks first, then all LocalMP modules), reducing DllMain thread-freeze cycles from 26 to 2. Roll back partial module hooks on error and log MH_StatusToString diagnostics to wto_ws.log.
Checked: native/wto-net/build.ps1 compiles cleanly with zero warnings in project sources, and PE inspection confirms WS2_32/KERNEL32 imports and 49 exports. In-game verification pending.
The stock control-loss hints are pushed as HUD_MSG_DAMAGE with the text
chosen by a HUD text index, not by the damaged handler, so the barrel and
breech filter in local_mp_damage_notifications never saw them. The hint
refresh describes the unit in the hero manager's current-hero cell, one
process-wide slot that can be left on another unit on a LocalMP host.
Hook the HUD_MSG_DAMAGE delivery (2.61.0.37 0x19b1030, 2.61.0.43
0x19b6ba0) and drop hints with text indices 261..283 whose described unit
is not the unit the local MPlayer controls. Suppressed hints are logged up
to 12 times so a filter that never fires is visible in wto_ws.log.
Checked: native DLL build; check-patches on 2.61.0.37; temporary copy
builds of 2.61.0.37 and 2.61.0.43 report the executable, GUI and native
patches all ready (11 native modules). In-game acceptance is pending.
wto_ws.dll no longer scans aces.exe or carries structure offsets of a game
build. It reads the values the patcher resolved (wto_ws.cfg native.* lines)
into g_lmp through one table that names, per module, which value fills which
field (local_mp_values.c), and installs each module whose values are all
present, in dependency order, instead of giving up on the whole bridge when
one subsystem is missing. When the settings were resolved for another
executable (PE time stamp and image size differ), the bridge stays off.
local_mp_offsets.h keeps the existing names so the module code reads as
before; only Dagor library layouts (dag::Vector, DataBlock), protocol enums,
the reflection buffer size and the two change request members with no reader
in the client remain constants. A few fields are derived where the client has
no instruction of its own for them (local_mp_values.c derive_values). The
signatures moved to patches/native, and the header-based check-offsets
command is gone: record-game-version and the launcher's patch check resolve
the native modules now.
Shared sites moved to local_mp_core (mission customBots, the player's unit
eid) so modules do not depend on each other for them.
Checked: DLL build (no warnings outside MinHook); root and launcher type
checks; check-patches on 2.61.0.37; version records for 2.61.0.37 and
2.61.0.43 (10 native modules each); a lab run of the 2.61.0.37 copy logs
239 native values and "9 of 9 LocalMP modules installed". Battles were not
played in this run.
BREAKING CHANGE: Rebuild game copies to generate the new native values in wto_ws.cfg. Use record-game-version.ts or the launcher patch check in place of wtotools check-offsets.
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.
Clearing missionSupportUnitRef as soon as the support unit died kept the
player from getting the vehicle back: the unit update (2.61.0.37
0xfd1450, 0xfd2f01 / 0xfd25a7) recognises the player's dead support
unit by that reference (unit +0x88 == MPlayer +0xb58) and only then calls
setControlledUnit(mp, 0) (0x598a70) to return control. In game the
camera stayed on the wreck until the player respawned.
Remember the player and the dead unit's entity id at the death, and
clear the reference after setControlledUnit has run for that player
(new hook, LMP_SIG_SET_CONTROLLED_UNIT, 2.61.0.37 hit 0x598a70), as
long as it still names that unit.
Checked with the native build and check-offsets; not yet verified in
game.
After the first nuclear carrier was shot down, the next launch respawned
it in the air where it died and the player could not fly it. The host
gives a player a support unit only while missionSupportUnitRef (MPlayer
+0xb50 / +0xb58) is empty (2.61.0.37 0x59d9c8), and the client clears
the reference only when the player is re-initialised, never during a
battle. The second launch reused the dead unit: control was refused
("changed controlled unit to already dead unit"), and without an owner
the respawn (0xe4fdf0) placed it at its old position instead of an
airfield.
Clear a player's reference when the unit it names dies (in the existing
onUnitDeadOnce hook, host only), so the stock update creates a new
support unit the next time the spawn score threshold is reached.
Checked with the native build and check-offsets; not yet verified in
game.
Online the battle server gives killStreak_bomber_nuclear_success (mode
killStreakNuclearSuccess, 10000 SL) when a player's nuclear bomb
explodes; the LocalMP host has no battle server, so the award was never
given.
The native nuke module now remembers whether the local player launched
the instant-win bomb and, when it explodes, raises the HUD script event
wtoLocalMpNuclearStrike. The battle record keeps it as a strike, sends
it live (wto_battle.fact kind "strike") and reports it after the battle
(strikes{}); the local service awards killStreakNuclearSuccess once per
strike, live as the award banner and in the settlement.
Checked with typecheck, check-gui, check-offsets and the native build;
not yet verified in game.
cta_logic_action walks the variable array with r15 = entry+8, compares the name
at [r15-8] and takes the value at r15+8 (0x11bd1a6), so the int value is at
entry+0x10; the nuclear win wrote the wrong field and the tickets stayed.
create_nuke_destr_area_es does not run on the LocalMP host. The projectile
explosion handler 0xbe7c00 gets the launch record's instant-win flag as its
8th argument (0x2fd778 / 0x2fd7c3) and is what plays the nuclear explosion,
so the winner is now taken there.
Online the battle server ends the battle when a bomb with isInstantWinOnExplode
explodes; the 2.61.0.37 client only flags the bomb, so the LocalMP host played on.
The host now remembers the team of a flagged bomb (0x1431c10), takes it as the
winner when create_nuke_destr_area_es runs (0x63caf0), and zeroes the loser's
mission ticket variable before cta_logic_action (0x11bc400), which then ends the
battle the stock way.
The header of local_mp_loadout.c still named per-unit economic multipliers that
the economy rework removed from the module. It now says what the module does: on a
host the client has no receiver for its own vehicle change request, so the send
hook builds the ChangeUnitReflection and calls Unit::changeAircraft. Comment only.
Checked: native build, check-offsets.
- Scoreboard scores come from the local service: BattleEconomy
missionScores() writes the official mission scores into the stock
mission block customScoreParams, which the client copies into
MissionSettings+0x6d8 without reading it; local_mp_scores.c reads them
with DataBlock::getReal. The hardcoded scores and the death score go.
- countActivePlayers already counts players with a living vehicle; the
only LocalMP gap is its filter skipping bots (MPlayer+0x1d8 bit 7). A
one-byte exe patch drops that filter bit instead of a rewrite hook.
- ucavLaunch returns early on a host; an exe patch skips that return
instead of clearing the global host flag around the call.
- onBecameDead no longer runs with isLocalMP cleared: that only queued an
EventOnPlayerDeath stock LocalMP skips on purpose, and broke the local
player id remap inside the function.
- The host chat object keeps its two-field layout, now documented from
the host chat handler that reads it.
The LocalMP host has no battle server, and the previous bridge filled the
gap by computing money in the client: the native ledger wrote invented
amounts into SessionStatsNet, the spawn patch derived reward rates from
warpoints.blk, and the settlement patch summed and rescaled the result.
Rewards came out as zero or several orders of magnitude too high.
Now the client reports facts and the local service prices them.
Native (wto_ws.dll):
- local_mp_ledger.c is removed together with its SessionStatsNet
offsets and four signatures (43 -> 39).
- local_mp_awards.c raises the HUD script event wtoLocalMpExpEvent for
every combat event of the local player (event code, victim expClass
and name, player or AI victim, friendly, naval damage). The DataBlock
helpers and the HUD event queue are resolved from call sites inside
GameSaveData::addScoreMessage, which already has a signature.
GUI patches:
- record-local-battle-awards records events and lives in nestdb and
raises the stock InBattleReward banner from launch-time parameters.
- report-local-battle-settlement sends only facts and rebuilds the
debriefing from the settled table; failures show the stock error box.
- use-settled-debriefing-stats makes gatherDebriefingResult read that
table instead of the empty stat_get_exp().
- pass-spawn-modifications-blk no longer computes economy factors.
Local service:
- battle-economy dataset reads every reward factor from wpcost.blk,
warpoints.blk and rank.blk; tuning/battle-economy.jsonc holds the
mission score per event with its source (official values where
published, otherwise marked).
- battle-economy.ts is the single pricing function, shared by the
banner parameters and the settlement; battle-rewards.ts adds battle
time, timed award, win/defeat bonus, activity, premium account,
talisman, skill bonus and free research points; the debriefing table
has the stat_get_exp() layout and travels in EULT_SESSION_RESULT.
- Crews earn skill points from the battle's research points.
- A battle left before it ends counts as a defeat.
Verified: npm run typecheck, check-gui (35 patches), check-patches,
check-offsets, native build. Not yet run in game.
Records the uncommitted battle-session work exactly as it was left
(local service matchmaking, settlement, chat, native LocalMP hooks,
battle gui/exe patches) so the following review and rework commits
show every correction as a diff against this state.
This commit is not reviewed and is known to be incomplete: in-game
testing reported wrong settlement rewards, single-country teams,
missing random/fixed supplement slots, misattributed hit messages and
other regressions. Do not merge this branch before the rework lands.