Commit Graph
170 Commits
Author SHA1 Message Date
N0VAN0M4LY 036a479aab feat(launcher): add map adaptation pack updates 2026-12-06 19:53:45 +08:00
N0VAN0M4LY aaae2e4187 feat(battle): wire Simulator EC/SP, Assault PvE, unlimited respawns, and RB/SB bombing zones
- Switch air_simulation_timeDelay_battles to the 15 stock air_i2m Enduring Confrontation missions with unlimited respawns and optionalTakeOff/allowEmptyTeams passthrough.
- Extract warpoints.blk respawn_points/TankSimulation (battle-spawn-rules v5) and enable Spawn Points in Ground Simulator using tuning/battle.jsonc simGroundInitialSpawnScore.
- Fix unlimited respawns for Nuclear Escalation, Air SB EC, and Assault PvE: send -1 for BotSystem numBotRespawns/numTankBotRespawns (verified at 2.61.0.37 0x11b27b1) and explicitly disable multiRespawn so maxRespawns < -1 does not activate Silver Lions respawn-cost gates (0x1268ab0).
- Enable bombing-zone score and reward pricing in Air Realistic (including sub-modes) and Air Simulator in addition to Air Arcade.
- Enable air_assault_pve and tank_assault_pve in BattleMatchmaker: extract PvE import rankRange windows (multiplayer-missions v6), filter by player mrank to prevent low-BR Fulda mismatches, lock local player to Team A, disable autoBalance, emit customBots/wtoPveMode=1, and read Assault team size and wave AI reward multiplier from tuning/.

