Add per-country crew slot controls and skill level previews to the launcher. Keep archived crews and their stable IDs in the save, update affected lineups, and back up the save before closing a slot.
Verified with both type checks, the launcher build, 2.61.0.64 patch checks, and temporary save read and write checks.
BREAKING CHANGE: The launcher automatically upgrades existing saves to format 4. Keep a pre-upgrade backup to use a save with an older launcher.
Battle behaviour could only be judged by watching one bot at a time. The
AI now logs a replay trace and a local viewer plays it back on the map.
Game scripts:
- wto_ai_trace_common.das writes every diagnostics.traceIntervalSec the
capture zones (WTO_AI|TRACE_CAP), every ground unit including players
(TRACE_U) and each bot's decision state (TRACE_B: order, behavior,
targets, what the turret looks at and why, barrel heading, fire denial,
hit probability), plus part damage with its offender (HIT) and deaths
(DEATH). It uses no engine module so a simulator can load it as is.
- The turret state records the reason and world direction of each look.
- New tuning diagnostics.trace and diagnostics.traceIntervalSec through
server reader, patcher constants, launcher schema, fields and labels.
packages/ground-sim: readers for the baked .wtonav pack (mesh polygons,
cover points, tactical grid) and .pois.json, the trace parser and the
names of the logged codes.
apps/ai-lab: Vite viewer with a local API that lists nav packs and lab
logs and decrypts a chosen .clog with wtotools. It draws the nav mesh,
vehicles, barrels and wished turret directions, goals, target links,
shots, hits and deaths over a timeline, with per-bot strips for behavior,
fire denial and turret reason. Paths live in an untracked lab.local.json.
The lab has its own tsconfig and stays out of the root typecheck.
Root and launcher typechecks pass; the lab typechecks and replayed two
lab battles.
The first battles with the single-vehicle decision layer showed bots
sensing from a stale turret direction, fixed mounts and elevation-limited
guns that never got the hull turned for them, and bots braking late for
vehicles and wrecks.
- Perception samples the live barrel before sensing; near, mid and sight
arcs are all measured from the barrel, and visible near and mid contacts
in the barrel's front half are ranked with the same danger model.
- The turret may swing to a contact before it is confirmed; the trigger
still waits for visual confirmation.
- A short halt only brakes. A fixed mount beyond its yaw span
(turret.fixedMountYawSpanDeg) asks the hull to turn; an elevation-limited
gun asks for a hull turn only when the stock elevation table shows the
turn opens a sector that reaches the target.
- Friendly and enemy vehicles and wrecks take part in front and rear
dynamic braking; detours try the sides, then backing off.
Builds and loads on the 2.61.0.64 lab client; played in three lab battles
together with the replay trace.
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.
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.
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.
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.
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.
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.
Reuse source scan exclusions during stale-file cleanup so updates preserve user content and tool files copied by earlier installers.
Verified with root and launcher typechecks and an update run against temporary folders.
Let registered clients set or replace their online installation source
from the maintenance page. Validate the source and persist its path
before refreshing the available update status.
Verified launcher and workspace type checks, a launcher build, and an
incremental update of a registered client using local game snapshots.
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.
Electron patches node:fs to treat any .asar file on disk as a virtual
archive directory. When a player's War Thunder source directory contains
an .asar file (for example from a leftover portable launcher folder
previously unpacked inside the game folder), createReadStream fails with
ENOENT and aborts full-copy installation.
Changes:
- Add rawFs() helper using Electron's original-fs (with node:fs fallback)
and use it across copy-game.ts and change-copy-files.ts for directory
scans, streaming copies, timestamp preservation, rollback and cleanup.
- Preserve the first non-cancellation worker error in copyPlannedFiles so
sibling AbortError rejections do not mask the real filesystem or
hardlink error.
- Skip nested subfolders containing WTOffline Launcher.exe during
planCopy, and reject copy installation upfront with
launcher_inside_source when the packaged launcher itself runs from
inside the selected source game directory (with en and zh-CN messages).
Verification:
- Root and launcher typecheck passed.
- Launcher electron-vite build passed.
- en.json and zh-CN.json key parity check passed (720 keys).
- Verified in Electron that patched node:fs reproduces ENOENT on
default_app.asar while original-fs copies and cleans it up cleanly.
- Packaged installer end-to-end verification pending.
Spawning powershell.exe directly with Node detached: true sets DETACHED_PROCESS (no console), causing Windows PowerShell 5.1 ConsoleHost to exit silently with code 0 before running -File. Spawning without detached lets it run, but Electron tears down attached children on app.quit(). Launch the apply script via a short hidden PowerShell Start-Process helper before quitting, properly quoting paths with spaces or non-ASCII characters, and clean up staged files if launching fails.
Exclude UserSkins and UserSights from stock client scans as player data folders (matching UserMissions and keeping them protected from symlink redirection during launch), and skip WarThunderCDK plus official launcher/updater log and obsolete folders when copying, sizing, or incrementally updating from a stock installation.
Verified: root typecheck, launcher typecheck, and launcher electron-vite build pass; runtime copy test pending.
Keep the About page launcher update notice compact by showing only the available version, package size, and action buttons, with a compact button to open a scrollable release notes dialog when notes are present. Render GFM Markdown safely into React elements via marked.lexer without injecting raw HTML, and raise the release notes cap from 1,600 chars to 64 KiB so full bilingual notes are preserved.
Electron patches node:fs to treat .asar archives as virtual directories, so portable update verification failed on staged resources/default_app.asar and recursive cleanup could leave staging folders behind. Switch staging lstat and cleanup rm in portable-update.ts to original-fs (falling back to node:fs outside Electron), strip unused resources/default_app.asar during packaging so already-released 0.1.2/0.1.3 portable builds can update cleanly to future releases, and include portable-update.log in exported diagnostics.
Replace the local offline HTML mod docs viewer in the launcher Mods page with a direct link to https://wto-project.net/mod-docs, remove the unused mods:openDocs IPC path and resource entry, and drop build-mod-docs-html.ts from Windows packaging while keeping bundled mod templates intact. Root typecheck, launcher typecheck, and electron-vite build passed.
Add a Project homepage card and button pointing to https://wto-project.net on the launcher About page with matching zh-CN and en locale entries. Root typecheck, launcher typecheck, electron-vite build, and locale key parity checks passed.
Replace the single GitHub repository field in release-channels.jsonc with primary_source (https://dl.wto-project.net) and ordered fallback_sources (GitHub), and update withReleaseSources to walk the deduplicated primary, player mirror, and fallback list while keeping preferred-source downloads and Ed25519 signature verification intact. Verified with root and launcher typecheck and launcher production build.
Modern online War Thunder clients (verified on 2.61.0.58) ship their decal and
skin indexes (dldata/downloadable_decals.blk and dldata/downloadable_skins.blk)
inside cache/binary.<ver>/regional.vromfs.bin rather than downloading
downloadable_decals.<hash>.blk into cache/content/. Requiring
downloadable_decals.<hash>.blk rejected every live 2.61 cache/content folder.
- Accept modern online caches containing cached .ddsx textures alongside a
sibling binary.<ver>/regional.vromfs.bin (as well as selecting the parent
cache folder or legacy downloadable_decals.<hash>.blk caches).
- Extract both dldata/downloadable_decals.blk and dldata/downloadable_skins.blk
into a self-contained .wto-index snapshot on launcher import (excluded from
the copied game cache/content folder) and embed them into char.vromfs.bin
during copy build so webdlcontent::init mounts cache/content and resolves
cached real decals and downloadable skins natively without client patches.
- Log the specific rejection reason in launcher decal import and clarify the
en/zh-CN prompts.
Verified with root and launcher npm run typecheck, launcher electron-vite
build, and an end-to-end temporary import + char.vromfs.bin build against a
read-only 2.61.0.58 online cache (4,080 decals / 1,930 skins embedded).
In-game acceptance pending on an isolated 2.61.0.58 client copy.
In the launcher's Saves -> Vehicles & Research page, "Research all" only
filled vehicle RP without purchasing them, requiring players to buy each
vehicle manually in-game while a separate "Grant regular vehicles" button
already added them to the hangar.
Merge the two actions into a single "Research and buy all" (`purchase`) action
alongside "Unlock modifications" (`equipment`), and switch bulk modification
unlocking in save-research.ts to ProfileEquipmentIndex so large saves stay
O(N) and write cleanly across chunked modification blocks.
Verified with root and launcher npm run typecheck, launcher electron-vite
build, and en/zh-CN locale key parity (631 keys).
Connect stage-unlocked nuclear carriers to Air Realistic sub-mode 103
(Nuclear Escalation) and expose a player toggle for stage-3 megaton
strategic bombers:
- Dataset & profile grants: extract tactical killstreak nuclear carriers
(5 kt / 30 kt Nuclear Escalation presets) and megaton strategic bombers
(nt_b_52h / nt_tu_95m) from wpcost.blk in battle-spawn-rules (v4), and
grant their required weapon/modification records in
support-plane-modifications.ts.
- Server slot selection & tuning: add nuclearEscalationStrategicBombers
(default true) in tuning/battle.jsonc, battle-tuning.ts, and
launcher-tuning.ts; add one nation-matched tactical carrier per session
rank bracket (with allowedWeapons limited to its Nuclear Escalation
presets) and, when enabled, one stage-3 strategic bomber to
extraBattleSlots; include modeTag in battle launch notifications.
- GUI patch & launcher UI: add battle/filter-extra-slot-weapons on
scripts/weaponry/weaponryinfo.nut to filter extra-slot presets by
allowedWeapons (hiding Ground RB zero-yield presets at stage 0) and to
fall back to LocalMP launch metadata for GameModeRestrictions; expose
the strategic bomber toggle in the launcher Battle tuning section.
Verified with root and launcher typechecks, launcher build, full
check-gui on 2.61.0.37 and 2.61.0.58 (49 patches across 37 .nut files),
and slot selection check across all 10 nations on 2.61.0.58 stock data;
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.