Verified: root and launcher typecheck, stock .37 dataset/matchmaker/economy checks, and temporary game-copy build; in-game acceptance pending.
2026-12-06 17:43:25 +08:00
N0VAN0M4LY d73221092d chore(release): prepare launcher 0.1.6 2026-12-06 16:03:53 +08:00
N0VAN0M4LY b56c5eaf58 feat(ground-ai): build and load offline map navigation packs 2026-12-06 16:03:52 +08:00
N0VAN0M4LY 710c8ecaaa chore(repo): merge tank AI checkpoint for 0.1.6 2026-12-06 15:47:46 +08:00
N0VAN0M4LY b276e686b0 chore(ground-ai): checkpoint 3d replay and simulator work 2026-12-06 15:43:04 +08:00
N0VAN0M4LY d58ba9fb9b feat(saves)!: add offline crew editing
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.
2026-12-06 15:34:24 +08:00
N0VAN0M4LY 5786fee63b feat(ground-ai): add a replay trace and the AI lab viewer
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.
2026-12-06 13:53:52 +08:00
N0VAN0M4LY 0b841ce2a2 fix(ground-ai): follow up the Berlin decision layer review
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.
2026-12-06 13:53:51 +08:00
N0VAN0M4LY 038d897b1e fix(launcher): translate ground AI tuning labels 2026-12-06 01:53:54 +08:00
N0VAN0M4LY ee7bb12092 fix(ground-ai): finish single-vehicle combat decisions
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.
2026-12-06 01:51:00 +08:00
N0VAN0M4LY ee360a5042 feat(ground-ai): add the hull decision channel
Score driving behaviors and reuse the existing action handlers. Face the
main threat and support reverse travel on the navigation corridor.
2026-12-06 01:11:55 +08:00
N0VAN0M4LY 4e658cae9c feat(ground-ai): add the trigger decision channel
Estimate hit probability and request movement speed from the weapon solution.
Use visible aim samples, stock shell penetration, and separate burst paths.
2026-12-06 01:11:55 +08:00
N0VAN0M4LY 1590a2fea9 feat(ground-ai): layered perception, threat table and turret channel
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.
2026-12-06 00:03:55 +08:00
N0VAN0M4LY 4136021c8c feat(ground-ai): log battle statistics for comparing builds
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.
2026-12-05 22:49:31 +08:00
N0VAN0M4LY 77e4806ffc merge: bring main into feat/tank-ai-nav
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.
2026-12-05 22:14:34 +08:00
N0VAN0M4LY 58fde2030c fix(ground-ai): escalate repeated contacts with vehicles and wrecks
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.
2026-12-05 22:12:37 +08:00
N0VAN0M4LY 413bd55c54 fix(ground-ai): spread team routes, pass vehicles and keep off deep water
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.
2026-12-05 21:39:07 +08:00
N0VAN0M4LY ba947fe5b6 feat(ground-ai): follow baked navmesh paths with sliced searches
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.
2026-12-05 17:38:41 +08:00
N0VAN0M4LY e0a344708d feat(ground-ai): load baked navigation packs in battle
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.
2026-12-05 16:39:26 +08:00
N0VAN0M4LY 21ab1084a6 fix(navgen): bake crushable riExtra objects and true chokepoints
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.
2026-12-05 12:42:40 +08:00
N0VAN0M4LY dddcdde62c chore(launcher): bump version to 0.1.5 and add release notes
Launcher release / release (push) Canceled after 0s
2026-12-05 00:23:44 +08:00
N0VAN0M4LY 647eff35fe fix(battle): unblock LocalMP backup respawns and normalize unit names
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.
2026-12-04 23:56:13 +08:00
N0VAN0M4LY ed5296e0b8 fix(navgen): restore Berlin roads and terrain access
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.
2026-12-04 22:56:21 +08:00
N0VAN0M4LY c3cf4e3707 feat(launcher): auto-detect decal cache from selected or recorded game folder
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.
2026-12-04 21:09:57 +08:00
N0VAN0M4LY 49264b0326 feat(launcher): add client origin marker and stock restore removal flow
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/.
2026-12-04 20:38:08 +08:00
N0VAN0M4LY 29736870ac fix(launcher): split copied and hardlinked bytes in space-saving install progress
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.
2026-12-04 19:55:05 +08:00
N0VAN0M4LY 9e6e13895e fix(launcher): separate client removal from deleting disk files
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.
2026-12-04 19:55:05 +08:00
N0VAN0M4LY 12a573a333 feat(store): default free offline payment label to Direct Claim and make it tunable
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.
2026-12-04 19:55:04 +08:00
N0VAN0M4LY 429c5eec12 fix(clans): fix squadron timestamps, 20k RP cap, and configurable initial RP
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.
2026-12-04 19:55:04 +08:00
N0VAN0M4LY b3211b89cd feat(launcher): remember last selected directory in file and folder pickers
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.
2026-12-04 19:55:04 +08:00
N0VAN0M4LY 6f2d9f639b fix(navgen): qualify cover against source collision geometry
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.
2026-12-04 19:23:22 +08:00
N0VAN0M4LYandduduyagame f2e73c1cfe fix(profile): persist vehicle camouflage, loadout, and trim preferences
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]>
2026-12-04 17:47:09 +08:00
N0VAN0M4LY 4191d59168 feat(navgen): bake road materials and directional cover
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.
2026-12-04 12:36:07 +08:00
N0VAN0M4LY 688406bb76 fix(ground-ai): improve firing on the move
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.
2026-12-04 07:35:31 +08:00
N0VAN0M4LY 0167c3ea7d chore(ground-ai): adopt adjusted bot defaults
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.
2026-12-04 07:35:31 +08:00
N0VAN0M4LYandduduyagame 3282320fb7 fix(battle): show and debit confirmed backup vehicles
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]>
2026-12-04 06:24:34 +08:00
N0VAN0M4LYandduduyagame 6d0abf9caf fix(battle): award Air Arcade mini-base score
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]>
2026-12-04 06:13:21 +08:00
N0VAN0M4LY 194417a388 fix(battle): ignore non-player kills for firstKill and clamp assist loop
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.
2026-12-04 03:43:05 +08:00
N0VAN0M4LY 480496ca93 fix(launcher): skip and guard incomplete optional UHQ texture packs
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.
2026-12-04 03:42:49 +08:00
N0VAN0M4LY 428b2d3601 chore(launcher): bump version to 0.1.4 and add release notes 2026-12-04 03:23:43 +08:00
N0VAN0M4LY 2d3287937f feat(launcher): add Bot parameters tuning page for ground AI and lineup weights
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.
2026-12-04 03:22:50 +08:00
N0VAN0M4LY 0af4183cb1 merge(ground-ai): merge feat/tank-ai phase 1 into main 2026-12-04 02:50:48 +08:00
N0VAN0M4LY 85532cd930 feat(ground-ai)!: disable stock tankBot globally when AI script loads
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.
2026-12-04 01:06:04 +08:00
N0VAN0M4LY 651b023d2a fix(launcher): preserve skipped files during game updates
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.
2026-12-04 00:47:29 +08:00
N0VAN0M4LY 1d3e47b082 feat(launcher): allow changing the online update source
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.
2026-12-04 00:11:55 +08:00
N0VAN0M4LY ac35c25851 feat(ground-ai): add ready-rack dual-ammo bot spawn loadouts and shell switching
Select realistic ready-rack dual-shell loadouts for AI tanks on the local
server, inject them natively on bot spawn, and switch between anti-armor
and soft-target shells in battle:

- Add the loadout section to tuning/ground-ai.jsonc (lowReadyRackThreshold,
  topUpAmmoCount, primaryAmmoPct, secondaryMinRounds,
  penetrationCompareDistM), validated in ground-ai-tuning.ts.
- Add the tank-bot-ammo v2 dataset (apps/server/src/game-data/datasets/
  tank-bot-ammo.ts) reading primary cannon weapon name, capacity,
  firstStage/autoLoad shell ready-rack counts (excluding separate charges),
  and selectable shell modifications (using Lanz-Odermatt kinetic fields,
  cumulativeDamage, armorpower, and transitive reqModification chains).
- Add selectBotTankLoadouts (apps/server/src/battle/bot-tank-loadouts.ts):
  carry ready-rack count when >= 15 (top up to 22 when smaller or absent,
  clamped to gun capacity), skip SPAA/belt autocannons, pick highest-tier
  APFSDS/anti-armor primary (~80%) plus HE/HESH/HEAT secondary (~20%, min
  3 rounds) when available, and attach required addModification entries and
  per-tank wtoAmmo_<unit> strings to customBots when mode != stock.
- Hook Unit::changeAircraft (already located dynamically on .37 and .58) in
  native/wto-net/src/local_mp_loadout.c to assign the 24-byte
  ChangeUnitReflection.bullets entries via bullet_vec_assign for LocalMP
  bot spawns (async == 0, non-local bot MPlayer), leaving player spawns
  untouched.
- Track soft-target vs anti-armor shell classes in wto_ai_specs_common.das
  and write gun.nextBulletType in wto_ai_fire_common.das to queue HE/HESH
  against light/narrow targets and APFSDS/AP against MBTs/heavy armor.

Verified MSVC build of wto_ws.dll (0 warnings in project C sources), root
and launcher type checks, 14/14 check-patches on 2.61.0.58, 12/12 LocalMP
module installation, clean daScript load (wto_ai_runtime.das loaded in
211 ms, 0 compile errors), and real 2.61.0.58 loadout selection on
cn_ztz_96a (18 APFSDS + 4 HE), germ_leopard_2a4 (12 DM23 + 3 HEATFS),
ussr_t_80bvm (22 3BM60 + 6 HE), us_m1a2_abrams (14 M829A2 + 4 HEAT-MP),
ussr_t_34_1941 (18 APHEBC + 4 HE), and ussr_zsu_23_4 (stock belt kept).
Live battle acceptance begins in Step 9.
2026-12-03 19:25:04 +08:00
N0VAN0M4LY d5008baeff feat(ground-ai): add navmesh flank lanes, rally staging, recall, and air-aware SPAA
Complete the team commander layer with validated flank routes, coordinated
rally launches, dynamic cap recall, and air-threat-responsive SPAA:

- Add flank, rally, and recall parameters to the commander section of
  tuning/ground-ai.jsonc (flankMaxLengthRatio, flankMinSeparationM,
  rallyProgressFrac, rallyWaitSec, rallyMinFrac, rallyRadiusM,
  recallSafeHoldSec), validated in ground-ai-tuning.ts and compiled into
  WTO_AI_CMD_* constants.
- Add wto_ai_lanes_common.das:
  - Lazily build and cache per-(team, cap) center and left/right flank
    lanes using two-segment navmesh find_path_ex; reject flanks exceeding
    1.6x center path length or closer than 45 m to the center midpoint.
  - Stage offensive groups at the 40% rally point along their lane and
    launch once 2/3 of the group arrives or 25 s elapse, resetting on cap
    ownership flips.
  - Track enemy ground count and contested state on friendly caps,
    holding recall active until safe for 15 s; track enemy aircraft
    presence for team SPAA intel.
- Split mode planners and recall demand overrides into
  wto_ai_commander_plans_common.das; pull (enemies + 1) nearest support
  or reserve bots to defend contested friendly caps while always keeping
  at least one offensive assault bot.
- Update wto_ai_commander_anchors_common.das so SPAA follows behind the
  actual Assault group centroid and checks upward open-sky clearance when
  enemy aircraft are active.
- Wire WtoTaskOrder lane/relay/rally fields into wto_ai_route_common.das
  (replacing unvalidated wing relays and preserving corridor turning
  corners), wto_ai_tactics_common.das (rally staging hold), and
  wto_ai_runtime.das (1 s rally release check).

Verified root and launcher type checks, isolated 2.61.0.58 build (27
ground AI modules packed), and clean in-engine daScript compilation/load
(wto_ai_runtime.das loaded in 183 ms, 0 compile errors). Live battle
acceptance deferred until the full pipeline is wired.
2026-12-03 18:46:53 +08:00
N0VAN0M4LY 45ff082a36 feat(ground-ai): add sample-based lead estimation, exit watch, and bounded bias
Replace direct reads of true enemy velocity with an own-sight sample
estimator, add 2-5 s last-seen exit watching, and sample bounded aiming
bias once per shooting opportunity:

- Add the estimation section to tuning/ground-ai.jsonc (watchMinSec,
  watchMaxSec, velSampleMinSpanSec, velStableSpanSec, velJumpResetMps,
  baseAimSigmaM, leadErrorFrac, maxBiasM), validated in
  ground-ai-tuning.ts and compiled into WTO_AI_EST_* constants.
- Add wto_ai_estimate_common.das:
  - Maintain a 6-sample timestamped ring buffer from each bot's own
    visual sightings; compute smoothed observed velocity and convergence
    quality, dropping quality and re-seeding bias on sudden braking/turns
    or target switches.
  - On LOS loss from an active ground engagement, freeze watchPos at the
    last-seen exit point, clear observed velocity, and draw one random
    2-5 s watch duration; stationary overwatch/defend bots hold their
    post while watching, whereas pushing/retreating bots keep moving
    while keeping their turret on the exit.
  - Compute lead from observed velocity and loaded-shell flight time,
    sampling one bounded bias vector per shooting opportunity (target,
    shot count, state, 12 m position cell) that narrows as observation
    quality improves and still passes the single fire-permission gate.

Verified root and launcher type checks, isolated 2.61.0.58 build (25
ground AI modules packed), and clean in-engine daScript compilation/load
(wto_ai_runtime.das loaded in 184 ms, 0 compile errors). Live battle
acceptance deferred until the full pipeline is wired.
2026-12-03 18:23:12 +08:00
N0VAN0M4LY 80113bdd2e feat(ground-ai): add cover reload, stalemate reposition, and damage repair
Complete the single-vehicle tactical loop for reload survival, stalemate
breaking, and vehicle damage repair:

- Add cover, reload, hull-angle, stalemate, reposition, and repair-cover
  parameters to tuning/ground-ai.jsonc, validated in ground-ai-tuning.ts
  and compiled into WTO_AI_SM_* constants.
- Add wto_ai_cover_common.das: continuously record the last hard-concealed
  hull position before peeking, and evaluate 9 cover candidates around
  the tank (with enemy-clearance scoring when searching for a repair
  cover).
- Add wto_ai_tactics_actions_common.das and wire wto_ai_tactics_common.das:
  - Damage retreat & repair (plan 6.1): when gun is inoperable while
    mobile, retreat to an enemy-free cover and send
    EventRepairSystemRequestRepair(repair=true) once safe; when engine or
    tracks immobilize the chassis, halt in place, request repair, and keep
    gun self-defense active; stay halted while
    repair_system_remaining_repair_time > 0.
  - 3-way reload action: pull back into remembered/nearby cover (up to 6 s
    budget, uninterrupted by flashes/new orders) -> zigzag advance at
    +/-18 deg when pushing without cover -> angle hull front +/-15 deg
    when side-exposed >30 deg with pivot room.
  - Stalemate reposition: confirm outgoing effective damage via
    EventUnitDamage (uint(hpFixed) < uint(prevHpFixed)) and enemy death;
    trigger lateral reposition after 2 no-effect shots, 2 no-shot halts,
    or 12 s cumulative halt time, unlocking short-halt only after 20 m
    progress or reaching the new position.
- Split periodic telemetry out of wto_ai_runtime.das into
  wto_ai_diag_common.das to keep every module under 300 lines.

Verified root and launcher type checks, isolated 2.61.0.58 build (24
ground AI modules packed), and clean in-engine daScript compilation/load
(wto_ai_runtime.das loaded in 228 ms, 0 compile errors). Live battle
acceptance deferred until the full pipeline is wired.
2026-12-03 18:14:43 +08:00