Compare commits

...

169 Commits

Author SHA1 Message Date
chexit 747f385244 Enable autonomous TZM road, bridge, stairs, and lift engineering and add AGENTS.md auto-push rule
build / mod (push) Successful in 30m40s
2026-12-05 23:56:14 +03:00
chexit 02f99c31f6 Fire P1-SUN on network fire plots, make S-400/S-500 launchers only, give radars own models
build / mod (push) Successful in 30m51s
Gameplay fixes and art from the owner's balance review of 2026-12-05.

- The P1-SUN never launched (0 launches in 12 seeds of a 196-target raid): it
  has no radar of its own and only a separate launcher could fire on another
  station's plot. A unit without its own radar now fires like one
  (`why::on_network`), on the fresh own fire plot of an engagement or
  multifunction radar within link reach. Seven P1-SUN then launch 26-42 and
  kill 13-24 per raid; the leak count does not change.
- The С-400 and С-500 exist only as separate launchers (`mode: "launcher"` in
  the catalog). The `s400_launcher`/`s500_launcher` variants and their remotes
  are gone: `deploy s400`/`s500` and their remotes place a launcher. A system
  saved with its own radar loads as a launcher; `battery <n> integrated` is
  refused for these kinds.
- Every radar role has its own model: a wide curved array (search), a
  parabolic dish (engagement), a small head on mast sections (height); the
  multifunction radar keeps its panel, the optical post gets its own post and
  a turning head with a lens. A variant may carry its own `parts` in
  `catalog/content.json`; `Sam::parts()` resolves them.
- The enemy remembers the sides each approach raided from: a raid ordered the
  same way and within 200 blocks of the same distance comes from the same
  sides, so its sites stand where the last ones did. A launch area the radars
  fixed is remembered (up to 32): a site placed there again is known before
  its first launch and can be struck at once. Neither is saved yet.
- `sim/balance.rs` flies several raids over one cluster with stocked depots
  (`supply_raids`). With the 16-block depot reach, depots 30 blocks from the
  batteries leave 10 / 36 / 80 leaks over three raids against 6 / 10 / 17 for
  depots within reach; the reach itself is unchanged by decision of the owner.

The saturation checkpoint is re-recorded (123 kills / 323 launches instead of
129 / 344): that loadout has no fire radar, so its С-400/С-500 fire less as
launchers.

Verified: airdef-core release 363 passed and 8 scenarios; airdef-mod 135 passed,
1 boundary, 2 saturation, 5 scenarios; gen_catalog/gen_models/gen_sounds --check;
test_gen_assets, test_model_bounds, test_web_panel; git diff --check. Not run:
the actual WASM contract, the models in game, CI.
Co-Authored-By: ZCode <zcode@localhost>
2026-12-05 23:38:14 +03:00
chexit 817b5b7e9f Use translucent Minecraft menu background and preserve opaque map ground
build / mod (push) Successful in 30m37s
2026-12-05 22:24:33 +03:00
chexit 48ec72d3d2 Redesign in-game menu with tabbed canvas UI and add logistics routes, secondary detonation, and RM48U tracking
build / mod (push) Failing after 15s
2026-12-04 14:16:21 +03:00
chexit 76ef94b537 Add typed depot logistics visibility, auto-strike, 16-block reach, and web panel controls
build / mod (push) Failing after 15s
2026-12-04 13:37:54 +03:00
chexit a02b7d1177 Update the AirDef development handoff
build / mod (push) Successful in 30m50s
2026-12-02 18:53:16 +03:00
chexit fc04adcd39 Keep live object rows readable during dense raids 2026-12-02 18:53:16 +03:00
chexit f6303fe4d4 Keep heavy AirDef batteries available for confirmed missile threats 2026-12-02 18:52:41 +03:00
chexit 20fdb23b39 Show live Horizon terrain and radar views in the web panel 2026-12-02 18:52:41 +03:00
chexit 7612d15963 Finish AirDef catalog, route, stock and observation fixes
build / mod (push) Successful in 30m46s
Refs #91, #114, #118, #135. Show the latest recorded unit decision in the native card (#153).
2026-12-02 18:22:22 +03:00
chexit 9e0cec13f2 Add battle timeline markers and incremental web map updates (#153)
build / mod (push) Successful in 30m14s
2026-12-02 11:54:02 +03:00
chexit 906159b17f Add the AirDef tablet web panel and battle archive (#153) 2026-12-02 00:46:18 +03:00
chexit dfb306edd7 Record unit decisions and show their replay moments (#153) 2026-12-02 00:01:03 +03:00
chexit b882dc3c2b Open the unit card from the visible model (#153) 2026-12-01 23:43:14 +03:00
chexit 5e3907aa99 Keep battle reviews reachable and tied to the recorded outcome (#148, #153) 2026-12-01 23:03:40 +03:00
chexit bf558c024e Add a command post and shared unit cards (#153) 2026-12-01 22:55:45 +03:00
chexit 7e6d9d8b9a Add village defense campaign and breakthrough reports
Co-Authored-By: Codex <noreply@openai.com>
2026-11-26 01:12:38 +03:00
chexit aa842d8a1f Fix raid gameplay, finite ammunition and truck routing
Check launch terrain, reserve ballistic targets for marked objectives, tune in-game reach and fallback fire, and support bounded terrain work on supply routes.

Co-Authored-By: Codex <noreply@openai.com>
2026-11-25 18:53:17 +03:00
chexit 61c4fa5cee Pin the HD light masks and record RTX 3060 benchmarks (#147)
build / mod (push) Failing after 18s
Measure matching DLSS and native TAAU modes on Windows before and after the renderer changes. On the 480-light graphics fixture, the masks improve 37.0 to 41.6 FPS with DLSS. The same candidate reaches about 58 FPS with TAAU in fullscreen.

Verified the GPU output on the RTX 3060 with a static capture, 36 HD tests including shader translation, and the separate Metal TAAU test.
2026-11-24 19:40:42 +03:00
chexit aaf72ef171 Fix HD benchmark reporting and record renderer A/B results (#147)
build / mod (push) Failing after 17s
Resolve benchmark input paths before switching to the disposable game home and report startup failures without a missing screenshot traceback. Capture the executable hash and keep report environment metadata limited to benchmark settings.

Record the earlier light and smoke measurements and the repeated idle A/B runs. Verified with 18 Python benchmark tests, 36 Horizon HD tests, the Metal TAAU smoke test, and the real idle launch and error paths.
2026-11-24 18:24:00 +03:00
chexit 4b8fef6d8a Point horizon at the HD light-tile and smoke-skip fixes (#147)
build / mod (push) Failing after 10s
The engine's kimi-work-124 moves b4c68a78b..4215e8999:

- The light tiles keep the whole screen's lights in one global list instead
  of a copy per tile, and the tile lists no longer overflow into "every
  light on every pixel". In a raid the render phase of the window thread was
  27-83 ms of CPU a frame on an M5 at 1440p (tile_lists 21-25% of the thread
  in a sample); it is 5-13 ms now.
- The fog's march skips the steps that stay inside an empty brick of the
  smoke grid: about -11% of the GPU time where a raid's replay still has
  smoke, nothing where it has none.

Neither changes the picture: on one paused frame of a recorded raid, with
and without each (the smoke-skip and light-tiles diagnostics), the pixels
that do not depend on the wall clock are the same to the frame-to-frame
flicker of one level. The water is not compared: it moves with the clock.

Not explained: in the early windows of a replay some frames take 100-230 ms
with 45-55 ms of GPU and 20-30 ms of CPU. The engine before the fixes shows
it too.
2026-11-24 17:09:08 +03:00
chexit 9b8ef1bcc8 CI: keep the per-push job inside the runner's disk (#102)
build / mod (push) Failing after 9s
Run 140, the first green build since 2 November, knocked Gitea's database
over: from 19:42:52 UTC, right after the mod test binaries were written,
the API answered 500 and 401 and ssh said 'the database system is in
recovery mode' until 19:53:28, eighteen seconds after the job had ended and
its workspace was gone. The tests themselves are innocent (ground_oom peaks
at 113 MiB RSS); what the job leaves behind is not. rustup installed stable
and then the pinned 1.99.1 on top of it (about 1.1 GB), and the debug test
targets of the core and of the mod (669 MB for the mod alone) stayed on
disk through the release build. The runner shares that disk with Gitea and
its database; on 6 November release.yml found 1 GB free there.

The job now installs only the channel pinned in rust-toolchain.toml, deletes
each test target directory once its step is done, and refuses to start with
less than 4 GB free, with the same ::error:: wording as release.yml, after
printing df and free into the log. Both test suites stay complete.

Not verified on the server (no access there). The log now shows the free
space at the start, so the next run confirms or corrects the diagnosis.
2026-11-23 23:08:04 +03:00
chexit d9431468c1 gen_models --check: compare PNGs by their pixels, not their bytes (#92)
build / mod (push) Has been cancelled
With Pillow installable again, build.yml failed one step later: on the Linux
runner 171 generated PNGs (every item icon) differed from the committed
files. Their pixels are identical (sha256 of the decoded rasters matches
the macOS ones byte for byte); only the deflate stream differs, because the
zlib inside the Pillow wheel is built per platform and Python version. The
manifest's byte hashes are not portable, so the check could only pass where
the assets had been generated.

--check now treats a PNG whose bytes differ as unchanged when it decodes to
the same mode, size and pixels, and only while the file still matches its
manifest row: a hand-edited file stays a conflict. Writing (a run without
--check) and the manifest stay byte-exact.

Verified: a copy of airdef-mod with all 175 manifest PNGs re-encoded
(stored blocks) and the manifest rows updated passes --check; the real tree
still reports no differences; tools/test_gen_assets.py OK (13 tests, two
new: a re-encoded icon is accepted and then rewritten by a real run, another
picture and a hand-edited icon are still reported).
2026-11-23 22:31:21 +03:00
chexit 5ac72287f4 CI: let pip install the pinned Pillow into the externally managed runner Python (#102)
build / mod (push) Failing after 39s
Since 2 November build.yml has failed before its first test: gen_models.py
--check needs Pillow, and python3 -m pip install --user refuses the system
Python of the catthehacker/ubuntu:act-latest image (PEP 668,
externally-managed-environment). The job container is disposable, so
--break-system-packages with --user is safe here.

No step order or limit changes; the checkout, fork and Rust steps already
passed and are untouched.
2026-11-23 21:56:22 +03:00
chexit 6616d58a3e Resolution Scale: 100% is DLAA (1:1), monotonic; docs + test-dlss.bat
build / mod (push) Failing after 33s
Point horizon at b4c68a78b (the slider is monotonic: 100% renders 1:1 DLAA,
80% no longer renders larger than 100%). Update the scale docs and pin
test-dlss.bat to HORIZON_HD_SCALE=0.67 for the upscaling A/B (empty would now
be DLAA at the slider's 100%).

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-22 12:24:27 +03:00
chexit b8049674bb engine: the Resolution Scale slider drives HD render scale (DLSS included)
build / mod (push) Failing after 33s
Pin horizon to 4e441de6a (agent/resolution-scale): hd::scale_override used
to pin the HD world at 2/3 whenever DLSS was enabled and its SDK open, so
the Resolution Scale slider (50-200%) was ignored — pixel-identical image
and unchanged FPS at every step. Now the slider drives the world target and
the DLSS render size live, no restart: film quality, then HORIZON_HD_SCALE,
then the slider; with DLSS the render scale caps at the output (100% keeps
the 2/3 auto ratio, above 100% renders at the output — supersampling is
native TAAU's with DLSS off), without DLSS the slider applies as-is
including above 1. The jitter and motion globals match the new size on the
very frame it changes; the NGX context is kept while the render size fits
its dynamic-resolution range, and the histories reset on every scale
change. The #143 motion/jitter contract (MVJittered, render-pixel jitter,
MV scale [1,1]) is intact.

Verified on Mac (M5/Metal, no DLSS device): lib suite 1243 passed, new GPU
test the_world_target_follows_the_resolution_slider (50/100/200% target
sizes + live resize + hd_scale precedence), taau_gpu_smoke_still_surface_ab,
non-dlss build, and a Windows-gnu cross-check of the dlss-gated code against
the NGX v310.9.1 headers. DLSS evaluation awaits RTX.

Docs: DLSS-TESTING.md documents the scale semantic, the live-update
mechanism and the RTX verification checklist (slider changes the DLSS
render size + FPS, no shaking regression, context reuse, fallback logs);
HD-RENDERER.md's scale references follow the slider.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-22 12:05:45 +03:00
chexit 24f3485ebb save: assemble the air section with write! instead of += &format!
build / mod (push) Failing after 30s
Sim::air_text built the save text with `head += &format!(...)` per contact
and `line += &format!(...)` per relief run, and Drone::air_line did the same
for a route point. Each of those allocated a temporary String and re-copied
the whole growing buffer, so the cost was quadratic in the section's size.
The head is not covered by the fits check (only the drone/queue body is): up
to 8 relief grids of 40k run-length tokens each plus 4096 contact lines. On a
heavy raid the autosave's tick therefore exhausted its 300M fuel while
formatting — the crash was in Sim::air_text.

Format directly into the buffer now (std::fmt::Write, push_str, push), which
grows it amortized with no per-token temporary. Nothing else changes: the
format, every MAX_* bound and the byte-budget logic are untouched.

The output is byte-identical: the same air_text over a relief-heavy raid
state and over the 600-drone byte-bound state hashes and measures the same
before and after (64a1787d37047447, 894 and 747942 bytes).
2026-11-21 18:46:19 +03:00
chexit 5737b47dc5 record: thin track points on the caller's grid; extreme-load test; re-pin the stale budget stats
build / mod (push) Failing after 59s
The points budget first gated on (recording tick - first) % step, but a strike
carrier's samples fall on its flight-age grid, offset from the recording's
ticks — the gate skipped them (physical_strike_track_keeps_muzzle... failed).
Count the sampling calls per track instead (Track::due): at STEP it pushes
every call exactly as before, and the thinning doubles the interval without
touching the track's phase. Track::points_len exposes the count for diagnostics.

tests/ground_oom.rs gains the continuous extreme load (eight overlapping
40-Oreshnik waves, 1118 objects airborne at once — well past the crash's >200):
peak 26.3 MiB steady + 5.5 MiB rehash transient, the flight tracks thin to
step 16 (91k points, 2.3 MiB) under their 2 MiB budget, the journal and poses
stay within theirs, and the fight still resolves (157 intercepts). The radar
picture itself (11.5 MiB at 1118 airborne) scales with the sky — it is the
simulation's state, not a cache, and is ~3 MiB at the crash's >200 load.

The WASM budget fixture's final /airdef stats pin was stale at the base commit
already: it was measured on engine 8e711f969, and the base pins acfb379aa,
whose host answers shift the two late Smart raids (417/2463, 7 in the air).
Verified identical on the pristine base and on this branch — the memory bounds
do not move that fight; the tick-2102 checkpoint (184/325/2011) is unchanged.
Re-pinned to the measured string and updated BUDGET_ASSERTED_SHA256 so the
raid/snapshot assertions stay active. test-budgets: 283 steps ok, tick fuel
max 184.7M/300M, 0 failures.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 17:57:51 +03:00
chexit dc87c0b98a sim: bound the ground cache and the recording under the 64 MiB WASM budget
The fullscreen-map OOM (rust_oom in hashbrown reserve_rehash under
Ground::answer during a large raid): the mod's whole state shares one
64 MiB linear memory, and three consumers grew without an effective bound.

Measured on a native replica of the crash load (tests/ground_oom.rs: 64
complexes, six all-sides Oreshnik raids plus a smart raid over 10000 ticks,
304 objects airborne at once, a wide map query walk; render answers exactly
as the WASM host gives them): peak 45.5 MiB steady + 21.9 MiB rehash
transient = 67 MiB, over the cap. The bulk: kept replays 23.2 MiB (the scene
journal 4.6 MiB each, filled with per-radar track transitions), Ground.known
10.9 MiB (277k columns; the old sweep only ran above 300k and kept everything
younger than 2000 ticks, so a wide query pattern grew it without bound and
the next rehash doubled the table), the live recording 7.5 MiB, radar tracks
3.2 MiB.

Bounds, derived from the 64 MiB budget (Sim::memory reports each consumer):
- Ground.known: KNOWN_MAX 100_000 columns (~2.7 MiB steady, ~8.2 MiB through
  a rehash at 24 B + control byte per entry, 7/8 load). Over the cap the
  oldest answers go down to three quarters (a sweep is not every tick),
  ordered by (age, column) so the sweep is deterministic; heights past
  SWEEP_AGE go with them. Evicted columns are asked again when next needed —
  the cache is reconstructible, no target, frequency or precision is cut.
- Scene journal: MAX_SCENE_EVENTS 65_536 -> 24_576 (~1.7 MiB), and the track
  transitions (acquire/handoff/lock/lost — they grow with systems x contacts,
  the journal's bulk under a large raid) get their own 8_192 budget; beyond
  it the later ones are not recorded. Launches, fires and outcomes keep the
  rest of the journal; chains() already tolerates missing steps.
- Flight track points: MAX_TRACK_POINTS 2 MiB per recording; over it every
  other point is kept and the ticks between points double (Track::step, the
  #142 decimation pattern for the systems' poses). Replay readers use the
  track's own step.

Replica peak after: 24.5 MiB steady + 5.5 MiB transient = 30 MiB, under the
48 MiB headroom target; the fight resolves (376 intercepts, sky clears) and
the same seed replays the same ordered trace. The saturation checkpoint is
untouched (314 / 2022 / 184): its cache stays under the cap.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 17:55:54 +03:00
chexit 4dbe103f5b sim: account where the mod's memory goes (Sim::memory, per-cache bytes)
The fullscreen-map OOM (Ground::answer rehash under a large raid) needs a
measured breakdown, not a guess: Sim::memory estimates each consumer's
allocated capacity (hashbrown tables with their control bytes, vec capacities,
BTreeMap nodes) — Ground.known, WorldCache.secs and rays, the sim vectors and
radar tracks, the recording and kept replays, Intel/recon, routes, sites,
strikes, the raid plan. MemoryReport::rehash_headroom names the transient a
rehash adds (old + new table of the biggest map). Ground::known_len exposes the
column count the budget tests guard.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 17:55:54 +03:00
chexit dca35dc9a2 Point horizon at the 512 MiB mod-memory cap; re-baseline the budget final stats
build / mod (push) Failing after 30s
The larger memory cap shifts the heavy scenario's final stats slightly
(417/2463, fewer pending sections); deterministic across runs, fuel
failures still 0. The tick-2102 checkpoint is unchanged.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 17:53:20 +03:00
chexit 3a992e7369 Point horizon at the DLSS temporal-stability fix; document the RTX checks
build / mod (push) Failing after 31s
Engine agent/dlss-temporal-stability (a791e8439 -> acfb379aa):
- f536fa958 DLSS: declare the jittered motion vectors (MVJittered). The create flags left
  MVJittered unset, so NGX applied the jitter offset on top of the already-jittered motion
  buffer — the camera jitter counted twice, the severe shaking. Contract verified against the
  DLSS Programming Guide (31 March 2026) §3.6.1-3.6.3/§3.7.3/§3.8.1, nvsdk_ngx_defs.h and
  Streamline's dlssEntry.cpp (pixel-space vectors take MV.Scale 1.0; the {1/w,1/h} advice is
  Streamline's own constant, scaled back by its plugin).
- 26ee82398 Native TAA: a reactive mask for water (its own depth, binding 7; less history where
  the waves/glint animate fastest, faded to 96 blocks) + the wind-motion contract test.
- acfb379aa Wind-blown leaves and plants carry their own motion vectors (previous frame's wind
  time/strength in Globals.hd_motion.zw, terrain.wgsl wind_offset_at).

Verified on Mac (no RTX): horizon-client --lib 1242 passed / 0 failed; taau_gpu_smoke on Metal
(fixed decode at the spatial filter's error floor, phase spread 0.0029 vs legacy 0.0156); naga
validation + HLSL translation of every HD shader and terrain/entity; frame/global layouts;
deterministic jitter/reprojection fixtures; non-dlss binary build; clippy clean on the touched
files. NGX evaluation itself awaits RTX — docs/DLSS-TESTING.md has the verification steps and
three fallback variants (jitter sign/axes, Streamline-style scale, non-jittered conversion pass).

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 16:56:38 +03:00
chexit f7ec0a3373 Docs: battery variants deploy by remote or command, not the removed N-menu page
build / mod (push) Failing after 30s
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 16:48:01 +03:00
chexit 4d7815834d Give each battery variant its own placeable remote
build / mod (push) Failing after 28s
Every catalog variant now has a `airdef:deploy_<id>` remote in `give` and
in the hotbar: deploy_radar_search, deploy_radar_track, deploy_radar_height,
deploy_s400_launcher and deploy_s500_launcher. The variant rows carry their
remote item in the generated catalog, and the inventory appends them after
the existing remotes so no ordinary remote changes slot.

Placing a remote now resolves the item back to its (kind, mode, role)
configuration and settles the system, the same path `/airdef deploy <key>`
already used. The base remotes keep deploying the ordinary integrated,
multifunction system; the radar remotes place Search/Engagement/Height
profiles, so radar_track gets fire authority and the others do not.

The N menu's battery-deploy page is removed entirely (button, page and its
handlers); variants remain available through `/airdef deploy` and now the
remotes. Items, icons (aliased to the unit silhouettes), lang entries and
generated assets are regenerated from the content catalog.

Checks: gen_catalog.py --check, gen_models.py --check, test_gen_assets (11),
airdef-mod lib 115 + integration suites, airdef-core 327, cargo build.
2026-11-21 16:44:23 +03:00
chexit b735458dd8 Point horizon at the DLSS colour filterable-texture fix (#124)
build / mod (push) Failing after 29s
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 16:08:53 +03:00
chexit 74baf8b4e2 Document the libclang auto-install
build / mod (push) Failing after 29s
The zero-step Windows+RTX toolchain now also covers libclang: LLVM is no
longer a build prerequisite, the detected or downloaded directory is
passed as LIBCLANG_PATH, and the cache layout gains
.horizon-cache/libclang/<version>/. Manual override (winget install
LLVM.LLVM + LIBCLANG_PATH) and the Unable to find libclang troubleshooting
note remain.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 15:55:14 +03:00
chexit 67e8a19e2b Auto-install libclang for bindgen on Windows + NVIDIA RTX
The DLSS build failed on Windows at dlss_wgpu's bindgen step: libclang.dll
is neither in the DLSS SDK nor in the Vulkan headers. It is now part of the
same zero-manual toolchain.

Detection first, download last: an explicit LIBCLANG_PATH (directory with
libclang.dll or clang.dll) wins and disables auto-install; otherwise PATH,
Program Files\LLVM\bin (both Program Files roots) and LLVM shipped with
Visual Studio (vswhere -find VC\Tools\Llvm\x64\bin\libclang.dll) are
checked, then the cache.

When nothing is found, the NuGet package libclang.runtime.win-x64 is
downloaded (~34 MB, version from the flat-container index with pinned
23.1.5 fallback) and only runtimes/win-x64/native/libclang.dll (~89 MB) is
extracted to .horizon-cache/libclang/<version>/ behind the existing
staging + airdef-install.json marker pattern. The resolved directory is
passed to cargo as LIBCLANG_PATH.

libclang is resolved only when the DLSS SDK and Vulkan headers are already
available, so a missing SDK never triggers a useless download. Any
detection/download/extract failure warns and degrades to mods/TAAU, and
non-Windows/non-RTX still returns before any network access.

Tests cover PATH/Program Files/vswhere detection, explicit precedence,
numeric NuGet version choice and fallback, selective extraction and marker,
cache hit, damaged cache reinstall, package without the DLL, plan env
wiring and failure to mods-only.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 15:55:12 +03:00
chexit e61b2e8f64 Cover mixed explicit-env and auto-download DLSS resolution
build / mod (push) Failing after 29s
A valid DLSS_SDK must not block the Vulkan header auto-download, and vice
versa; assert that only the missing component is fetched.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 15:44:12 +03:00
chexit 97d97eb37c Keep a broken DLSS cache directory from failing the build
Scanning .horizon-cache/dlss-sdk is best-effort: a permissions error or a
missing directory now means "nothing cached" and the normal install path
runs, instead of an exception escaping before the mods fallback.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 15:43:48 +03:00
chexit 84e9d6ab60 Document the zero-step DLSS toolchain install
The quick-start build section no longer asks for an NVIDIA DLSS SDK or a
LunarG Vulkan SDK: `airdef.py all` downloads only the headers, static libs
and nvngx_dlss.dll it needs, caches them under .horizon-cache with a
version marker, and copies the fresh DLL beside horizon-client.exe. Keeps
the explicit DLSS_SDK/VULKAN_SDK override, the offline/failure fallback to
mods with native TAAU, and the remaining LLVM/clang build prerequisite.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 15:40:00 +03:00
chexit 88757d05f8 Auto-install the DLSS toolchain on Windows + NVIDIA RTX
`airdef.py game` no longer needs manual SDK setup. On Windows with an RTX
adapter, when neither DLSS_SDK nor VULKAN_SDK is set, it downloads only the
files dlss_wgpu reads:

- NVIDIA/DLSS at the newest stable v310.9.x tag (GitHub API; pinned v310.9.1
  when the API fails): include/*.h, both x64 static libs and the runtime
  rel/nvngx_dlss.dll (~67 MB once), laid out under
  .horizon-cache/dlss-sdk/<tag>/ exactly as valid_dlss_sdk expects.
- KhronosGroup/Vulkan-Headers include/ under
  .horizon-cache/vulkan-headers/<tag>/Include/, since build.rs uses headers
  only and links no Vulkan library.

The resolved roots are passed to cargo as DLSS_SDK/VULKAN_SDK, and after a
successful dlss build the fresh nvngx_dlss.dll is copied beside the built
horizon-client.exe. Explicit DLSS_SDK/VULKAN_SDK (and the sdk argument)
keep priority and disable auto-download for that component. Any network or
layout failure warns and falls back to --features mods/native TAAU instead
of failing the build; non-Windows and non-RTX take the old mods path with
no network access.

valid_dlss_sdk now looks for the real nvsdk_ngx*.h names instead of the
nonexistent nvngx*.h glob, so a genuine SDK (and the downloaded cache) is
recognised at all.

Tests cover tag selection and fallback, selective layout + marker cache
hit, damaged/partial caches, streamed download and truncation, Vulkan
Include layout, plan env wiring, explicit-env precedence, failure to mods,
and DLL placement beside the client.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 15:39:56 +03:00
chexit 8d716eccaf Point the DLSS build hint at the mod settings toggle
build / mod (push) Failing after 30s
The build auto-detect hint still said HORIZON_DLSS=1 enables the backend;
the player-facing control is now the mod settings toggle (default on),
with HORIZON_DLSS=1|0 as an override.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 15:08:03 +03:00
chexit e85e7a18d0 DLSS on/off toggle in the mod settings, persisted per world
The More page (N → Огонь, ремонт, эффекты…) gains a DLSS row next to
Акустика. Default on: a world without a saved choice leaves the engine's
own default (on where supported). The row reads render.dlss-status (API
level 33): with a DLSS device it toggles live; without one it says
«недоступен», and an on-request is kept and applied at the next launch —
a graceful no-op, never an error. The request is saved in the world's
layout (`dlss true|false`, older saves load unchanged) and re-applied on
world load; the engine persists it in horizon-graphics.txt for the next
start's device opening. /airdef capabilities reports the DLSS state too.

Graphics-only: no resolution control (the player's own Horizon settings
stay in charge) and no sim changes. Engine gitlink → b2cc11c45
(agent/dlss-toggle): the dlss graphics setting, the live evaluation gate,
the dlss control command and the level-33 SDK imports.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 15:06:25 +03:00
chexit 11238c4a03 Add dlss to the game build on Windows + NVIDIA RTX with the SDK
build / mod (push) Failing after 29s
tools/airdef.py game always built with --features mods, so an RTX user had
to run the manual cargo line from docs/DLSS-TESTING.md. The feature string
now comes from dlss_build_features(): dlss is added only when the OS is
Windows, a Win32_VideoController name has both NVIDIA and RTX, the DLSS SDK
has include/nvngx*.h and lib/Windows_x86_64/x64 (DLSS_SDK, a repo DLSS/ dir
or %ProgramFiles%\NVIDIA\DLSS), and VULKAN_SDK has Include/vulkan/vulkan.h
(dlss_wgpu's build script needs both SDKs). Otherwise the build stays
mods-only; on Windows + RTX without the SDK it prints how to get v310.9.1
instead of failing. GPU/SDK probe errors mean "no DLSS" and never abort the
build; the HORIZON_DLSS runtime switch is untouched.

Tests: tools/test_airdef_build.py covers non-Windows, no RTX, missing DLSS
SDK, missing Vulkan SDK, the full toolchain, a failed GPU probe, the SDK
layout check and the feature string reaching cargo. python3 tools/airdef.py
game still builds mods-only on macOS (fresh target dir: 3m11s, exit 0).

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 14:21:20 +03:00
chexit d8d9913770 Issue #126 point 4: same-tick A/B parity and timing record
build / mod (push) Failing after 29s
The temporary in-session shader switch (harness build, reverted) renders the
same frozen tick with both effects.wgsl versions: old-vs-new differs by at
most 1-2/255, no pixel over 5/255, and no more than two frames of the same
shader differ. Frame time is below the in-game noise floor on M5 (32
screen-filling late-life fireballs: +0.37 ms median, sigma 3.6). Includes
the hd_bench polygon_noon run and test counts.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 13:51:13 +03:00
chexit 8fb849f195 Skip the fireball raymarch when its fade is zero (#126 point 4)
In the HD smoke path fade = 1 - smoothstep(0.08, 0.28, k) is exactly 0
from k = 0.28: every step's density is zero, absorb is 0, so the march
adds no light and leaves transmittance alone while still sampling fbm
and shading the volume. Wrap the loop in an `if fade > 0.0` guard; the
glow after it is untouched (heat is still live there) and is itself
skipped once its heat is spent. Density, steps, sampling and lighting
are unchanged.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 13:51:13 +03:00
chexit 1a82742744 CPU timeline profile of the battle frame (#147 step 3.1, #126 D/E)
build / mod (push) Failing after 28s
Measure-first profile naming the culprit with data; no worker implemented
(step 3.2 is out of scope). docs/measurements/issue-147-cpu-profile/: README +
report-server.json (default server-thread path) + report-inframe.json
(--in-frame control), M5/Metal 2560x1440 HD, same-recording battle with
overlapping raids + explosions + dense smoke, each run serialized under the
shared flock /tmp/airdef-bench.lock (earlier concurrent runs discarded).

Instrumentation: host per-tick tick_mods spans (ground/world/snapshot/wasm/
models/output/total, HORIZON_MOD_CPU_PROFILE=1, attributed by tick+frame),
mod Sim::step phase timing via an adapter-injected monotonic clock
(game.monotonic-nanos, API level 32; airdef-core stays SDK-free), raid_bench
--scheduler + per-frame span/frame correlation + mod phase delta.

Findings: on the default path the battle frame is GPU-bound (GPU avg 73.7ms ~
frame p95 88ms; 127/128 frames >33ms); the mod path is ~2.5ms/tick, per-frame
p99 7.7ms, 0 frames >25ms, host world answers <0.1ms, model prep ~0.05ms; the
872ms CPU spike is a render/GPU hitch (mod 2.15ms). In-frame is CPU-bound
(CPU p99 175ms); the mod path reaches >25ms in 27 frames, and step_drones
dominates Sim::step (52%, max 47ms/tick), A* only 15%. The schedulers' mod
peaks do not coincide; only the render-dominated catch-up spike is common.

Recommendation: a pure A* route worker and a world-snapshot worker are NOT
justified (A* leads only the tiny default-path mod; world answers never lead).
Default-path peaks are GPU -> steps 1-2 (GPU/geometry) apply, a CPU worker
would not help. If targeting in-frame CPU, the unit is the whole Sim::step
(Wasmtime on its own thread), not a route worker — still not implemented.

Harness fix (engine gitlink 48eff0fcb): control-socket chat/chat-log now reach
the client mod on the server-thread path (chat-box parity), enabling the
required default-path battle measurement; sim rules untouched.

Tests: airdef-core 326 passed/0 failed/8 ignored; airdef-mod 113+1+2+5 passed
incl. same_seed_same_result and combat_trace_is_deterministic;
tools/test_raid_bench.py 11 passed; horizon-mods suite + wasm ABI test ok.

Engine: d073783f5 (spans + clock) + 48eff0fcb (chat harness) on
agent/126-cpu-profile. Parent: 92c058f60 (profiler + driver) + this commit.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 13:35:32 +03:00
chexit 92c058f606 Sim::step phase timing and the CPU-profile bench driver (#147 step 3.1)
Mod side: Sim::step times plan_step, adapt, step_drones, step_moves,
update_sight, step_sams and record, plus the whole step and its untimed
remainder, through sim::profile. The simulation stays SDK-independent (also
built as airdef-core): the adapter installs the host monotonic clock
(game.monotonic-nanos) in init, native tests use std::time::Instant. The
counters are fixed-size, per-thread, read no randomness and change no
decision; /airdef stats reports them as PROFILE chat lines, reset per world.

Driver: raid_bench gains --scheduler in-frame|server-thread (the two
single-player paths, measured separately), HORIZON_MOD_CPU_PROFILE=1, the
per-tick mod-path spans joined to the frame trace (per-frame totals, >25/33 ms
counts, what the worst CPU frames carry), and the mod phase profile read at
idle and battle end with the battle delta. report.json carries mod_cpu,
mod_cpu_ticks, mod_phases_* and the derived correlation. Tests for the new
helpers.

Engine gitlink: mod-path CPU spans + game.monotonic-nanos (API level 32).

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 12:29:22 +03:00
chexit c08b737296 Reproducible raid/replay render bench and #147 instancing measurements
build / mod (push) Failing after 32s
tools/raid_bench.py (+ tests): the #147 step-0 driver replaces the #126
scratch script. One battle at fixed ticks (waves inside resident terrain —
far waves stall at the unknown-chunk edge and no fight happens), fingerprint
chat lines at control ticks, then the raid's own recording replayed. Both
render paths are benched on the SAME recording in ONE process via the
engine's diagnostic `model-instancing off|on` toggle (cross-process battles
diverge in event timing: 16 vs 32 kills at one control tick), pairs in
alternating order; idle cold/warm, mid-battle window, reload (F3+T), replay
seek, away-camera checks, and static off/on stills for pixel parity
(hd_bench motion-mask methodology). report.json carries gitlinks, device,
mod_models counters, CPU/GPU p50/p95/p99/max, raw frame times, >25/33 ms
frame counts, guest fuel and streaming queues.

Engine gitlink: one mass mod-model group GPU-instanced (retained mesh per
pack generation, current/previous pose/id/light instance stream shared by
main, motion and shadow passes, per-vertex fallback to parity, runtime
diagnostic toggle, stats raw + guest fuel reporting).

Measurements: docs/measurements/issue-147-instancing/ (M5/Metal, 2560x1440;
RTX 3060 pending). docs/REPO-MAP.md and docs/ENGINE.md pin updated.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 11:39:43 +03:00
chexit 32748b116c Smart v2 on top of #146: one public picture, mark prices, bounded refresh, bearing window (#149)
build / mod (push) Failing after 30s
Re-applied the genuinely new #149 features onto kimi-work, REUSING the already-integrated
#146 infrastructure (KnowledgeSnapshot { tick, contacts, marks }, knowledge_now(),
Plan.knowledge, RouteJob.known, versioned price_grid_known and restore). No #146 scaffolding
is duplicated: one snapshot per order, prices over known.tick, versioned restore are kept
exactly as they were. The only additive change to KnowledgeSnapshot is observations().

New #149 layer:
- observe::Observation + observe::merge: Contact and Mark become one public hint, matched by
  public features only (area overlap + exact category); coarse Unknown/contradicting marks stay
  separate, the contact's kind/fix are never rewritten, recon.truth and real ids are not used.
  One Observation::rank scale replaces the two ranks in radar_strikes, choose_target and the
  adaptive picks (kimi-work's slice signatures kept).
- price_grid_known prices marks: a trusted launcher/gun/jammer mark prices its published
  category envelope weighted by confidence (Confirmed x1, Probable x0.5); a radar mark feeds
  the network belief; a mark matched to a contact is priced once through the contact; a
  doubtful mark prices nothing.
- Bounded refresh of the unreleased portion: ew::Refresh with absolute deadline
  REFRESH_WINDOW=600; step_refresh re-aims queued Plan/Sead drones once on a report (typed
  Intent::Refresh, SEAD priority) within SWITCH_CAP and assignment budgets; no report never
  delays a launch.
- Bearing window: Intel.outcomes bounded VecDeque (48 entries, 12000-tick window); best_bearing
  adapts exploration share by typed BearingReason (few/stale/conditions-changed/exploiting);
  conditions are a fingerprint of the public picture, never hidden state. bearing_report() and
  bearing/refresh_*/observations fields in EnemyPictureReport. Legacy fixed share kept.
- examples/smart_bench runner (simple/current/candidate, seeds 1/7/42, open/hills/config-change/
  recon-lost, JSON+lines); Sim::smart_legacy reproduces current Smart; harness::run_with_hook.
  Light modes and bounded jobs unchanged; policy reads no health/charges/hidden switches/positions.

Tests: smart_tests + observe::tests (metamorphic hidden-layout, public dedup, marks in prices,
one version per order in both modes, bounded refresh fires-once/never-pauses, bearing window and
reasons, durable window + Intent::Refresh). The relief-version regression fixture's wall is
widened in z so it crosses any east-west route after the candidate's assignment-order change.
cargo test passes: airdef-core 326 lib + 8 scenarios; airdef-mod 113 lib + core_boundary + 5 scenarios.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 10:57:04 +03:00
chexit b796a439df Restore the saturated intercept count by uncueing the embedded radar (#145)
build / mod (push) Failing after 31s
The heavy WASM scenario (wasm_flat_budget, 64 integrated complexes vs two
`airdef wave oreshnik 40 2600`) lost intercepts at the tick-2102 checkpoint:
522 (main) -> 302 (#133) -> 243 (#134). Decomposed by A/B on one fixture, one
host (2bcce64), one SDK, each slice built from its own commit:

- 522 -> 302 (#133): Track.vel became an estimate from noisy measured places
  (it was the target's true velocity); the forecast, the aim lead and the
  interceptor's launch Fix all read it. Forcing the class estimate to Unknown
  leaves the count unchanged (native 296 ~= 294), so class/roles is not the
  cause. The pre-#133 522 used the target's true velocity, which the #133
  contract "class and speed only from measurements" forbids; this portion is
  the intentional cost of honest measurement-only tracks and is kept.

- 302 -> 243 (#134): the network cue was extended from the separate engagement
  radar to every fire-quality radar, including each weapon's embedded radar.
  Cueing every relayed contact each tick flooded the embedded fire control with
  one-tick plots whose noisy velocity degraded guidance. Restricting the cue
  back to separate radars recovers the whole drop: 243 -> 325.

- own_fire_within / FIRE_QUALITY / channels are NOT causes here: relaxing the
  own-fire gate or the channel limit each changed nothing (243 -> 243). Embedded
  radars always measure Fire plots of quality >= 64 and have no channel limit.

- #140 does not affect this loadout, by fact: the fixture deploys no separate
  radar, so every profile is embedded with channels = 0; the channel-age bug
  binds only where a profile has channels, and the channels-off A/B was flat.

Fix: the cue looks only through a separate fire-quality radar
(sam.kind == SamKind::Radar); the embedded radar keeps its beam/revisit/lock
acquisition as before #134. All radar profiles, channel limits, own-fire
authority and the measurement-only class/speed contract are preserved; no
target truth is injected.

Measured after the fix (WASM, fuel budget 300M/tick): checkpoint 325 intercepts
/ 2011 hits, fuel max 118M; final (tick 3302, two late Smart raids) 385 / 2472,
fuel max 176M; zero fuel failures. The first late raid reports the #135 recon
flight ("Разведка противника: впереди налёта высланы разведчики"); the second
is silent (recon budget spent) — the fixture now expects exactly that instead
of the stale empty chat that stopped the scenario.

Tests:
- airdef-mod/tests/saturation.rs: deterministic native replica of the checkpoint
  (same sim, host block tracer) asserting the restored count and a regression
  threshold, plus the #140 loadout fact (no separate radar, channels = 0).
- Sim::launch_audit (why.rs): on-demand tolerance diagnostic counting why each
  (system, drone) pair holds fire — no track / stale / no authority / role /
  doctrine / reach / claimed / not ready / not aimed / terrain / ready.
- sensor_tests: a network plot cues a separate fire radar but not the embedded one.
- wasm_flat_budget baselines re-measured with provenance comments; the asserted
  fixture SHA in tools/airdef.py updated.

Verification: `python3 tools/airdef.py test-budgets` passes both stages and the
two late raids (283 steps, fuel failures = 0). airdef-core 292 + 8, mod lib 104,
mod scenarios 5, saturation 2 — all green. A/B record:
docs/measurements/issue-145-intercept-regression.json.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>

Integration note (shipped engine 8e711f969): the tick-2102 checkpoint baseline is
unchanged and passes on the shipped engine (325 intercepts / 2011 hits). The final
stats baseline was re-measured on the shipped engine with #146 integrated (one
knowledge snapshot per Smart order changes the two late raids): 414 / 2463, world
8885 sections / 420671 rays / 3442845 cells. The asserted fixture SHA in
tools/airdef.py was updated to match. python3 tools/airdef.py test-budgets passes
all 283 steps with zero fuel failures (tick max 184608537 / 300000000).
2026-11-21 10:32:11 +03:00
chexit c76f620642 Point horizon at the TAAU motion-buffer jitter fix (#143)
build / mod (push) Failing after 28s
Engine a3045b61b: the motion buffer's coordinate contract is explicit and
decoded per history grid — native TAAU's stable history no longer receives
the two frames' jitter difference (a still surface reads the same output
pixel on every phase), 1:1 TAA keeps the correction its jittered history
needs, and the NGX input and flags are untouched for separate verification
on the DLSS path (#137). Numerical reprojection tests on all jitter phases
plus an ignored GPU A/B smoke on the real fs_taau.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 10:09:12 +03:00
chexit 63ebd4ac6c Plan one Smart order on one knowledge snapshot (#146)
build / mod (push) Failing after 25s
order_raid read one picture and one list of recon marks for the whole
order, but the Plan kept neither: plan_step priced each kind's first
route on whatever picture_of_defences() held at the tick the budget
reached that kind, so one raid could hold several versions of the map
at once. A retarget job carried its version's contacts, yet
price_grid_known aged them at self.tick, so two jobs of one version
reached on different ticks could disagree about a contact's own sensor.

KnowledgeSnapshot fixes the observation tick together with the contacts
and marks read at it. The plan stores the order's snapshot and passes it
explicitly to price_grid_on/price_grid_known; radar_strikes takes the
order's marks instead of re-reading the recon memory. A retarget job
shares its adaptive tick's snapshot and prices age at the snapshot's
tick, never at the current one: current time still cancels a stale job
(prune_air, job_live), separately from the version's own arithmetic, and
an explicitly new retarget gets a new snapshot and may use a fresh
report. The save rebuilds each version's snapshot from the contacts and
the marks reported by it; the section format is unchanged. Nothing here
reads the force: only published kinds and the contacts' own observations.

SDK-free regressions: a Smart order of two kinds whose land answers
starve while a visible contact is disclosed mid-wait keeps every kind's
targets and routes on the order's snapshot (and differs from an order
that knew the contact from the start); two jobs of one version worked
out across the emission-belief boundary price the same world, a new
version with a fresh report believes again, and a new version without
one does not.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 09:54:47 +03:00
chexit f2bc8550f5 Tie a radar's refine/fire channel to its own plot's freshness (#140)
build / mod (push) Failing after 28s
A station counted any own plot, however old, as a busy refine/fire
channel: a network heartbeat kept a stale contact's track fresh, so two
long-expired own fire plots still held both channels of the engagement
radar and a new contact nearby got only a coarse search plot, even with
the search radar running.

Channel occupancy now follows the station's own tracking.
Track::holds_channel requires an own (never relayed) refine/fire plot no
older than the station's track_ttl — three missed turns, the same value
that already bounds a contact without a fresh measurement. The planner
counts channels with the same Sam::own_channels_used(now) the panel,
monitor, map and "why" views read, so the UI and the allocation cannot
disagree about a stale channel. A stale channel frees for a new contact
without the network's survey track being removed; the hard per-profile
limit and the own measurement's provenance are unchanged, and a relayed
plot still never holds a channel.

Test: two contacts take both channels at the station, then leave its
reach while the search radar beside them keeps relaying them; a third
contact arrives nearby and gets its own fire channel (the test fails on
the old counting), and the relayed survey tracks of the old contacts
stay.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 09:53:43 +03:00
chexit 5f00a2a16b Read replay events by their time ranges, not the whole journal (#150)
The replay's sounds, the raid map's counts and the struck objects now read
the recording's event and scene journals by time instead of every pass over
the whole journal: partition points over the journals (with a stable time
index built at close only when a journal is out of order), the map's kill
and hit prefix indices, each object's first hit, and marker/time-line paths
that stop at the map's shape cap. Blasts, smoke, debris and the fire replay
read bounded windows back from the moment.

The sets, order and names stay exactly as they were: tests compare every
reader against the full journal filter, including tied times, out-of-order
journals and arbitrary forward and back seeks. The replay_bench example
measures a 10-minute raid with nearly full journals (playback, reverse seek,
pause, MP4); its result is docs/measurements/issue-150-replay-ranges.json.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 09:52:20 +03:00
chexit 7f52c40d99 Bump horizon to the DLSS command-order and history fix (#137)
build / mod (push) Failing after 21s
Engine 1cadd6338: the DLSS frame now submits world+linearize -> NGX ->
delinearize -> film/tonemap/UI/capture/present in one queue.submit with no
CPU sync, so the final frame, screenshot and export read the current
resolved frame instead of the previous one. Native TAA history readiness
is tracked separately from NGX, so the first fallback frame after DLSS
does not blend a stale or empty native history; a cut/resize clears both.

HD-RENDERER.md records the corrected order and the history separation.

Real-RTX acceptance (docs/DLSS-TESTING.md) is still pending: no RTX is
available here, so this is verified by the ordering/history unit tests and
the native horizon-client + horizon-mods suites, not a DLSS GPU capture.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 09:45:20 +03:00
chexit 8afe691301 Add typed battle reasons and short engagement chains (#148)
build / mod (push) Failing after 32s
A battery's "why" now starts with one typed reason shared by the monitor,
the HUD and the chat: only observation, waiting for a track, busy channels,
no ammunition, or ready. It carries the age and the station of the mark it
is about, and `/airdef why <n> source` moves the monitor to that station.
The reason is computed from the same predicates the launch decision uses,
and the detailed decision settles it, so a headline cannot promise or deny
a shot the simulation does not take.

The after-action review builds 4-5 measured steps per contact from the
recording's scene journal and events: mark, handoff, lock, launch, outcome.
The menu lists them per battery with a filter and opens a replay frame on
a click (the outcome clip, else the map held at the launch or mark);
`/airdef chains [battery]` prints the same list. Missing transitions stay
missing and marked as no launch, never guessed, and the normal HUD still
shows only the battery's own picture.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 09:42:10 +03:00
chexit bd2d8f4fed Release an unreachable optical contact and serve ready posts fairly (#138)
build / mod (push) Failing after 22s
An automatic optical contact is kept only within the optics' own reach and let go after a few failed probes. It stays out of the next picks for a while, so a visible alternative can be tried without constant switching; unknown world geometry gets a longer, still bounded wait. A player's command still waits for its contact and says so in the status line.

Ready posts are now served oldest-probe first through a simulation-wide probe sequence, so posts whose phases coincide all advance under the unchanged CHECKS_PER_TICK budget.

Tests: an out-of-range contact with a visible alternative, a blocked contact with a visible alternative, five same-phase posts, the bounded unknown-geometry wait, and the manual pin's status and out-of-reach behaviour.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 09:27:02 +03:00
chexit 41ab52e802 Keep replay transitions through the SAM pose decimation (#142)
build / mod (push) Failing after 36s
Sampling slowed by the pose budget skipped whole short stages: the six-tick
tube cover opening, the ejection and the radar switch fell between samples,
and thinning then halved already recorded transitions along with poses.

Poses still share the adaptive sam_step grid and the unchanged 32768-key
budget, but the recording is now sampled every tick for facts: a discrete
change (spent_cells, cap_cell, radar_on, mode, role) and every frame of the
cover's own movement are kept on the tick they happen, with the stage's start
backdated one tick so the opening still spans exactly OPEN_TICKS. These keys
carry an event mark and decimation halves poses only, keeping events, the
first and the last key.

Events get their own explicit 4096-key budget instead of raising the pose
budget: when it runs out the oldest stop being critical and thin as poses
while the newest stay exact.

Test: 64 turning radars plus an S-400 at sam_step 16, ejection on tick 4103
(cover 0.8333333 a tick before, spent cell on the ejection tick), a cancelled
opening and a radar switch off the pose grid, all surviving further thinning;
a 64-radar chattering recording stays exactly at the event budget with the
newest switch exact.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 09:23:41 +03:00
chexit 433e1500e2 Do not treat a cooling jammer as an active emitter (#139)
build / mod (push) Failing after 37s
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 09:20:46 +03:00
chexit 01765027b1 Fix the recon picture's wrecks and its emission sources (#139)
build / mod (push) Failing after 29s
A look no longer reports a wreck as a lead: a first look at one makes no
mark, and one the picture already held is radioed home as destroyed and
takes its mark out of the picture. A hidden kill still never rewrites a
mark, so the old assessment stands until its age runs out.

The channel now follows actual work, not a switch: a radar emits only
while radar_up, a jammer only while its transmitter is on the air. A
silent, packed, failed or destroyed station is just a unit the flyby saw.

A pending wreck observation is durable; older saves without its flag read
as before, every look being of a unit alive when it was seen.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 09:12:35 +03:00
chexit 24b8cce11b Update the WASM contract for radars configured at deployment (#144)
build / mod (push) Failing after 1m21s
The real-.hmod scenario still expected the pre-#134 role switch to
retune radar 4 and return its role as feedback. After #134 the profile
is chosen at deployment and dispatch refuses the old syntax, so step 14
failed with no feedback.

Both stale checks now expect the intended refusal, naming
deploy radar_search|radar_track|radar_height and on/off. The deployed
station is not transformed back for the test.

Verified with python3 tools/airdef.py test-wasm on the pinned host
2bcce64236 and the real airdef.hmod: 30 steps pass.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 08:57:53 +03:00
chexit 502d94c528 Spend the world overlay's marker budget on targets in frame (#141)
The overlay clipped the network's tracks to the nearest 64 by distance
before projecting them, and the truth and interceptor layers the same way.
A crowd behind the camera filled the budget, so a raid could show nothing
even with a target right in front of the player; the native reproduction
(one contact ahead, 64 behind) came out with zero markers and a header
saying all 65 were out of frame.

Now visibility comes before the draw budget. Each layer orders its
candidates nearest first, projects at most MAX_SCAN = 4 x MAX_MARKERS of
them (bounded work, no sort of the whole picture beyond that prefix), skips
those the frame does not hold without spending a marker, and draws the
nearest MAX_MARKERS visible ones. Each layer keeps its own draw budget, so
the interceptors and the truth markers cannot crowd out the network's.

The header separates the two ways a target stays unmarked: "за кадром"
(behind the camera or past an edge) and "сверх бюджета" (past the scan or
draw budget), alongside "в кадре".

Regression tests: 64 behind plus one ahead for the network, truth and
interceptor layers; a mixed crowd proving the nearest visible keep the
markers and the farthest is budget-capped, not offscreen; the projection
count bounded by MAX_SCAN; every case stays inside the HUD's 1024 shapes.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 08:57:53 +03:00
chexit a983177d34 Draw a held-key world overlay of targets through the drawn camera (#132)
build / mod (push) Failing after 59s
Holding C draws square markers over the targets the player can see, each
with the class the radars estimated and the distance; an unidentified
track stays a "?", never the target's type. Stale forecast tracks fade
orange and say their age, the player's own interceptors wear small yellow
squares, and the sandbox truth mode adds white markers of the real drones
apart from the network's estimates. Letting the key go clears the HUD.

The markers project through the camera of the last drawn frame
(render.project, API 31), so they sit on the world as it is drawn and
follow the view frame by frame; the overlay stays off under a replay, the
grid J, the monitor K and the map M, which own the screen themselves. A
full raid stays inside the HUD's 1024-shape budget, keeping the nearest
markers and counting the rest behind the camera or past the edges.

Bump the engine pin to 2bcce6423 (API 31, render.project) and name API 31
in the capabilities diagnostic to match.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 00:39:17 +03:00
chexit 795b1b2fcf Merge recon flights and partial reports into the classified radar picture (#135)
build / mod (push) Failing after 1m5s
Co-Authored-By: Kimi Code <noreply@moonshot.ai>

# Conflicts:
#	airdef-mod/src/sim/mod.rs
2026-11-21 00:07:39 +03:00
chexit c4e002ed8b Add the recon UI and diagnostic layer to the smart enemy (#135)
The core recon flights and partial reports (9d8f3da57) had no player-facing
or diagnostic consumer: enemy_picture().recon/recon_sorties were read only by
core tests. This adds the missing layer on top, without touching the mechanics,
models or textures.

- Map: a tracked recon aircraft is a recognisable yellow hollow diamond with a
  "разведчик" label, a role line in the selection panel and a filter legend; in
  the sandbox truth mode it gets an amber marker of its own.
- Battle UI: the summary panel and the map show the flight's coarse phase
  (разведка → донесение → завершение) only while the player's network actually
  holds a recon aircraft — what the visible aircraft are doing, not what the
  enemy learned. The truth mode adds a recon count line.
- Diagnostics and after-action review: /airdef recon and the menu page
  "Разведка противника (разбор)" (from Main and Replays) list the enemy's marks
  best-first with the reason each outranks the rest — priority = freshness×4 +
  quality×3 + observed role (recon::priority_parts, cross-checked against
  Mark::priority by a test) — plus the sortie phases and the drones aimed at a
  mark. The omniscient enemy picture is never shown in the normal HUD; it is
  explicit debug/review only.

recon_view reads only the current report types (EnemyPictureReport, ReconReport,
ReconSortieReport); the sim side only widens visibility and adds priority_parts
and the is_recon_drone/recon_status read helpers. Tests: recon_view, panel,
command tree, priority_parts cross-check. README and IMPLEMENTATION-STATUS updated.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 23:59:45 +03:00
chexit 12a706fb67 Refine the network track's class from the optical look (#136)
build / mod (push) Failing after 1m25s
- ClassEst::step_optical: the shared estimate's rule for one passive look —
  an unsure look (over OPTICAL_CLASS_MAX_UNCERTAINTY) names nothing, a sure
  one names a class, firms an agreeing probable, replaces a contrary guess
- Track::refine_class_optical: the minimal common method — class only; the
  plot, age, source, quality and own fire rights stay untouched
- Sim::apply_optical_classes: the explicit adapter, fed by each observation
  made this tick through OpticalObservation::estimate; a relay of the
  refined track carries the class as it was and gains nothing from it
- the post still holds no track, emits nothing and authorizes no shot;
  the refined class reaches the existing #133 track UI through the picture
- tests: network refinement, unsure look, relay/stale look add no
  confidence, equal observables refine equal classes, the step rules

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 23:55:28 +03:00
chexit 8550de16f8 Finish the optical post's network cue and edge cases (#136)
- a radar's fresh track reaches a post as a cue only: it points the head
  but never enters the post's tracks, seen or own set
- a searching post's sector follows the turning head, not the fixed base
  heading; switching contacts drops the old contact's picture
- dead and blinded posts spend no probe budget and never observe
- the icon alias is part of the generator, so the placeholder item uses
  the radar texture without a duplicate PNG or a hand-written asset
- part diagnostics read "Опт" for a passive post's sensor
- tests: cue wiring, turning sector, contact switch, dead post, graphics
  preset; generator alias

Cherry-picked from 3697a1764aec7a7bdc6311918453dd51e26ecabf onto the
#132/#133/#134 base: the cue-wiring test's track literal now carries the
shared class/source/product/quality contract instead of a DroneKind.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 23:38:32 +03:00
chexit 245aceb434 Add recon flights and partial reports to the smart enemy (#135)
A smart raid may send a small, bounded flight of unarmed Gerbera aircraft
ahead of its strike. They fly physically through zones round the marked
objectives (and revisit a doubtful mark when nothing is unchecked), look
at units inside a zone, and radio home an area, a public category, the
channel, age and quality only after a delay and only while the aircraft
is alive. A sortie lost before its report sends nothing; marks already
delivered stay, and the picture remembers them across raids.

The planner now reads recon marks as well as disclosure contacts. A mark
carries a synthetic id, an area, a category and a radar role only once a
second independent look refines it -- never a real id, SamKind, exact
point, health, magazine or link. Aims are chosen by observed role,
freshness and quality; a fresh modest mark can outrank a stale doubtful
big one, and a hidden unit is in neither list. In-flight recon aims keep
their old area: hidden moves, re-roles and damage do not rewrite a mark.

Bounded assignments, the route-job queue, the original wave objectives
and the no-eternal-pause rule are preserved. Recon aircraft take ids from
their own range, do not spend the strike's combat RNG and are not part of
the strike's replay. Save/load keeps marks, sorties, pending reports and
checked zones. No new models, textures or weapons.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 23:36:00 +03:00
chexit e5ee15a2ca Add passive optical observation post (#136)
- new Optical unit kind with its own catalog row and deploy item
- bounded one-contact line-of-sight checks against land and blocks
- day/night reach and hold timing; obstacle and unknown geometry block sight
- independent class observation with source, time and uncertainty, never DroneKind
- map/monitor/panel statuses and a line to the selected contact
- tests: day/night, wall/unknown, ageing, no kind leak, bounded work, passivity

Cherry-picked from 3ae21123964a9d3234bb2b3efc9ff926d64fc77d onto the
#132/#133/#134 base: the cue test's track literal now carries the shared
class/source/product/quality contract instead of a DroneKind.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 23:33:32 +03:00
chexit 53fbeced22 Cover radar profiles over a ridge (#134)
build / mod (push) Failing after 28s
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 23:13:38 +03:00
chexit e1b09f696f Give the two-raid scenario room for the last contact (#134)
The maximum menu raid keeps a supersonic contact in the air past 5000 ticks under the new fire-authority rules; the recording closes only when the sky is clear. Run the scenario to 8000 ticks, still well inside its 20-minute cap, and keep the replay assertion.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 23:13:32 +03:00
chexit 858735a4c6 Implement the first full radar-profile slice (#134)
Give the separate radar three real profiles over SamKind::Radar and the
typed catalog variants:

- radar_search: coarse, slow, long-range search plots; no fire authority.
- radar_height: raised mast, local refinement of low plots; no fire authority.
- radar_track: local search, fast revisit, two refined/fire channels.
- radar_multi remains the compatible universal profile, not best everywhere.

Tracks now carry the measuring station, product (search/refine/fire), and
quality (separate from identification), and keep the station's own plot when a
fresher network relay replaces the published position. A relay never refreshes
the measurement or authorizes a launch. Ordinary launches need the battery's
own confirmed fire plot; launcher-only batteries use a supporting radar's own
plot, and the existing heavy far shot keeps its cue-radar exception.

Per-tick refinement/fire work is bounded by profile channels and local search
radius. Off, damage, network and save/replay behavior are preserved: new saves
write the stable profile ID, old role-only lines migrate, and embedded SAM
radars keep their own fire authority. The deploy menu, status lines, map,
monitor, radar scope and /airdef why explain the profile, source, age, quality,
channels and refusal reason.

Models/textures are untouched: all profiles reuse the existing radar
silhouette (the separate art zone remains for its owner).

Tests: profile single/pair/full scenarios and duplicate station, channels,
relay source/age/quality, Off/damage, save migration, replay, embedded and
Multifunction radars, catalog/generator checks, airdef-mod suites, core lib
(non-balance on one thread; the four active balance tests in release) and core
scenarios.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 23:11:12 +03:00
chexit ac7521936d Estimate a track's class from its measurements, not from the target (#133)
build / mod (push) Failing after 1m18s
A radar track is what the network measured, and it never carried the
target's own answers: the tactical Track loses `kind: DroneKind` and the
true velocity, and gains what the measurements say instead.

- Track now holds a ClassEst (unknown / probable / firm) plus an observed
  velocity: none from the first blip, then the change of the measured
  places between real measurements, smoothed so one noisy pair does not
  flap the class. The classifier's bands sit between the game's speed
  clusters (Class::of_speed); a new contrary measurement replaces the
  hypothesis, an agreeing one firms it.
- The class estimate is separate from track confirmation (Track::ident):
  a track can be confirmed with its type still unknown. The estimate
  grows only on real measurements — a forecast and a relayed copy add
  nothing — and it travels with the measurement it grew from, ageing
  with the track and gone when the track drops.
- Roles, last chance, the reserve and the interceptor count read the
  estimate, never the target's class. Explicit policy for the unknown:
  an unidentified track stays a candidate under the general rules (and
  the system with no roles holds its fire at everything); the map, the
  monitor, the summary panel and /airdef why read the same estimate and
  name the reason — «Трек подтверждён · тип не определён», «вероятно
  крылатая ракета». The exact model stays in the sandbox's truth mode.
- A gun or a launcher lets go of a target that classified out of the
  roles since it was taken; a first blip no longer rules a contact out
  as a threat to guarded objects (it has no measured course yet).

Old saves and replays are untouched (tracks are derived, not persisted);
the simulation stays deterministic (the classifier is pure arithmetic on
the measurement noise). The doctrine/first-blip/last-chance tests gained
classified tracks where the contract provably changed; new tests cover
the classifier's steps, kind-independent estimates, first-blip blindness,
and relays and forecasts adding no confidence.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 22:55:36 +03:00
chexit 95739c95b1 Finish radar truth HUD layout and document target modes (#132)
build / mod (push) Failing after 33s
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 22:08:46 +03:00
chexit d302204649 Make map and radar targets legible with an honest hover (#132)
- mini radar: class-shaped blips that merge into one with a count
- map: larger track markers and trails, hover card with distance, type,
  status, target and interception
- explicit network vs sandbox truth: true drones, routes and aims drawn
  apart from the network tracks, with their own trails

Co-Authored-By: Kimi Code <noreply@kimi.com>
2026-11-20 22:08:46 +03:00
chexit 1e2d5dd0c0 Record #126 first stage: retained mod-model meshes, measured
build / mod (push) Failing after 55s
Engine a861c1ed2 (kimi-work-124), based on ed751714e: mod-model faces resolved once per pack generation, frames only transform and light them; motion #124 from the same faces; counters and span; reload/unload invalidate the cache. HD-RENDERER status + section, and docs/measurements/issue-126-first-stage with the A/B method and numbers (M5/Metal, Polygon raid: entity_geometry CPU 5.71 -> 1.57 ms avg, prepare 23.5 -> 7.05 ms; static scene pixel-identical; reload/unload smoke). Not GPU instancing; 5600X/3060 acceptance pending. Issue #126 stays open.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 21:46:46 +03:00
chexit 80d0cc9c43 Add native wgpu ray-query capability probe (#125)
build / mod (push) Failing after 1m21s
Stage 1 of #125: prove or disprove real hardware ray-tracing support without
touching the client renderer. The probe pins the same wgpu 30.0.1 stack as the
engine, including its vendored third_party/wgpu-hal patch, builds one BLAS/TLAS
and traces a 16x16 ray-query compute frame, checking every ray against a CPU
point-in-triangle expectation.

Verified on macOS aarch64, Apple M5 / Metal: BLAS/TLAS and the ray-query
pipeline build, 32 hits and 224 misses all match, exit 0. RT_PROBE_BACKEND=gl
reports no RT adapter and exits 2; RT_PROBE_NO_OPTIN=1 shows request_device
rejects EXPERIMENTAL_RAY_QUERY without the experimental opt-in and exits 2.

tools/rt-probe/target/ is ignored; the probe is a standalone workspace and is
not wired into the game build.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 21:34:07 +03:00
chexit c59bfe9e54 Catalog typed battery variants (#91)
The battery deploy pieces (s400_launcher, s500_launcher, radar_search/
track/height) were described three times: the menu table and the
configuration match in lib.rs, and a chained id list in commands.rs. One
catalog decision instead: catalog/content.json gains a variants section
(mode/role reuse the existing SamMode/RadarRole save keys), gen_catalog.py
generates catalog::UnitVariant rows, and the loader rejects duplicates,
unknown kinds/modes and id collisions with kinds or items. The battery
menu, its click handler and the deploy completion read the generated
table; the historical row order and labels are unchanged.

No variant carries its own balance: per-variant ammo profiles stay open
pending a confirmed profile and an explicitly labelled game abstraction
(PAC-3 note on #91), so no new specs, no new matches and no save/replay
change - a variant is only a deploy key over the same kind.

Checks: gen_catalog.py --check and gen_models.py --check clean, the
python catalog/asset and sound tests pass, airdef-core 234 unit + 8
scenarios, airdef-mod 69 unit + 1 boundary + 5 scenarios (save/load and
state round trips included), zero failures.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 21:34:07 +03:00
chexit 306af49744 Move battery status text to the presentation adapter
Sam::status, Comps::describe/worst and Sam::parts_text formatted
player-facing Russian in the simulation. The adapter now owns that
text: battery_view::sam_status for the panel and map, why_view::parts
and why_view::worst for the monitor and the status line. The core keeps
the data and gains only the accessors the adapter needs
(preparing_cell, public cells/reload_time/magazine/gun facts).

Texts are unchanged; the adapter tests pin the existing strings.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 21:34:07 +03:00
chexit 60f1bf0fd8 Record the Windows DLSS acceptance build and remaining runtime check
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-16 13:00:39 +03:00
chexit e194971867 Document Visual C++ runtime needed by the DLSS test build
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-16 12:56:32 +03:00
chexit 7ae0c5bbba Add Windows DLSS A/B test launchers and acceptance guide (#124)
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-16 12:55:10 +03:00
chexit 217e3ac886 Add feature-gated DLSS SR proof of concept (#124)
Advance to engine ed751714e. Document the optional SDK build, ordered color conversion/submission, native fallback and the remaining MSVC-link and RTX-runtime acceptance.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-14 22:10:32 +03:00
chexit f33b799551 Record previous-frame motion for mod models (#124)
Advance to engine 7a73e8d26: separate previous-position streams and a depth-read-only motion pass for mod models, with matching alpha cutouts and a debug view.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-14 21:06:02 +03:00
chexit d8cb98a964 Keep radar target blips above the player arrow
Draw the player marker before network tracks so a close blip is not hidden. Add a shape-order regression and verify a live raid with truth disabled.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-14 18:25:33 +03:00
chexit e59c49e3bf Blend HD shadow cascade filters at the near boundary
Advance to engine 17382445a and document the six-block near/far transition verified on the forest aerial view.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-14 18:04:24 +03:00
chexit 9664783b17 Add dense motion foundation for temporal upscaling (#124)
Advance to engine c962cd472. Document the render-pixel current-to-previous contract, native TAA/TAAU consumer and the remaining DLSS/object-motion/linear-HDR work.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-14 17:49:23 +03:00
chexit 3db1b73d64 Reuse oversized renderer staging buffers (#130)
Advance the engine to 94b572cd2, backporting upstream f7b77fbc8 with its GPU growth/readback regression. Keep API30 unchanged.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-14 17:27:17 +03:00
chexit 367c7f4ac3 Bound recorded SAM poses under the WASM memory cap (#122)
Thin old SAM keyframes in place, reduce allocation capacity and adapt later sampling when a recording exceeds its fixed pose budget. Preserve recent poses and cover the full ten-minute window in native and real WASM stress tests.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-14 17:21:48 +03:00
chexit e7934a1ebb Give the enemy a structured intent and a durable route queue (#127)
build / mod (push) Failing after 22s
release / windows (push) Failing after 2s
Stage 2 of #127. A smart drone now carries why it is aimed where it is
(Intent: plan, sead, react, replace) apart from the aim bookkeeping
(unit, since, switches, confidence). Assignments are throttled per
adaptive tick and per contact, a fresh disclosure replaces an aim only
after a hold, within a switch cap and when the change is worth a new
route, and a killed aim is replaced as a separate, lower-priority
decision. The queue is bounded and taken by priority (plan > sead >
react > replace); unknown land is no longer free in a replanned route.

The autosave now carries the air state: the drones in flight, the launch
queue, every pending job with its id, aim, unit, version, priority,
intent and relief version, the contacts the jobs were chosen from and
the relief snapshots they plan over. The format is a versioned `air 1`
section; older saves read as before, scenarios do not carry the sky,
stale, ghost and duplicate jobs are cancelled on load, and the section is
bounded (512 drones, 512 route points, 4096 contacts, 8 reliefs, 900 KB).
A periodic save waits while a raid is only being planned.

enemy_picture() now explains targets and pending jobs (aims, aimed_by,
pending_jobs, reason, work_per_tick) in English, and intel_bench records
the queue and intent evidence next to completion, losses and failures.
2026-11-06 18:36:20 +03:00
chexit 8fc10c07a1 Give the enemy a last-observation picture and observed-capability pricing (#127) 2026-11-06 18:00:08 +03:00
chexit 0b645d77e9 Normalize #129 measurements and pair the cold-launch capture
build / mod (push) Failing after 22s
Write both measurement CSVs with LF instead of CRLF so the range no longer
fails `git diff --check` on trailing whitespace; the parsed data is unchanged.

Add a matched before/after capture: one copied world, scenario and seed, the
same client/director and the same export command. The baseline hmod is built
from dc36d67 and the final one from the #129 code. Both launch shots start at
frame 94; the first centre illumination is frame 101 (0.233 s) before and
frame 121 (0.900 s) after, against the 0.25/1.00 s cold rules. Raw probe,
hashes and the measurement method are in issue-129-pair.json. The two MP4s
in docs are CRF26 storage copies; the CRF16 originals stay in the scratch
homes.

These are replay exports, not live footage. The capturing agent still has no
image input, so composition is left for human review; the frames before the
launch are not pixel-identical because these are two live sessions.

Co-Authored-By: Kimi Code <noreply@kimi.com>
2026-11-06 13:35:35 +03:00
chexit 56093b3a55 Record the #129 balance and the cold-launch capture
The stage contract and profiles are in 4b013fb. This commit adds the
measured balance (the #120 grid on identical seeds and the 12-seed raid),
the replay/export video with four stills, and updates the user and handoff
documentation. The visual files are provided for human review; the agent
that captured them has no image input and checked only the encoded
parameters, shot boundaries and the first large plume.

Co-Authored-By: Kimi Code <noreply@kimi.com>
2026-11-06 13:35:35 +03:00
chexit 1261c30724 Stage the cold launch and spool every interceptor's motor (#129)
The interceptor's launch is one sequence: the cap opens, the round is
thrown out unlit and slows under linear gas drag (`cold` ticks), the motor
lights where it has reached, it turns with a growing rate while thrust
spools up (`boost` ticks), and full guidance starts only at `cold + boost`.
A rail launch lights at once but spools over the same `boost` ticks; the
electric P1-SUN has no rocket spool or plume.

S-400/500 now hold the unlit ejection for 20/24 ticks (1.00/1.20 s at
20 Hz); IRIS-T/Tor keep shorter 8-tick throws. Ignition, its sound, flame
and recorded MotorIgnition event all use the missile's current position.
The RM48U strike follows the same 20-tick choreography, counts the throw
in its flight time and starts its recorded smoke at ignition.

Maximum speed, turn, accel, pk and every collision rule are unchanged.

Co-Authored-By: Kimi Code <noreply@kimi.com>
2026-11-06 13:35:35 +03:00
chexit a592ece6e3 fixup! Keep unfinished retarget routes in a bounded job queue (#127)
build / mod (push) Failing after 22s
The planner caches were keyed by (kind, relief Arc pointer, start, aim): two jobs with the same relief but different known-units snapshots could reuse each other's price grid and route. Key relief sampling by its Arc pointer but key prices and routes by the whole knowledge version: adaptive tick plus the known-units and relief Arc pointers. Regression creates two same-start, same-aim jobs on one relief with different known snapshots and checks their routes differ, while a third job of one version still reuses the route cache. Core release, adapter and WASM contract pass.
2026-11-06 12:57:36 +03:00
chexit a47812aadd fixup! Keep unfinished retarget routes in a bounded job queue (#127)
The relief snapshot was still global: a smart plan finishing while a retarget job waited could replace Sim::known_relief, so the pending route was planned on the newer map. RouteJob now carries Arc<KnownRelief> for its knowledge version; Sim::known_relief keeps the same Arc only to seed new jobs. retarget_relief reads the job's snapshot, and relief sampling, price grids and route caches are keyed by that version. The new regression makes a job wait, swaps the global relief for another grid with a wall, and checks the pending route and sample stay those of the original version; outside its grid is Unknown. Core release, adapter and WASM contract pass.
2026-11-06 12:57:36 +03:00
chexit 6f7b041c8b Keep unfinished retarget routes in a bounded job queue (#127)
A mass retarget used to clear every selected drone's route before the planner's per-tick work ran out: the rest flew straight for ever. Route jobs now carry the drone id, new aim, target unit, knowledge version and the intel snapshot, stay in a FIFO across ticks and are drained under the same WORK_PER_TICK. An old safe route is kept until its replacement is ready; a cancelled job falls back to a straight run. Jobs are replaced in place per drone, cancelled when the drone or unit is gone, and retarget routes reuse the original plan's known relief. An in-flight drone no longer turns to a unit behind its turning circle. Core release tests, adapter tests and the real WASM contract pass.
2026-11-06 12:57:36 +03:00
chexit dc36d67eb7 Unblock supply trucks from an impossible RM48U return (#128)
build / mod (push) Failing after 21s
step_supply sent every free truck into the return branch whenever any
S-400 had a pending ground_return, even when that return could not
proceed (the system moving, damaged, reloading or preparing, its round
already claimed by another truck, the route marked unreachable, or no
depot with room). The branch then found no target, cleared the job and
stopped the truck, so independent typed supply requests starved.

The return now keeps its priority only while it is executable: a
carrier holding a reserved round looks for a depot with room in reach,
an empty one for a system ready to hand a round over. Otherwise the
claim stays untouched and only real RM48U demand (a requesting system
with depot stock, or ground rounds aboard for one) pulls the truck
into the typed supply branch; without such demand it holds its watch
exactly as before. Redirecting a reserved round to a waiting request
clears return_cargo once the last one leaves the truck, and a stale
return_cargo with an empty hold no longer sends the truck to a depot
handover it cannot complete.

Regressions: three sim tests (moving claimant, pickup claimed by
another truck with damaged/save-restore phases, unreachable route) and
one full-drive lib test with a mid-flight state round trip; the rounds
are conserved in every phase and the actual return completes once the
claimant is back. All three sim tests fail on the old code.

Checks: core release 200 passed/8 ignored + 8 scenarios; adapter
67 unit + 1 boundary + 5 scenarios; real WASM test-wasm 30 steps.
2026-11-06 11:11:59 +03:00
chexit d45629ae29 Fix the UI-event fuel trap on a second large raid order
build / mod (push) Failing after 22s
The Windows log for #122 showed the mod stopping in the UI event
(fuel budget 1e9, remaining 0) with known_units <- order_raid <-
launch_wave <- ui_select: order_raid recomputed the planner snapshot
known_units() for every drone, and the snapshot itself rescanned the
whole force and the dedup list per intel entry. A second big Smart
order cost drones x intel-log x force-size inside one event.

Reproduced in actual WASM with measured per-callback fuel through the
exact ui_select(BTN_LAUNCH) handler (diagnostic guest, trigger.patch):
before, a 111-drone second order at revealed=13172/known=144 exhausted
exactly 1e9 and stopped the mod (an 11-drone order at the same state:
247805865); after, the same scenario passes with max command fuel
32946177/1e9, failures=0, and /stats at tick 2602 byte-identical.
A stacked single-point layout dies to one warhead (known=0, cheap
order), so the scenario deploys spread clusters with a moved player.

Fix: one known_units snapshot per order_raid passed to radar_strikes
and choose_target; known_units is a single O(log + force) set pass;
price_grid_on reuses its snapshot. Emitter/network targeting and
carrier choice semantics are unchanged (native equivalence test
against the former predicate; WASM checkpoint counters equal).
Limits unchanged; HD/recording untouched; wave size unrestricted.

Committed regressions: native snapshot-equivalence and
second-smart-order tests; the heavy WASM fixture now orders two Smart
raids through the wave screen's launch function (airdef preset +
airdef raid) with EW and a combat intel log, four accepted orders
asserted; the light contract covers preset and the empty-wave refusal.

Core release 195 + 8 scenarios; adapter 65 + 1 boundary + 5 scenarios;
light WASM 30 steps; heavy WASM 283 steps (tick max 182413686/300M,
command max 6939810/1e9, failures 0). Windows GUI acceptance remains
external and is not claimed.

Co-Authored-By: Kimi Code (Moonshot AI) <noreply@moonshot.cn>
2026-11-06 10:29:36 +03:00
chexit 61aaa0bf35 Record the Metal/offscreen camera picture acceptance
build / mod (push) Failing after 22s
The final engine 6a53a626c with the API30 AirDef build was run in the
real game (macOS, Apple M5, Metal, --offscreen, a clean HORIZON_HOME and
copied test worlds), not only in the sandbox: the monitor and the film's
main view report ready with the picture actually drawn (screenshots show
the panel and picture area, not a registered target), an empty set-views
drops the request, a world change bumps the generation and clears it, and
AirDef's next submission prepares the camera again in the new world.

Fixes nothing: no defect showed. It also records what the run does not
prove (a human visual check, Windows/other GPUs, two runs with the same
local id on the GPU, a mod reload on the GPU), the per-tick
set-views/set-main-view ordering that can honestly read awaiting-frame
between tick and note (not flicker), and that a title trip back into the
same world keeps the request because the generation is per world.

Co-Authored-By: Kimi Code <noreply@moonshot.cn>
2026-11-04 21:10:34 +03:00
chexit 9217f9a5cc Report camera readiness in /airdef capabilities
Pin the engine at 6a53a626c (API 30) and show render.camera-status: the
calling run's set-views cameras, whether the last noted frame was a world
frame, the request's world generation, each camera's reason and the run's
own main-view selection. As the other lines, this is a host milestone:
availability, request, preparation and why, not a GPU frame or a visible
picture. A unit test pins the line: readiness stays per camera and apart
from the run's main-view selection.

docs/ENGINE.md, the 4 November continuation and the status table now say
what prepared means (a picture encoded into the camera's target, or a
world frame drawn from it as this run's screen view, only for the run
whose selection the screen used), the per-run/per-world resets, and what
remains: GPU acceptance.

Verified: python3 tools/airdef.py check (gitlink, packer, mod needs 30,
fork 30, game 30); test-wasm 27 steps; airdef-mod 65 unit, 1 boundary and
5 scenarios; python3 -m unittest discover -s tools 28 tests.

Co-Authored-By: Kimi Code <noreply@moonshot.cn>
2026-11-04 21:08:23 +03:00
chexit 46d2274c8d Measure the #120 balance grid across batteries, ranges and target classes
Wider same-seed sampling of the finite-burn/coast change: baseline 2689d93
(pre-#120) against the current tree, 6 variants x 8 seeds of a 46-drone raid
(batt10/20/50, near200, far1500, hills20). Harness-only: Result carries the
tally's fuse/expired/orphaned/energy_lost counts and a new ignored
sim::balance::issue_120_grid test; no simulation parameters changed.

Findings: kills are equal or up and leaks equal or down in every variant;
fuse misses drop (far1500 70 -> 38 over 8 seeds); hills terrain losses fall
(scrubbed 6 -> 2). MotorEnergyLost never fires in the 48 scenarios and
expired stays <= 1: coast ends before drag reaches the 25% guidance
threshold. Leaks stay concentrated in the ballistic/fast classes
(Iskander/Kinzhal/Kh22/Zircon). No confirmed defect, so no tuning.

Full airdef-core suite: 193 + 8 passed, 0 failed (baseline side 169 + 4).

Co-Authored-By: Kimi Code <noreply@moonshot.cn>
2026-11-04 21:03:01 +03:00
chexit 325119b726 refactor: validate specs without a per-kind name list
The armed/support check in load_specs named the ten armed kinds, so a new
unit type would still have required a code edit and repeated the coupling
#91 is removing. Drop it: optional missile/gun rows are still validated
generically, and the existing kind-coverage check against content.json
already ties specs to the catalog.

validate_specs now takes the document, content identities and sound
events, and a test shows a hypothetical unit kind is accepted from a
specs row plus its content entry alone. No data or balance changes.

Verified: gen_catalog --check fresh, test_gen_assets 10 tests, core
release 195 passed + 8 scenarios (7 ignored), adapter 64 unit +
1 boundary + 5 scenarios, WASM contract 27 steps.
2026-11-04 21:00:35 +03:00
chexit 0937ac9e05 fix: keep the P1-SUN motor voice at its played 1.6 pitch
The old engine_voice returned early for flame == 0 with
(DRONE_LANCET, 0.8, 1.6), so the later `P1sun => 1.7` match arm was
unreachable. The catalog migration mistook that arm for the played value
and stored 1.7, which changed the interceptor drone's flight sound.
specs.json is back to 1.6 and specs_generated.rs is regenerated.

Adds missile_engine_voices_keep_their_played_values, pinning P1-SUN to
(DRONE_LANCET, 0.8, 1.6) and M48N6 to (MISSILE_FLIGHT, 1.0, 0.88).

The continuation and handoff text now describe the early return instead
of the dead arm, and tools/airdef_assets/catalog.py gets its final
newline back.

Verified: gen_catalog --check and test_gen_assets, core release
195 passed + 8 scenarios (7 ignored), adapter 64 unit + 1 boundary +
5 scenarios, WASM contract 27 steps.
2026-11-04 21:00:35 +03:00
chexit ead87343d2 feat: generate simulation numeric profiles from catalog/specs.json
catalog/specs.json is now the single copy of the numeric rows for
DroneSpec, MissileSpec and SamSpec: speed, guidance, warheads, models'
parts, RCS, seekers, launch and motor sounds, mount drives, gravity,
the Oreshnik split height and logistics limits, plus the named part
sets. tools/gen_catalog.py generates airdef-mod/src/sim/specs_generated.rs
(included by mod.rs, so the mod and airdef-core compile the same rows)
and unit_specs_generated.rs (included by units.rs). The hand-written
spec matches are gone; DroneKind::spec, MissileKind::spec and
SamKind::spec read the generated constants.

load_specs validates the schema, sound references, kind coverage against
content.json, named-part references and unused rows. gen_catalog.py
--check already runs in the CI generated-assets step, so a JSON/Rust
drift fails the build.

Every value was compared with the literals at 632061d field by field.
The only mismatch was the P1-SUN motor voice pitch in JSON (1.6 instead
of the actual 1.7, the flame == 0 branch in voices.rs); the JSON was
corrected and behaviour is unchanged. Save keys, raid order, RNG and
gameplay traces are untouched.

Verified: core release 194 passed + 8 scenarios (7 ignored), adapter
64 unit + 1 boundary + 5 scenarios, WASM contract 27 steps, catalog and
model generators fresh, asset/sound/model-bound/report tests pass.
2026-11-04 21:00:35 +03:00
chexit abf3d76fdb docs: record the real MP4 acoustics check (#96)
Pairs of the same replay exported with acoustics on and off on the
scratch world (no HORIZON_NO_AUDIO): acoustics and capture ownership
both ready. The open field has no reverb send by design, so it shows
occlusion/air absorption only; the stone court's on-track is quieter
and darker, and its residual after a gain fit is low-passed and
stereo-decorrelated, i.e. the wet path. A clean reverb tail/RT60 in a
real MP4, echoes alone and listening remain open. No code changes.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-04 20:52:11 +03:00
chexit e6a7000440 docs: record the engine cleanup for failed film takes
Engine 60cc7b11d removes a failed or cancelled take's video, raw sound
and log, carries the log's last lines in the error, and only creates
<name>.mp4 after a successful finish. A real failing encoder on the
scratch world left no temporaries and kept the earlier film byte for
byte; successful audio and no-audio control films still verified.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-04 20:19:51 +03:00
chexit cec7257ea1 Pin the engine that frees a failed film take's files
horizon 60cc7b11d (on top of 57f8b2853, API 29) removes a failed or
cancelled take's video, raw sound and log, carries the log's last lines
in the error, and only creates <name>.mp4 after a successful finish.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-04 20:17:52 +03:00
chexit 503e6e29af Fix dynamic model lighting and document GPU comparison (#123)
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-04 17:53:10 +03:00
chexit 675967ce42 End the show when its world closes and verify the MP4 lifecycle (#89)
A frame hook ends an active film or export when the world is gone. The game
stops ticking at the title screen but keeps rendering, so an export used to
keep recording the title with its playback clock frozen (a sec=10 request
produced 3898 frames) and went on after re-entering the world. Session
cleanup runs once with WorldChange and cancels the capture.

Real short exports on a scratch home and world (pin 57f8b2853, API 29,
Metal): h264+AAC both 2.07 s with non-silent audio, reported frames equal
ffprobe nb_frames; cancel, SDK refusal, encoder failure and restart all
leave no capture running; 1920x1080 works. The engine still leaves
*.audio.raw and *.ffmpeg.log behind on an encoder error (game/film.rs).

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-04 17:44:28 +03:00
chexit 632061d2ad docs: archive clean API29 WASM fuel acceptance
build / mod (push) Failing after 20s
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 16:23:22 +03:00
chexit 56339b076e docs: hand off catalog, model, API29 and acoustics continuation
build / mod (push) Failing after 20s
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 16:21:29 +03:00
chexit c1a595b773 feat: expose light and sound processing diagnostics with isolated cameras
build / mod (push) Failing after 21s
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 16:19:06 +03:00
chexit 914f723d1f Verify aircraft models as lit mod instances
build / mod (push) Failing after 20s
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 16:16:47 +03:00
chexit d45d59df9f build: pin source-manager processing handshake
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 16:12:53 +03:00
chexit cfae0c1253 Refine cruise silhouette and document model comparisons
build / mod (push) Failing after 19s
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 16:09:14 +03:00
chexit 53669887dd Refine Lancet silhouette with swept X wings
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 16:09:14 +03:00
chexit 4c7c887917 build: pin point-light handshake and mass acoustics fixture
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 16:09:14 +03:00
chexit daa9ed7cbc Use catalog sound identifiers throughout runtime
build / mod (push) Failing after 19s
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 16:01:19 +03:00
chexit 1553976484 Share sound identifiers and metadata with resource generation
build / mod (push) Failing after 18s
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 15:59:18 +03:00
chexit 0c870c10d5 Represent damage diagnostics as typed reasons
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 15:59:18 +03:00
chexit eea1b3692e Share aircraft and item catalog with asset generation
build / mod (push) Failing after 20s
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 15:55:45 +03:00
chexit cb73cb7ccc Move world cache report to presentation adapter
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 15:55:45 +03:00
chexit 375fdf2d80 Separate battery status from player-facing text
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 15:55:45 +03:00
chexit 63aefc7621 test: record measured callback fuel in budget reports
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 15:55:45 +03:00
chexit d410e2c92d docs: archive the reproduced fuel failure and bounded cache fix
build / mod (push) Failing after 18s
Preserve the diagnostic trigger, scenario, before/after logs and scope of equivalent counters. Update ground strike guidance, Windows acceptance status and profiler semantics.

Co-authored-by: Codex <codex@openai.com>
2026-11-03 11:39:23 +03:00
chexit ab737e7390 test: verify empty nearby depot feedback in WASM
build / mod (push) Failing after 18s
Co-authored-by: Codex <codex@openai.com>
2026-11-03 11:34:02 +03:00
chexit 3b470ddc8a build: pin optional per-callback WASM fuel profiling
The opt-in test CLI reports measured guest fuel separately from host and GPU costs; runtime limits remain unchanged.

Co-authored-by: Codex <codex@openai.com>
2026-11-03 11:34:02 +03:00
chexit cbd6067e8f fix: explain empty strike stock and ground attack prerequisites
build / mod (push) Failing after 19s
Show typed depot cargo separately, identify an empty nearby depot, and document loading, reconnaissance, two ID namespaces and reverse pickup.

Co-authored-by: Codex <codex@openai.com>
2026-11-03 11:26:52 +03:00
chexit cc48302b36 Exercise two maximum menu raids with terrain replies
Co-authored-by: Codex <codex@openai.com>
2026-11-03 11:26:52 +03:00
chexit 1f28f8361f Bound height cache invalidation per explosion
Co-authored-by: Codex <codex@openai.com>
2026-11-03 11:23:47 +03:00
chexit 10f24b5df8 docs: record verified overlap stress and unresolved Windows report
build / mod (push) Failing after 19s
Keep the corrected historical coverage claim, archive the real flat-world WASM run, explain trap diagnostics and the small HD trail density change.

Co-authored-by: Codex <codex@openai.com>
2026-11-03 10:54:57 +03:00
chexit 293236490b test: freeze the exact budget fixture used by the runtime
build / mod (push) Failing after 17s
Derive synthetic terrain metadata from the fixture and copy the same bytes that were hashed before building.

Co-authored-by: Codex <codex@openai.com>
2026-11-03 10:49:21 +03:00
chexit bf8551e1a8 Run flat terrain scenario in budget report
Co-authored-by: Codex <codex@openai.com>
2026-11-03 10:43:01 +03:00
chexit 3afebae6bd Cover HD grid during overlapping raids
Co-authored-by: Codex <codex@openai.com>
2026-11-03 10:43:01 +03:00
chexit 326817db9a Add overlapping raids budget scenario with flat terrain
Co-authored-by: Codex <codex@openai.com>
2026-11-03 10:43:01 +03:00
chexit 8f5603847e test: pin real render-query fixtures and correct raid coverage claims
build / mod (push) Failing after 18s
Archive the original budget report as insufficient proof of overlapping raids. Pin callback/fuel diagnostics and an opt-in flat render world that services actual guest queries.

Co-authored-by: Codex <codex@openai.com>
2026-11-03 10:36:45 +03:00
chexit bd091e60df Exercise overlapping Oreshnik splits and recording
Co-authored-by: Codex <codex@openai.com>
2026-11-03 10:36:42 +03:00
chexit 296a64ffaa Exercise overlapping menu raids on answered terrain
Co-authored-by: Codex <codex@openai.com>
2026-11-03 10:34:31 +03:00
chexit a41a4d17cf Verify sequential raid requests in budget scenario 2026-11-03 10:32:31 +03:00
chexit 692ae77af7 Slightly densify missile smoke trails
build / mod (push) Failing after 18s
Co-authored-by: Codex <codex@openai.com>
2026-11-03 10:25:56 +03:00
chexit 19c53fda4c docs: record API27 readiness and reverse logistics verification
build / mod (push) Failing after 19s
Document capability milestones, budget limits versus measurements, real-game no-audio observations, reverse pickup reservation and the Windows stale-URL fix.

Co-authored-by: Codex <codex@openai.com>
2026-11-03 10:22:53 +03:00
chexit aab3e784b8 build: reuse the pinned engine target cache for its packer
build / mod (push) Failing after 18s
Co-authored-by: Codex <codex@openai.com>
2026-11-03 00:27:02 +03:00
chexit 8d5d0d1dd7 Test WASM budget report failure paths
Co-authored-by: Codex <codex@openai.com>
2026-11-03 00:25:28 +03:00
chexit 910f02ca92 feat: consume scoped engine capabilities and preserve safe fallbacks
build / mod (push) Failing after 19s
Pin API27, diagnose prepared states, gate capture ownership and keep far-sound fallback until acoustics is prepared. Retain engine changes in build provenance and cancel invalid return reservations after cell loss.

Co-authored-by: Codex <codex@openai.com>
2026-11-03 00:24:46 +03:00
chexit 4dddea2e8c Add opt-in heavy WASM budget tier
Co-authored-by: Codex <codex@openai.com>
2026-11-03 00:23:25 +03:00
chexit b0085cb3e8 Test interrupted return pickup
Co-authored-by: Codex <codex@openai.com>
2026-11-03 00:18:44 +03:00
chexit e9fbaba1d6 Preserve pending delivery and command completion behavior
Co-authored-by: Codex <codex@openai.com>
2026-11-03 00:18:44 +03:00
chexit bb931ab95c Return loaded RM48U to depot by truck
Co-authored-by: Codex <codex@openai.com>
2026-11-03 00:18:44 +03:00
chexit d3378b37a2 fix: synchronize the engine submodule URL before updating
build / mod (push) Failing after 18s
Reproduce stale upstream configuration with real local Git repositories, including the already-matching pin fast path.

Co-authored-by: Codex <codex@openai.com>
2026-11-03 00:18:41 +03:00
chexit e70d7a667b docs: describe implemented realism mechanics and verified handoff
build / mod (push) Failing after 18s
Record actual save field positions, motor phases, finite typed delivery, last-known radar contacts and blast-cover policy. Include per-seed baseline measurements and distinguish native/WASM checks from pending GUI acceptance.

Co-authored-by: Codex <codex@openai.com>
2026-11-03 00:07:31 +03:00
chexit 6e2d661b39 test: exercise radar silence through the real WASM boundary
build / mod (push) Failing after 18s
Co-authored-by: Codex <codex@openai.com>
2026-11-03 00:02:52 +03:00
chexit a7b8cb980a Apply coast drag after interceptor burnout
Co-authored-by: Codex <codex@openai.com>
2026-11-03 00:02:50 +03:00
chexit ce76f20074 Target SEAD strikes at observed radar contacts
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:59:11 +03:00
chexit e38ca0d9ab Match impact speed to swept segment
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:59:11 +03:00
chexit e3ca3fbd8c Release interceptor engine source at burnout
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:59:11 +03:00
chexit 44a023006d Use interceptor energy for residual fuse chance
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:59:11 +03:00
chexit f3985d5363 Record energy loss and exercise meeting geometry
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:59:11 +03:00
chexit 6b6293f353 Cover lead for crossing target
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:59:11 +03:00
chexit 932a8b7761 Use swept meeting point for interceptor impact
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:59:11 +03:00
chexit 143d9b2858 Prototype finite interceptor motor and coast
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:58:54 +03:00
chexit b377a5d8d2 test: preserve delivery requests alongside radar emission saves
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:58:15 +03:00
chexit 9e1e0f5543 Update network risk fixture for observed radar
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:56:52 +03:00
chexit 88f940546b Test radar silence and replay seeking
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:56:52 +03:00
chexit 0df225a2de Observe emitting radars and expose emission control
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:56:52 +03:00
chexit 26b258f00f Add persisted radar emission switch
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:56:52 +03:00
chexit 952a10f360 Exercise strike delivery across movement and save restore
build / mod (push) Failing after 18s
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:55:56 +03:00
chexit c775f31544 Deliver typed strike rounds by transport loader
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:55:56 +03:00
282 changed files with 107822 additions and 3122 deletions
+21 -2
View File
@@ -1,6 +1,8 @@
# На каждый пуш: только мод (.hmod, один для всех ОС) и релиз build-<номер> с ним.
# Раннер живёт на одной машине с Gitea и другими сервисами (2 ядра, 4 ГБ): сборка мода лёгкая —
# один поток компиляции, низший приоритет, без системных пакетов и без кэша target.
# Диск у раннера тоже общий с базой Gitea: 23.11.2026, дойдя до тестов, джоба уронила базу до конца прогона.
# Поэтому один закреплённый тулчейн вместо stable поверх него и без каталогов target тестов к моменту сборки мода.
# Игра-форк здесь не собирается: только по тегу версии (release.yml, Windows) и вручную (game.yml Linux, desktop.yml macOS).
name: build
@@ -22,9 +24,19 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
# Не начинать, когда места мало: иначе сборка займёт диск до конца, а база Gitea на нём падает.
- name: Ресурсы раннера
run: |
df -h / | tail -1
free -m | sed -n '1,2p'
FREE=$(df --output=avail -BM / | tail -1 | tr -dc 0-9)
if [ "$FREE" -lt 4000 ]; then echo "::error::на сервере свободно ${FREE} МБ, нужно хотя бы 4000"; exit 1; fi
# Только закреплённый тулчейн из rust-toolchain.toml: stable ставился раньше и лежал мёртвым грузом.
- name: Rust
run: |
curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --target wasm32-unknown-unknown
CHANNEL=$(sed -n 's/^channel = "\(.*\)"$/\1/p' rust-toolchain.toml)
if [ -z "$CHANNEL" ]; then echo "::error::rust-toolchain.toml: не прочитан channel"; exit 1; fi
curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain "$CHANNEL" --target wasm32-unknown-unknown
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
# Без actions/cache: кэш-сервер раннера из контейнеров задач недоступен — восстановление
# падало по таймауту, а сохранение вешало «Complete job» на пару минут. Инструмент собирается заново.
@@ -32,21 +44,28 @@ jobs:
run: nice -n 19 python3 tools/airdef.py fork
- name: Проверка закреплённого checkout
run: python3 -m unittest discover -s tools -p test_engine_checkout.py
# Системный Python образа — externally managed (PEP 668): без --break-system-packages pip отказывает,
# и тесты со сборкой ниже вообще не запускаются. Контейнер задачи одноразовый, так что --user безопасен.
- name: Проверка generated assets
run: |
python3 -m pip install --user -r tools/requirements.txt
python3 -m pip install --user --break-system-packages -r tools/requirements.txt
python3 tools/gen_catalog.py --check
python3 -m unittest discover -s tools -p test_sound_catalog.py
python3 tools/gen_models.py --check
python3 -m unittest discover -s tools -p test_model_bounds.py
# После тестов их каталог target не нужен (модуль собирается под wasm заново), а на диске его место.
- name: Тесты ядра без SDK
working-directory: airdef-core
run: |
HOST=$(rustc -vV | sed -n 's/^host: //p')
nice -n 19 cargo test --target "$HOST"
rm -rf target
- name: Тесты мода
working-directory: airdef-mod
run: |
HOST=$(rustc -vV | sed -n 's/^host: //p')
nice -n 19 cargo test --target "$HOST"
rm -rf target
- name: Мод
run: nice -n 19 python3 tools/airdef.py mod
- name: Релиз
+27
View File
@@ -0,0 +1,27 @@
# Opt-in heavy sandbox runtime tier; separate from the routine WASM contract.
name: wasm-budget
on:
workflow_dispatch:
env:
CARGO_BUILD_JOBS: "1"
CARGO_INCREMENTAL: "0"
jobs:
budget:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Rust
run: |
curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --target wasm32-unknown-unknown
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Actual WASM budget scenario
run: nice -n 19 python3 tools/airdef.py test-budgets
- name: Preserve machine-readable provenance
if: always()
uses: actions/upload-artifact@v4
with:
name: wasm-budget-provenance
path: .horizon-cache/wasm-budget-report.json
if-no-files-found: warn
+1
View File
@@ -2,6 +2,7 @@ run-home/
.horizon-cache/
airdef-mod/target/
airdef-core/target/
tools/rt-probe/target/
__pycache__/
/out/
.DS_Store
+6
View File
@@ -0,0 +1,6 @@
# AirDef Project Rules
- Active gameplay worktree is `/Users/chexit/Documents/zcode/airdef/gameplay/village-defense` (do NOT edit `/Users/chexit/Documents/zcode/airdef/airdef`).
- After completing and verifying any task that modifies code or docs, **always commit and push directly to `origin/kimi-work`** (`git push origin HEAD:kimi-work`) without asking the user first.
- If the `horizon/` engine submodule was modified, commit and push it to `ssh://git@gitea.maoniao.team:2222/chexit/horizon-airdef.git` (`HEAD:refs/heads/kimi-work`) first, then include the updated `horizon` gitlink in the main commit to `origin/kimi-work`.
- Stage only the relevant project files explicitly — never stage untracked build artifacts such as `tools/model-preview/{Cargo.lock,target/}` or untracked `target/` directories inside `horizon/`.
+170 -38
View File
@@ -30,6 +30,14 @@ python3 tools/airdef.py all # получить закреплённый дв
python3 tools/airdef.py play # запустить (аргументы игры — после: --world "Имя мира")
```
`all` синхронизирует URL сабмодуля из `.gitmodules`, включая обновление со старого upstream.
Продолжение 4 ноября: [модели, границы ядра, общий каталог, API29 и массовая акустика](docs/CONTINUATION-2026-11-04.md).
Диагностика в игре: `/airdef capabilities` показывает доступность API, принятие запроса и
подготовку дыма, акустики и захвата именно этого мода. Подготовка не означает готовый GPU-кадр или MP4.
Для разработчика: `python3 tools/airdef.py test-wasm` — лёгкий ABI-тест;
`python3 tools/airdef.py test-budgets` — отдельный тяжёлый сценарий с JSON-отчётом.
Для разработки: `./install.sh` перегенерирует модели (`tools/gen_models.py`, нужен Pillow) и звуки
(`tools/gen_sounds.py`, нужны numpy и ffmpeg), собирает и ставит мод. Сгенерированные файлы лежат в репозитории,
так что для обычной сборки нужен только Rust.
@@ -52,27 +60,44 @@ CI: `.gitea/workflows/build.yml` на каждый пуш собирает то
| Развернуть Patriot / Гепард / Панцирь-С1 / С-400 / С-500 | ставит комплекс на блок под прицелом, носом по взгляду |
| Свернуть ПВО | убирает ближайший комплекс у точки под прицелом |
**Командный пункт:** клавиша **N** или `/airdef menu`. В нём список комплексов: выбери комплекс и включай или выключай классы целей
(дроны, реактивные дроны, крылатые, сверхзвуковые, баллистика), есть сброс по умолчанию. Там же кнопки «Командный
пункт» (сетка), «Налёт…» и «Огонь, ремонт, эффекты…» (огонь ПВО, ремонт всех, эффекты, разрушения).
**Меню AirDef:** клавиша **N** или `/airdef menu`. В разделе «Классы целей» можно включить или выключить
классы для каждого типа комплекса и сбросить их по умолчанию. В меню также открываются командный пункт,
налёты, повторы и настройки.
**Налёт (меню N → «Налёт: состав и запуск…»):** на первой странице состав — клик по типу листает число
(0, 1, 2, 3, 4, 6, 8, 10, 15, 20, 30, 40); на второй — готовый вариант («Рой Шахедов», «Массированный удар»,
«Баллистика», «Гиперзвук», «Орешник с прикрытием», «Подавление ПВО»), откуда (один сектор, два, со всех сторон,
волнами по типам), дальность старта, цели и **ПУСК**. Цели:
- *только объекты* — всё летит по отмеченным объектам (или по игроку, если их нет);
- *объекты и ПВО* — треть ударных средств бьёт по случайным комплексам;
- *умный противник* — планировщик знает, где стоят комплексы и что видят их РЛС: ведёт дроны и крылатые ракеты
- *объекты и ПВО* — часть ударных аппаратов бьёт по случайным комплексам. Баллистика летит по отмеченным объектам;
- *умный противник* — планировщик использует наблюдённые контакты и последние известные позиции комплексов: ведёт дроны и крылатые ракеты
маршрутами в обход зон поражения, низко, за рельефом и через мёртвые зоны; «Герберы» прилетают на 15 с раньше,
чтобы оттянуть ракеты; «Ланцеты» идут по Гепардам и Панцирям, Х-22/Циркон и часть баллистики — по дальнобойным
комплексам; на каждую РЛС дальнего обнаружения идут 2–3 быстрых ударника (Х-22, Циркон, Искандер, Кинжал, затем Х-101,
Герань-3, Ланцет, Шахед; не больше четверти налёта); всё остальное стартует со сдвигом так, чтобы прилететь одновременно.
чтобы оттянуть ракеты. На технику вместе с наблюдёнными РЛС выделяется до четверти большого налёта.
Баллистика и остальная ударная группа идут по отмеченным объектам. В режиме волн группы прибывают с интервалами.
После налёта приходит отчёт: сколько сбито и прорвалось, ракет ПВО потрачено, комплексов потеряно, урон объектам.
**Оборона деревни** доступна из меню N или через `/airdef scenario village normal`
(`easy` и `hard` меняют бюджет и состав волн). Встаньте в деревне и выберите сложность.
Если целей ещё нет, мод отметит три точки по высотам местности рядом с игроком.
Можно заранее отметить ровно три целых объекта самостоятельно. По порядку отметок это штаб, лазарет и укрытие.
Расставьте технику и выберите «Начать оборону» или `/airdef scenario village start`.
Стоимость техники показывает `/airdef scenario village prices`. Через пять секунд начинается первая из трёх волн.
В паузах по 30 секунд можно тратить остаток бюджета. Боезапас, урон и запас складов сохраняются между волнами.
Для победы нужны уцелевший штаб и минимум 65 баллов. Целые объекты дают 50, 30 и 20 баллов соответственно,
повреждённые дают долю от этих значений. При потере всех трёх объектов сценарий заканчивается досрочно.
Сценарий можно остановить командой `/airdef scenario village stop`.
Она оставляет расстановку и уже начатый налёт в мире.
**Разбор прорывов** доступен из меню деревни, из меню повторов или командой `/airdef breaches [страница]`.
В истории текущего сеанса остаются последние 128 попаданий. Видны время первого замера РЛС, число запущенных
перехватчиков и состояние ближайших комплексов в момент перед ударом. После перезахода часть данных по
уже летящим аппаратам может быть неизвестна.
**Обнаружение.** РЛС видит цель не дальше, чем позволяют:
- её размер: дальность растёт как корень четвёртой степени из ЭПР — Х-101 и Ланцет видно примерно вдвое ближе, чем Х-22;
- радиогоризонт: низколетящую цель видно поздно (Шахед на 25 м — с ~250 м, баллистику — издалека);
- радиогоризонт: низколетящие цели обнаруживаются ближе, чем цели на большой высоте;
- рельеф и лес: за холмом цель не видна (каждый комплекс строит свой горизонт по 48 лучам; рельеф известен в
прогруженных чанках);
- вблизи (24 м) видно всё.
@@ -82,19 +107,41 @@ CI: `.gitea/workflows/build.yml` на каждый пуш собирает то
**Сохранение.** Комплексы, объекты, их повреждения и настройки сохраняются отдельно для каждого мира (и для каждого
сервера); уничтоженный комплекс остаётся остовом и после перезахода, пока его не отремонтируют.
Налёт в воздухе тоже сохраняется: дроны, очередь их запуска и незавершённые задания на маршрут
восстанавливаются, и перезаход не обрывает перенацеливание. Ракеты-перехватчики в воздухе и площадки
запуска не сохраняются; сценарий — стартовое состояние и налёт не несёт.
**Сеть ПВО.** Единицы обмениваются измеренными треками в пределах игровой связи; повреждение связи
сокращает её дальность. Можно поставить несколько С-400/С-500 без собственной РЛС и общие радары
поиска, сопровождения и мачтового обзора: N → «Разместить элементы батареи…».
поиска, сопровождения и мачтового обзора — отдельными пультами (`/airdef give` выдаёт `deploy_radar_search`, `deploy_radar_track`, `deploy_radar_height`) или командой `/airdef deploy radar_search|radar_track|radar_height`.
Поисковый радар даёт подсказку; огневой должен сам измерить цель, прежде чем разрешить пуск.
Старая сборная конфигурация сохранена. [Команды, источники и ограничения](docs/BATTERIES-AND-COLD-LAUNCH.md).
P1-SUN также использует чужие данные. Пушкам (Гепард,
пушки Панциря) нужна своя цель: они стреляют только по тому, что видят сами. Уничтоженная РЛС — дыра в сети.
**Логистика.** Пока нет ни одного склада, магазины пополняются сами, как раньше. Как только поставлен склад,
боекомплект считается: комплекс без ракет пишет «ЖДЁТ БК»; в 60 м от склада он перезаряжается прямо с него, а
**Радиомолчание.** `/airdef radar <номер> off|on` или кнопка в карточке техники на карте
выключает/включает собственный радар. Приём разрешённых внешних треков сохраняется; чужой трек
не заменяет обязательное собственное сопровождение. Выключение не стирает старые сведения противника:
он продолжает использовать последнюю наблюдённую позицию, а пуски и РЭБ могут снова раскрыть технику.
**Логистика.** Боекомплект конечный с момента размещения техники. Комплекс с пустым боекомплектом показывает
«ЖДЁТ БК». В 60 блоках от склада он перезаряжается прямо с него, а
дальние обслуживают **ТЗМ**: заправляются на складе (2 перезарядки), сами едут к ждущим комплексам, ближайшим
первым, и возвращаются. Запас склада — 30 перезарядок, он виден в сводке. Склад и ТЗМ детонируют всем грузом.
первым, и возвращаются. ТЗМ ищет проезд с любой стороны получателя. Если объезда нет, машина может
уложить короткий мост или пандус из булыжника и расчистить до двух слоёв мягкого грунта. Строительство
требует разрешения на команды изменения мира. Запас склада — 30 перезарядок, он виден в сводке.
Склад и ТЗМ детонируют всем грузом.
Ударная **RM48U у С-400** — отдельный условный игровой боеприпас, который делит четыре ячейки
с ракетами ПВО. `/airdef ground-stock <склад> <количество>` задаёт конечный начальный запас
sandbox-сценария, `/airdef ground-load <С-400>` загружает одну ракету рядом со складом либо
создаёт заявку на доставку ТЗМ. Груз едет физически; снятая ракета ПВО возвращается на склад.
Заявка и груз сохраняются в пути. `/airdef ground-unload <С-400>` выгружает ракету у склада,
а вдали создаёт заявку на обратный вывоз ТЗМ. Одна ракета резервируется от пуска до забора;
`/airdef ground-cancel <С-400>` отменяет ещё ожидающую доставку или вывоз.
После забора ракета находится в машине и едет на склад. Отмена заявки не возвращает уже вывезенный груз в ПУ.
Без склада этот ударный боеприпас сам не появляется. Бук и остальные комплексы такого профиля пока не имеют.
Порядок подготовки, разведка и номера двух списков: [как ударить по ПУ](docs/GROUND-STRIKES.md).
**Перемещение.** **Пульт перемещения**: навестись на технику (выбрать), затем на точку на земле — она
сворачивается (С-400 и другие с вертикальным пуском дольше, Гепард и Панцирь быстро), едет по рельефу и
@@ -108,8 +155,11 @@ P1-SUN также использует чужие данные. Пушкам (Г
**Умный противник учится.** Он запоминает, откуда его налёты сбивали, а откуда они прорывались, и следующий
налёт ведёт с лучшего направления; помнит комплексы, выдавшие себя пуском, и станции РЭБ, и во время налёта
перенацеливает ещё не взлетевшие Ланцеты и Шахеды на них; если цель-комплекс уничтожен, дроны идут к
следующему известному. Дроны под обстрелом прижимаются к земле.
может перенацелить часть ещё не взлетевших аппаратов. Удары по технике занимают до четверти большого
налёта. Баллистика на всех этапах сохраняет отмеченный объект. Если цель-комплекс уничтожена, выделенные
на удар по технике аппараты могут выбрать другой известный комплекс. Маршруты к новым целям достраиваются по бюджету планировщика в следующих тиках:
необработанное задание не теряется, старый безопасный участок остаётся до готовности нового, а дрон без
маршрута летит прямо только до ближайшего бюджета. Дроны под обстрелом прижимаются к земле.
**Ночь.** Исправные пушки с собственным свежим радарным сопровождением не теряют точность из-за темноты.
Цели освещают **прожекторы** (луч ведёт ближайшую
@@ -125,7 +175,11 @@ P1-SUN также использует чужие данные. Пушкам (Г
тонмаппинг (ванильный диапазон не трогается, сжимается только то, что ярче). Источники передаются движку новым
API мода `render.set-lights` (до 512, плавно интерполируются), режим — `render.set-lighting`.
**Сетка J** после сбития ещё 3,5 с держит камеру на сбитой цели, и комплекс в это время не пропадает из сетки.
В HD дымовые следы ракет немного уплотнены; число сегментов и время появления/выгорания сохранены.
Это относится к ракетам ПВО, RM48U, крылатым, сверхзвуковым и баллистическим средствам;
дым пожаров и слабая дымка винтовых дронов остались прежними.
**Сетка камер** после сбития ещё 3,5 с держит камеру на сбитой цели, и комплекс в это время не пропадает из сетки.
**Повреждения.** Взрыв рядом с комплексом повреждает его: он хуже поворачивается, хуже видит и попадает,
дымит, ниже 35% горит. Уничтоженный остаётся горящим остовом, его боекомплект детонирует: чем больше ракет
@@ -133,16 +187,50 @@ API мода `render.set-lights` (до 512, плавно интерполиру
пострадать. Объекты (Целеуказатель или `/airdef target here`) имеют прочность, она видна в сводке. Ремонт —
кнопкой в меню или `/airdef repair`.
Известные стены и рельеф ослабляют **непрямой** урон корпусу, узлам и объектам; проёмы дают
частичное воздействие. Используется геометрия, известная перед разрушением. При неизвестной или
устаревшей геометрии сохраняется прежний урон без защиты; поздний ответ его повторно не наносит.
Прямое вооружённое попадание этим ослаблением не отменяется.
**Монитор комплекса:** клавиша **K** листает комплексы по очереди, после последнего монитор скрывается. Слева вверху показано:
- состояние комплекса (поиск, сопровождение, доворот, захват, пуск, огонь, перезарядка, огонь запрещён);
- его РЛС: цели, по которым он работает, красным, остальные серым, текущая цель жёлтым;
- камера комплекса: настоящий вид мира из точки комплекса (второй рендер форка), с зумом на цель — тепловизор
при сопровождении, в поиске днём цвет, ночью ПНВ; рамка захвата, дальность, высота, скорость и пеленг.
**Командный пункт ПВО (сетка):** клавиша **J** (или `/airdef grid`, или кнопка в меню N) — на весь экран сетка
до 8 комплексов: у каждого состояние, РЛС, живая камера, прочность и боекомплект. Если комплексов больше, показываются
самые занятые (стреляют, держат захват, сопровождают, горят), раз в 2 секунды; комплекс с монитора K — всегда.
Повторное J закрывает.
**Командный пункт ПВО:** клавиша **J** или строка «Командный пункт» в меню **N** открывает прокручиваемый список
всей развёрнутой техники. Кнопка фильтра перебирает роли и состояния. Для поиска по названию или номеру используйте
`/airdef post Панцирь` или `/airdef post 12`. Нажатие на строку открывает карточку. В ней видны текущая причина,
отметка и её источник. Из карточки можно открыть карту, камеру, историю решений и закрепить технику.
История показывает отказы на проверке, фактические выстрелы и известные исходы с отметкой, которая была у комплекса
на тот момент. По записи завершившегося налёта можно открыть соответствующий кадр повтора.
История живёт вместе с повторами текущей игровой сессии. В ней доступны последние 128 записей выбранного комплекса.
Та же карточка доступна с выбранного маркера на карте **M** и по **I** при открытом мониторе **K**.
В мире от первого лица наведите прицел на видимую часть техники на расстоянии до 24 блоков и нажмите **I**.
Если между прицелом и моделью есть блок, карточка по наведению не откроется.
**Веб-пульт для планшета:** живая карта, карточки техники, архив налётов и запуск сценариев с отдельным доступом
оператора. Запуск на ПК командой `python3 tools/airdef.py web`. [Подключение планшета и режимы доступа](docs/WEB-PANEL.md).
**Сетка камер** открывается отдельной кнопкой в списке или командой `/airdef grid`. В ней до восьми живых
камер со статусом, РЛС, прочностью и боекомплектом. Камеры подбираются по активности каждые две секунды.
Закреплённый комплекс получает приоритет, а при отсутствии закрепления приоритет у выбранного на мониторе K.
**Тактическая карта:** клавиша **M** открывает общую карту. Цели обозначены крупными отметками с классом,
курсом и измеренной траекторией; наведение мыши показывает дистанцию, тип, состояние трека и перехват.
По умолчанию доступны только данные сети РЛС. **T** переключает явно подписанный режим «Истина» для
песочницы: в нём белые рамки показывают даже незамеченные аппараты, а жёлтый пунктир — их цель и будущий
маршрут. Этот режим не меняет боевую логику.
**Обзор целей поверх мира:** удерживай **C** — вокруг видимых целей появляются квадратные метки с краткой
строкой: класс, который оценили РЛС (неопознанная цель — «?», без утечки типа), и дистанция; устаревший
трек-прогноз оранжевый и помечен возрастом. Свои перехватчики — маленькие жёлтые квадраты. Это данные сети
РЛС, как на радаре и карте; в режиме «Истина» (`/airdef truth on`, T на карте) добавляются белые рамки
реальных дронов с их настоящим типом — отдельно от сетевых оценок, чтобы видеть расхождение. Отпустил
клавишу — метки исчезли. Метки достаются ближайшим из видимых целей: цель за камерой или за краем
экрана бюджет кадра не тратит, а заголовок показывает, сколько целей в кадре, сколько за кадром и сколько
не поместилось в бюджет. Метки проектируются через камеру последнего отрисованного кадра (`render.project`,
API 31 форка) и следуют за взглядом покадрово; поверх повтора, сетки камер, монитора K и карты M обзор не рисуется.
**Повторы.** Каждый налёт записывается сам: с первой цели в небе до момента, когда небо 5 с чисто
(хранятся 3 последних). Меню N → «Повторы…» или клавиша **R**:
@@ -152,7 +240,12 @@ API мода `render.set-lights` (до 512, плавно интерполиру
целью, потом за перехватчиком (или смотрит из пушки, со стороны на прилёт), в момент сбития время замедляется;
- **полный повтор** — весь налёт, камера-режиссёр сама выбирает, за чем следить; колесо — перемотка, стрелки — скорость;
- **лучшие моменты** — нарезка до 8 самых интересных событий (перехват баллистики и гиперзвука, поражения
объектов, потерянные комплексы, разделение «Орешника») с титрами и замедлением; колесо листает моменты.
объектов, потерянные комплексы, разделение «Орешника») с титрами и замедлением; колесо листает моменты;
- **цепочки боя** — меню N → «Повторы…» → «Цепочки боя»: по каждому контакту короткая строка
«отметка → передача → захват → пуск → исход» с записанными шагами и их временем. Можно отобрать
цепочки по комплексу, прорывы и контакты без записи пуска. В длинном списке можно листать страницы.
Нажатие на строку открывает клип исхода или карту налёта на моменте пуска или отметки.
Текстовый список открывается командой `/airdef chains [номер батареи]`.
Повтор идёт на весь экран с леттербоксом; звук слышен так, как его слышала бы камера. Управление (подсказка
показывается в начале, после нажатия и на паузе): **← →** — перемотка на 5 с (в нарезке — соседний момент),
@@ -162,7 +255,7 @@ API мода `render.set-lights` (до 512, плавно интерполиру
Чтобы в повторах и камерах комплексов была видна земля далеко от игрока, мод включает дальний ландшафт
(48 чанков, упрощённый); выключается в меню N → «Огонь, ремонт, эффекты…» → «Дальний ландшафт».
Клавиши N, K, J, R и U можно переназначить в «Настройки → Моды».
Клавиши N, K, J, I, R, U и C (обзор целей, удержание) можно переназначить в «Настройки → Моды».
Команды:
- `/airdef wave <тип> [кол-во] [дальность]` — налёт на ближайшую цель. Дальность старта — от 60 до 4000 блоков (в меню: 200–4000); землю для площадок, которой нет в загруженных чанках, игра подгружает сама (API 22, `render.load-chunks`, пока идёт поиск), а где подгрузить нельзя (сервер) или нет пригодного места, дроны всё равно стартуют: «за картой», с высоты полёта на заказанной дальности, без площадки. Типы: `shahed`, `geran3`, `lancet`, `gerbera`, `kh101`, `kalibr`, `kh22`, `zircon`, `iskander`, `kinzhal`, `oreshnik` и `mix` (комбинированный удар двумя секторами: «Герберы», шахеды, Герани-3, Х-101, «Калибры», Х-22, Циркон, «Искандер», «Кинжал», при 30+ — «Орешник»);
@@ -172,12 +265,24 @@ API мода `render.set-lights` (до 512, плавно интерполиру
- `/airdef import` — перенести в текущий мир комплексы и цели из старой версии мода (до 0.2.x они были общими для всех миров);
- `/airdef raid` — налёт, настроенный в меню; `/airdef target here` — отметить объект под ногами; `/airdef repair` — ремонт;
- `/airdef lastchance <on|off>` — «последний шанс»: комплекс стреляет и по классу вне ролей, если цель вот-вот попадёт (по умолчанию вкл; сохраняется);
- `/airdef sites` — известные пусковые площадки (ПУ). РЛС с прямой видимостью может заметить сам пуск и получить неточную позицию; несколько наблюдённых пусков уточняют её. Обнаруженный позже дрон даёт только слабое предположение об обратном курсе: скрытые координаты площадки и время невидимого старта не используются. Повторные треки одного полёта не создают ложную точность.
- `/airdef sites` — известные пусковые площадки (ПУ). РЛС с прямой видимостью может заметить сам пуск и получить неточную позицию; несколько наблюдённых пусков уточняют её. Обнаруженный позже дрон даёт только слабое предположение об обратном курсе: скрытые координаты площадки и время невидимого старта не используются. Повторные треки одного полёта не создают ложную точность. Налёт тем же способом и с той же дальностью (в пределах 200 блоков) приходит с тех же сторон, что и прошлый, поэтому площадки стоят там же, где раньше; место площадки, которое РЛС успела определить, запоминается, и следующая площадка там же известна сразу — по ней можно бить до первого пуска.
- `/airdef strike <номер ПУ>` — ручной удар по разведанной площадке из готового физического С-400 с отдельно загруженной RM48U (игровой профиль, #118). Четыре ячейки делятся с боезапасом ПВО; приказ резервирует носитель и ячейку, открывает крышку и списывает одну ударную ракету при выбросе. Выбирается готовый комплекс с наибольшим остатком RM48U, затем ближайший к цели. Есть открытие ТПК, выброс, отложенное включение двигателя и разгон, ограниченная игровая траектория, столкновения и запись пуска. Несуществующее «ПВО площадки» не перехватывает ракету по броску вероятности.
- `/airdef ground-stock <номер склада> <количество>` — задать начальный запас RM48U для sandbox-сценария (по умолчанию 0, сам не пополняется). `/airdef ground-load <номер С-400>` — у живого склада в пределах 60 блоков загрузить одну RM48U, сохранив снятую ракету ПВО на складе; `/airdef ground-unload <номер С-400>` — вернуть её и восстановить снятую ракету ПВО, если она осталась. Запас сохраняется с миром. Автоматическая доставка RM48U через ТЗМ пока не реализована. Совместимость профиля основана на [публикации ГУР](https://gur.gov.ua/content/warsanctions-hur-mo-rozkryvaie-budovu-komponentnu-bazu-ta-pidpryiemstva-kooperatsii-z-vyrobnytstva-udarnykh-raket-rm48u.html); это сообщение ведомства, не независимая сертификация. Дальность, форма полёта и оформление условны для Minecraft.
- `/airdef deploy s400_launcher` и `s500_launcher` — отдельные пусковые без своей РЛС; `radar_search`, `radar_track`, `radar_height` — обзорная, сопровождающая и мачтовая игровые РЛС. Они также доступны через меню N → «Разместить элементы батареи…». `/airdef battery` показывает состав и связь; `/airdef battery <номер> integrated|launcher` меняет конфигурацию, `/airdef radar <номер> multi|search|engagement|height` — роль отдельной РЛС. Обзорная РЛС передаёт подсказки; станция сопровождения должна сама получить свежее измерение, чтобы разрешить пуск. Старые С-400/С-500 сохраняют упрощённую сборную конфигурацию. [Устройство игровой батареи и пуска](docs/BATTERIES-AND-COLD-LAUNCH.md).
- `/airdef ground-stock <номер склада> <количество>` — задать остаток RM48U для sandbox-сценария (по умолчанию 0). `/airdef ground-load <номер С-400>` загружает одну ракету у склада либо заказывает ТЗМ; `ground-unload` возвращает её у склада либо заказывает вывоз; `ground-cancel` отменяет ожидающую заявку. Доставка и обратный вывоз через ТЗМ реализованы, запас и груз сохраняются. [Пошаговый пример](docs/GROUND-STRIKES.md). Совместимость профиля основана на [публикации ГУР](https://gur.gov.ua/content/warsanctions-hur-mo-rozkryvaie-budovu-komponentnu-bazu-ta-pidpryiemstva-kooperatsii-z-vyrobnytstva-udarnykh-raket-rm48u.html); это сообщение ведомства, не независимая сертификация. Дальность, форма полёта и оформление условны для Minecraft.
- `/airdef deploy s400` и `s500` ставят только пусковые без своей РЛС (сборные С-400/С-500 с собственной РЛС убраны; в старых сохранениях они загружаются пусковыми); `radar_search`, `radar_track`, `radar_height` — три разные игровые РЛС с устойчивыми профилями в каталоге, каждая со своей моделью антенны (широкий экран, зеркало, мачтовая головка); универсальная `radar` — прежний экран на шасси, оптический пост `optical` — своя поворотная головка на посту. Они также выдаются отдельными пультами (`/airdef give`) и ставятся на блок как обычные пульты. `/airdef battery` показывает состав, профиль, цикл, продукты измерения и связь; `/airdef battery <номер> integrated|launcher` меняет конфигурацию (для С-400/С-500 доступна только `launcher`). Профиль РЛС задаётся при размещении и не переключается на ходу: `radar <номер> on|off` сохраняется. Обзорная станция даёт редкие грубые отметки и область поиска; мачтовая уточняет низкие контакты над рельефом; сопровождения ищет локально, ведёт ограниченное число точных треков и только её собственное подтверждённое измерение разрешает пуск. Сеть передаёт источник, возраст и качество, но повторная пересылка не освежает измерение. Старые роли РЛС при загрузке сопоставляются с профилями. [Устройство игровой батареи и пуска](docs/BATTERIES-AND-COLD-LAUNCH.md).
- `/airdef roles` — показать, по каким классам целей работает каждый комплекс; `/airdef roles <patriot|gepard|pantsir|s400|s500|all> <классы|default>` — задать (классы через запятую: `drone`, `jet`, `cruise`, `supersonic`, `ballistic` или `all`), например `/airdef roles s400 cruise,ballistic`;
- `/airdef doctrine` — доктрины комплексов (#47; в меню N: «Доктрины…»): `/airdef doctrine <номер|all> reserve <K>` — держать K ракет для срочных целей (баллистика или до удара меньше 12 с); `salvo eco|normal|heavy` — сколько перехватчиков на цель (только базовые / как обычно / на один больше); `sector <центр°> <полуширина°>` или `sector off` — сектор ответственности (0° — север); `guard <объект№>[,<№>]` или `guard off` — стрелять только по тому, что идёт на охраняемые объекты (отметка: `/airdef target here`). По умолчанию ограничений нет; последний шанс сильнее доктрины; `/airdef why <номер>` называет, какая настройка остановила или разрешила пуск; сохраняется с миром и сценариями. Карта охраны и пробелов в ней — вместе с картой (#48).
- `/airdef why <номер>` — почему комплекс стреляет или нет. Сразу под строкой состояния — одна typed-причина:
«есть только обзор», «ждёт сопровождения», «каналы заняты», «нет боезапаса» или «готов к пуску», вместе с возрастом и
источником отметки (своя РЛС или сеть, РЛС №N). «Есть только обзор» — на картине лишь поисковая или
сетевая отметка, своё подтверждённое измерение пуск не разрешает; «ждёт сопровождения» — своя РЛС ещё
уточняет контакт или пусковая ждёт огневой трек поддерживающей РЛС; «каналы заняты» — все каналы
сопровождения заняты другими контактами; «нет боезапаса» — нет ракет и снарядов или идёт перезарядка.
`/airdef why <номер> source` переводит монитор K на станцию, которая поставила отметку. Подробные
проверки (роли, доктрина, дальность, наведение) идут ниже и не расходятся с этой причиной. В обычном
HUD — только картина самой батареи: класс по оценке, без истинного типа и скрытых данных.
- `/airdef chains [номер батареи]` — короткие цепочки последнего налёта: «отметка → передача → захват →
пуск → исход» с временем шагов; без номера — все батареи. Строка кликабельна в меню N → «Повторы…» →
«Цепочки боя» и открывает кадр повтора.
- `/airdef deploy <patriot|gepard|pantsir|s400|s500>` — поставить комплекс в 8 блоках перед собой;
- `/airdef hold on|off` — запретить или разрешить ПВО огонь, удобно для съёмки ударов;
- `/airdef damage on|off` — разрушать ли ландшафт взрывами (через TNT, нужны читы);
@@ -185,10 +290,23 @@ API мода `render.set-lights` (до 512, плавно интерполиру
- `/airdef clear` — убрать дроны и ракеты;
- `/airdef targets clear` — снять все цели;
- `/airdef stats` — сводка.
- `/airdef recon` — debug/послебоевой разбор разведки противника (#135): отметки его картины best-first с причиной приоритета (`свежесть×4 + качество×3 + наблюдаемая роль`), фазы вылетов и дроны, нацеленные на отметку. То же — страница «Разведка противника (разбор)» в меню N. Всеведущая картина противника в обычный HUD не выводится.
Интерфейс:
- **сверху справа — сводка:** тревога, цели по типам, ближайшая угроза (дальность, высота, скорость), перехватчики в воздухе, по каждому комплексу боезапас или перезарядка, его текущая цель и число сбитых, итоговый счёт;
- **снизу справа — радар на 500 м** со сканирующим лучом. Отметки гаснут после прохода луча. Красное — цели (с хвостом по курсу), жёлтое — ракеты, синее — ПВО с кругами дальности, крест — цели удара.
- **сверху справа — сводка:** тревога, цели по типам, ближайшая угроза (дальность, высота, скорость), перехватчики в воздухе, по каждому комплексу боезапас или перезарядка, его текущая цель и число сбитых, итоговый счёт; если сеть держит разведчиков противника — их число и фаза вылета (разведка/донесение/завершение);
- **снизу справа — радар на 500 м** со сканирующим лучом. Отметки гаснут после прохода луча. Красное — цели: форма значка различает дрон, самолёт, крылатую, сверхзвуковую и баллистическую ракету, хвост показывает курс, а близкие отметки объединяются с числом; жёлтое — ракеты, синее — ПВО с кругами дальности, крест — цели удара. Разведчик противника в картине сети — жёлтый полый ромб с подписью «разведчик».
**Разведка противника (#135).** Налёт с целью «умный противник» перед ударом высылает небольшой бюджет
невооружённых разведчиков: они физически проходят игровые зоны вокруг отмеченных целей и передают домой
только область, грубую категорию, канал (пролёт/излучение/РЭБ/пуск) и возраст — не точную точку, тип,
прочность и боезапас. Сбитый до донесения разведчик ничего не передаёт; уже переданное противник помнит
между налётами, а скрытый переезд или выключение не переписывают старую отметку. На карте сети разведчик —
узнаваемый жёлтый ромб с подписью «разведчик» (в sandbox-режиме `/airdef truth on` — янтарная метка и
счётчик отметок), в сводке и на карте видна фаза вылета: разведка → донесение → завершение. Что противник
запомнил и почему выбирает цель, показывает `/airdef recon` и страница «Разведка противника (разбор)» в меню
N (есть и в «Повторы…»): отметки best-first с разбором приоритета (свежесть, качество, наблюдаемая роль) и
дроны, нацеленные на отметку. Это явный debug/послебоевой разбор — всеведущая картина противника в обычный
HUD не выводится. Простые пресеты налёта фазу разведки не получают.
Комплексы ПВО и цели сохраняются между сессиями.
@@ -214,29 +332,40 @@ API мода `render.set-lights` (до 512, плавно интерполиру
| ПВО | Вооружение | Дальность |
|---|---|---|
| Patriot | 4 × PAC-3, пусковая разворачивается на цель | 10–450 |
| Гепард | 2 × 35 мм, башня и стволы со слежением и упреждением, 160 очередей | 135 (слежение с 195) |
| Панцирь-С1 | 12 × 57Э6 и 2 × 30 мм; модуль поворачивается, пакеты и стволы поднимаются | ракеты 25–225, пушки 90 |
| С-400 | 4 × 48Н6, вертикальный холодный старт, РЛС обзора на прицепе | 30–720 |
| С-500 | 2 × 77Н6, холодный старт, самые быстрые ракеты | 40–1050 |
| Patriot | 4 × PAC-3, пусковая разворачивается на цель | 10–950 |
| Гепард | 2 × 35 мм, башня и стволы со слежением и упреждением, 160 очередей | 180 (слежение с 260) |
| Панцирь-С1 | 12 × 57Э6 и 2 × 30 мм; модуль поворачивается, пакеты и стволы поднимаются | ракеты 25–330, пушки 125 |
| С-400 | 4 × 48Н6, вертикальный холодный старт, РЛС обзора на прицепе | 30–1300 |
| С-500 | 2 × 77Н6, холодный старт, самые быстрые ракеты | 40–1850 |
| IRIS-T SLM | 8 ракет, вертикальный пуск, быстрые и манёвренные | 15–600 |
| NASAMS | 6 × AMRAAM, наводимая пусковая на прицепе | 10–450 |
| Бук-М2 | 4 × 9М317 на направляющих, башня с РЛС подсвета | 20–675 |
| Тор-М2 | 8 × 9М338 вертикально из башни, быстрая реакция против дронов | 8–240 |
| Тор-М2 | 8 × 9М338 вертикально из башни, быстрая реакция против дронов | 8–350 |
| P1-SUN | 8 дронов-перехватчиков против Шахедов и Герань; своей РЛС нет — стреляет по данным сети | 5–675 |
Обслуживающая техника (тоже пультами или `/airdef deploy <ключ>`): **РЛС дальнего обнаружения** (`radar`,
видит на 2,5 км с высокой мачты, хуже прячутся за рельефом), **склад боеприпасов** (`depot`), **ТЗМ** (`tzm`),
**станция РЭБ** (`ew`), **прожектор** (`light`). Новые комплексы: `irist`, `nasams`, `buk`, `tor`, `p1sun`.
базовая дальность обзора 3800 блоков до поправок на класс цели, высоту и рельеф), **склад боеприпасов** (`depot`), **ТЗМ** (`tzm`),
**станция РЭБ** (`ew`), **прожектор** (`light`), **оптический пост** (`optical`: пассивно уточняет широкий класс
контакта по прямой видимости и передаёт уточнение в класс уже известного сетевого трека — без своего трека,
свежести и права на пуск; не излучает и не ведёт огневой трек). Новые комплексы: `irist`, `nasams`, `buk`, `tor`, `p1sun`.
**Согласование огня.** Комплексы делят цели между собой: на обычную цель идёт одна ракета, на баллистическую две; чем ближе цель к своей точке попадания,
тем больше перехватчиков разрешено на неё сразу (за ~12 с до удара ещё один, за ~5 с — ещё один). Комплекс, у которого кончились ракеты
или идёт перезарядка, цель не держит; тот, кто не смог навестись за ~2 с, отпускает её другим. Пушки расходятся по разным целям. Первыми бьют по самым опасным (быстрым и тяжёлым) целям, при этом ложные
«Герберы» выглядят для них как настоящие. Шанс поражения падает, если цель быстрее перехватчика.
«Герберы» выглядят для них как настоящие. Геометрия встречи проверяется по движению обоих объектов
за тик, а остаточный шанс учитывает фактическую скорость перехватчика.
**Энергетика перехватчика.** Сначала ракета выходит из ТПК без двигателя: у С-400 это 1,0 с,
у С-500 — 1,2 с; только потом в её текущей точке зажигается факел, и тяга плавно нарастает.
После выброса ракета разгоняется, но двигатель работает конечное игровое время. После выгорания
ракета летит по инерции, теряет скорость и манёвренность; при недостаточной скорости сопровождение
срывается. Факел, звук двигателя и новый дым прекращаются при выгорании и в live, и в повторе;
уже созданный дым продолжает рассеиваться. У ракет с горячим (рельсовым) пуском тяга тоже
нарастает плавно, но холодного выброса нет; электрический P1-SUN не получает ракетную струю.
**Последний шанс** (`/airdef lastchance on|off`, по умолчанию вкл). Комплекс стреляет и по классу целей вне своих ролей
(С-400, С-500 и Patriot по умолчанию не бьют дроны), если цель долетит до своей точки меньше чем за 10 с и на ней ещё нет
ничьего перехватчика. Комплексу с пустыми ролями (огонь запрещён) это не касается. `/airdef why` пишет «последний шанс».
(С-400, С-500 и Patriot по умолчанию не бьют дроны), если цель долетит до своей точки меньше чем за 6 с, на ней ещё нет
ничьего перехватчика и готовый комплекс меньшей дальности не успевает её обстрелять. Комплексу с пустыми ролями (огонь запрещён) это не касается. `/airdef why` пишет «последний шанс».
**Дальний пуск по РЛС.** С-400, С-500 и Patriot могут стрелять дальше своей дальности (до 1,6×) по цели, которую держит
свежим треком РЛС дальнего обнаружения в радиусе связи: не чаще раза в 15 с, при не менее чем половине боезапаса, только по
@@ -320,6 +449,9 @@ run-home/ тестовая игровая папка (для пров
## Известные ограничения
- Для [#122](https://gitea.maoniao.team/chexit/airdef/issues/122) воспроизведено и исправлено исчерпание fuel при массовых взрывах:
каждый взрыв больше не обходит всю карту высот. Проверка на конкретном Windows-компьютере ещё нужна;
прирост FPS этим исправлением не обещается.
- Мод клиентский: дроны и ПВО видит только тот, у кого он стоит. Мультиплеер не поддерживается.
- Окно Horizon на macOS не рисует кадры, пока оно перекрыто другими окнами (это поведение движка).
- Шейдер работает, только если не включён шейдер-пак Horizon (они взаимоисключающие).
+2
View File
@@ -9,5 +9,7 @@ glam = "0.30"
[features]
test-fixtures = []
# Counts the events the by-time journal readers hand out (the `replay_bench` example).
bench-counters = []
[workspace]
+8
View File
@@ -0,0 +1,8 @@
//! The enemy-picture bench (#127) without building the Horizon SDK.
extern crate airdef_core as airdef;
#[path = "../../airdef-mod/examples/intel_bench.rs"]
mod bench;
fn main() {
bench::main();
}
+131
View File
@@ -35,3 +35,134 @@ fn same_seed_same_result() {
let b = harness::run(&harness::logistics());
assert_eq!((a.ticks_run, a.launched, a.kills, a.hits, a.fired, a.ground_queries), (b.ticks_run, b.launched, b.kills, b.hits, b.fired, b.ground_queries));
}
#[test]
fn overlapping_mass_strikes_on_flat_world() {
use airdef::sim::{Aim, Approach, DroneKind as D, Ground, Out, RaidOrder, Sam, Sim};
use glam::DVec3;
let sc = harness::big_smart();
let terrain = harness::Terrain::Flat(70);
let mut sim = Sim::new(sc.seed);
sim.damage = false;
for unit in &sc.units {
let id = sim.id();
sim.sams.push(Sam::new(id, unit.kind, DVec3::new(unit.pos.x, 70.0, unit.pos.z), unit.heading));
}
sim.targets = vec![DVec3::new(0.0, 70.0, 0.0)];
sim.target_health = vec![100.0];
// Exact composition of the menu's "Массированный удар" preset.
let order = RaidOrder { kinds: vec![(D::Gerbera, 8), (D::Shahed, 12), (D::Geran3, 4), (D::Kh101, 4), (D::Kalibr, 4), (D::Kh22, 2), (D::Iskander, 2)], approach: Approach::AllSides, aim: Aim::Smart, dist: 4000.0 };
let mut ground = Ground::default();
let mut pending = Vec::new();
let mut out = Out::default();
let targets = sim.targets.clone();
assert_eq!(sim.order_raid(&order, &targets, &mut out), 36);
let mut second = false;
let mut peak = 0;
for now in 1..=12000 {
if !second && !sim.planning() {
assert_eq!(sim.order_raid(&order, &targets, &mut out), 36);
second = true;
}
ground.answer(std::mem::take(&mut pending), now);
out = Out::default();
sim.step(&mut ground, None, &mut out);
let wanted = ground.take_wanted();
pending = wanted.into_iter().map(|(x, z)| (x, z, 70)).collect();
let sections = ground.world.take_wanted(now);
ground.world.serve(&terrain, sections, now);
peak = peak.max(sim.drones.iter().filter(|d| d.alive()).count());
assert!(sim.drones.iter().all(|d| d.pos.is_finite() && d.vel.is_finite()));
if sim.launched >= 72 && peak > 36 { break; }
}
eprintln!("overlapping mass strikes: launched {}, peak airborne {peak}", sim.launched);
assert!(second && sim.launched >= 72, "second raid failed to launch; launched {}", sim.launched);
assert!(peak > 36, "raids never overlapped; peak {peak}");
}
#[test]
fn overlapping_oreshnik_splits_are_recorded() {
use airdef::sim::{Aim, Approach, DroneKind, Ground, Out, RaidOrder, Sim};
use glam::DVec3;
let mut sim = Sim::new(1);
sim.damage = false;
let targets = vec![DVec3::new(0.0, 70.0, 0.0)];
sim.targets = targets.clone();
sim.target_health = vec![100.0];
let order = RaidOrder { kinds: vec![(DroneKind::Oreshnik, 40)], approach: Approach::Sector, aim: Aim::Objects, dist: 2600.0 };
let terrain = harness::Terrain::Flat(70);
let mut ground = Ground::default();
let mut pending = Vec::new();
let mut out = Out::default();
assert_eq!(sim.order_raid(&order, &targets, &mut out), 40);
let mut second = false;
let mut peak = 0;
let mut peak_subs = 0;
for now in 1..=10000 {
if !second && !sim.planning() {
assert_eq!(sim.order_raid(&order, &targets, &mut out), 40);
second = true;
}
ground.answer(std::mem::take(&mut pending), now);
out = Out::default();
sim.step(&mut ground, None, &mut out);
pending = ground.take_wanted().into_iter().map(|(x, z)| (x, z, 70)).collect();
let sections = ground.world.take_wanted(now);
ground.world.serve(&terrain, sections, now);
peak = peak.max(sim.drones.iter().filter(|d| d.alive()).count());
peak_subs = peak_subs.max(sim.drones.iter().filter(|d| d.alive() && d.kind == DroneKind::OreshnikSub).count());
assert!(sim.drones.iter().all(|d| d.pos.is_finite() && d.vel.is_finite()));
if second && sim.launched >= 80 && !sim.replays.is_empty() { break; }
}
eprintln!("overlapping oreshnik: launched {}, peak airborne {peak}, peak submunitions {peak_subs}, replays {}", sim.launched, sim.replays.len());
assert_eq!(sim.launched, 2880);
assert!(peak_subs > 36, "expected many simultaneous submunitions");
assert!(!sim.replays.is_empty(), "recording did not finish");
}
#[test]
fn two_maximum_menu_raids_with_answered_flat_terrain() {
use airdef::sim::{Aim, Approach, Ground, Out, RaidOrder, Sam, Sim, catalog::RAID_KINDS};
use glam::DVec3;
let sc = harness::big_smart();
let terrain = harness::Terrain::Flat(70);
let mut sim = Sim::new(sc.seed);
for unit in &sc.units {
let id = sim.id();
sim.sams.push(Sam::new(id, unit.kind, DVec3::new(unit.pos.x, 70.0, unit.pos.z), unit.heading));
}
let targets = vec![DVec3::new(0.0, 70.0, 0.0)];
sim.targets = targets.clone();
sim.target_health = vec![100.0];
// The maximum selectable by the menu: 40 for each raid kind.
let order = RaidOrder { kinds: RAID_KINDS.iter().copied().map(|kind| (kind, 40)).collect(), approach: Approach::AllSides, aim: Aim::Smart, dist: 300.0 };
let expected = RAID_KINDS.len() as u32 * 40;
let mut ground = Ground::default();
let mut pending = Vec::new();
let mut out = Out::default();
assert_eq!(sim.order_raid(&order, &targets, &mut out), expected);
let mut second = false;
let mut overlap = false;
let mut peak = 0;
// Two maximum menu raids can keep the last supersonic contact in the air past
// 5000 ticks under the radar profiles; the recording closes once the sky is clear.
for now in 1..=8000 {
if !second && !sim.planning() {
overlap = !sim.queue.is_empty() || sim.drones.iter().any(|d| d.alive());
assert_eq!(sim.order_raid(&order, &targets, &mut out), expected);
second = true;
}
ground.answer(std::mem::take(&mut pending), now);
out = Out::default();
sim.step(&mut ground, None, &mut out);
pending = ground.take_wanted().into_iter().map(|(x, z)| (x, z, 70)).collect();
let sections = ground.world.take_wanted(now);
ground.world.serve(&terrain, sections, now);
peak = peak.max(sim.drones.iter().filter(|d| d.alive()).count());
assert!(sim.drones.iter().all(|d| d.pos.is_finite() && d.vel.is_finite()));
if second && sim.launched >= expected * 2 && !sim.replays.is_empty() { break; }
}
eprintln!("max menu raids: requested {}, launched {}, peak {peak}, replays {}", expected * 2, sim.launched, sim.replays.len());
assert!(second && overlap && sim.launched >= expected * 2 && peak > 40);
assert!(!sim.replays.is_empty(), "raid recording did not finish");
}
+197
View File
@@ -2,13 +2,22 @@
# It is not intended for manual editing.
version = 4
[[package]]
name = "adler2"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
[[package]]
name = "airdef"
version = "0.2.0"
dependencies = [
"airdef-core",
"glam",
"horizon-assets",
"horizon-mod-sdk",
"horizon-mods",
"serde_json",
]
[[package]]
@@ -24,18 +33,75 @@ version = "1.0.104"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"
[[package]]
name = "arbitrary"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bc62ac97cc33321f50863d514c3bc38a453947a8f9e781137e47c7401020aed"
dependencies = [
"derive_arbitrary",
]
[[package]]
name = "bitflags"
version = "2.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"
[[package]]
name = "bumpalo"
version = "3.20.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87a0cf66fd1eb2fb7b822cb78370d82303750809bc6ba855f3f58e517d3238db"
[[package]]
name = "cfg-if"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
[[package]]
name = "crc32fast"
version = "1.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b929dd2a135771f40afabd1073f85eed59c800b7c61901e5c254270497dad64"
dependencies = [
"cfg-if",
]
[[package]]
name = "crossbeam-utils"
version = "0.8.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"
[[package]]
name = "derive_arbitrary"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b034bd7d5f032402a2479444dcc6f74e36a03f31854d41680fb240ef682a1ac"
dependencies = [
"proc-macro2",
"quote",
"syn 3.0.9",
]
[[package]]
name = "equivalent"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826"
[[package]]
name = "flate2"
version = "1.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "626d4928326b646e70f65ed36fc7cf9f206bdb68a0019ee7c6b4709da4e084c4"
dependencies = [
"crc32fast",
"miniz_oxide",
]
[[package]]
name = "foldhash"
version = "0.2.0"
@@ -63,6 +129,22 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "horizon-assets"
version = "0.1.0"
dependencies = [
"horizon-core",
"serde",
"serde_json",
]
[[package]]
name = "horizon-core"
version = "0.1.0"
dependencies = [
"libm",
]
[[package]]
name = "horizon-mod-sdk"
version = "0.1.0"
@@ -70,6 +152,17 @@ dependencies = [
"wit-bindgen",
]
[[package]]
name = "horizon-mods"
version = "0.1.0"
dependencies = [
"log",
"serde",
"serde_json",
"toml",
"zip",
]
[[package]]
name = "id-arena"
version = "2.3.0"
@@ -100,6 +193,12 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
[[package]]
name = "libm"
version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"
[[package]]
name = "log"
version = "0.4.34"
@@ -112,6 +211,16 @@ version = "2.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
[[package]]
name = "miniz_oxide"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c"
dependencies = [
"adler2",
"simd-adler32",
]
[[package]]
name = "prettyplease"
version = "0.2.37"
@@ -153,6 +262,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
dependencies = [
"serde_core",
"serde_derive",
]
[[package]]
@@ -188,6 +298,21 @@ dependencies = [
"zmij",
]
[[package]]
name = "serde_spanned"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c187e0a369471c550af028cba56d4f4fa2a489ad28151ae95a4d340a2a8b782"
dependencies = [
"serde_core",
]
[[package]]
name = "simd-adler32"
version = "0.3.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea"
[[package]]
name = "syn"
version = "2.0.119"
@@ -210,6 +335,45 @@ dependencies = [
"unicode-ident",
]
[[package]]
name = "toml"
version = "1.2.2+spec-1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5426cb1b964690d913f6c5c1a1ae0b42f428ec506bb4d452876d7a209c9bca3b"
dependencies = [
"indexmap",
"serde_core",
"serde_spanned",
"toml_datetime",
"toml_parser",
"toml_writer",
"winnow",
]
[[package]]
name = "toml_datetime"
version = "1.1.3+spec-1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "173f25c883cd2176a2d8212155638c0a60d484a9d84546d270866f40f56b6e49"
dependencies = [
"serde_core",
]
[[package]]
name = "toml_parser"
version = "1.1.6+spec-1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6769c452d71ba30696c6b37770c439a9cc9110f47f7d5cdbeda79840ef5ea31"
dependencies = [
"winnow",
]
[[package]]
name = "toml_writer"
version = "1.2.0+spec-1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "009dbb7700f11c55ef83aebbe4c0e9cf1f1ac0844bd8d6f00dc38f302026e13a"
[[package]]
name = "unicode-ident"
version = "1.0.27"
@@ -250,6 +414,12 @@ dependencies = [
"semver",
]
[[package]]
name = "winnow"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c3b93199df0ab874cdf0c6a94f0a0dc3423fe41f1cafb62b8bd7b1deb277aef"
[[package]]
name = "wit-bindgen"
version = "0.60.0"
@@ -339,8 +509,35 @@ dependencies = [
"wasmparser",
]
[[package]]
name = "zip"
version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1dcb24d0152526ae49b9b96c1dcf71850ca1e0b882e4e28ed898a93c41334744"
dependencies = [
"arbitrary",
"crc32fast",
"crossbeam-utils",
"flate2",
"indexmap",
"memchr",
"zopfli",
]
[[package]]
name = "zmij"
version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
[[package]]
name = "zopfli"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aaf7fc5d30c28483d93805c4a5e12b05bbb52407fa67c5f8bd552374cd01fb11"
dependencies = [
"bumpalo",
"crc32fast",
"log",
"simd-adler32",
]
+11
View File
@@ -8,13 +8,24 @@ description = "AirDef: long-range drones and air defence for the AirDef fork of
[lib]
crate-type = ["cdylib", "rlib"]
[features]
# Counts the events the by-time readers hand out (the `replay_bench` example); off in the mod build.
bench-counters = ["airdef-core/bench-counters"]
[dependencies]
airdef-core = { path = "../airdef-core" }
horizon-mod-sdk = { path = "../horizon/crates/horizon-mod-sdk" }
glam = "0.30"
serde_json = "1"
[build-dependencies]
horizon-assets = { path = "../horizon/crates/horizon-assets" }
[dev-dependencies]
airdef-core = { path = "../airdef-core", features = ["test-fixtures"] }
# The host's own block tracer, so the saturation replica answers render rays exactly as the
# WASM test host does (no runtime: just `world_query`).
horizon-mods = { path = "../horizon/crates/horizon-mods", default-features = false }
[profile.release]
opt-level = "s"
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "airdef:block/optical_head"
}
}
}
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "airdef:block/optical_post"
}
}
}
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "airdef:block/optical_post_burnt"
}
}
}
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "airdef:block/radar_dish"
}
}
}
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "airdef:block/radar_height_head"
}
}
}
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "airdef:block/radar_search_array"
}
}
}
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "airdef:block/radar_trailer_burnt"
}
}
}
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "airdef:item/deploy_optical"
}
}
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "airdef:item/deploy_radar_height"
}
}
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "airdef:item/deploy_radar_search"
}
}
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "airdef:item/deploy_radar_track"
}
}
+19 -8
View File
@@ -34,6 +34,11 @@
"block.airdef.radar_mast": "Радиомачта (секция высоты)",
"block.airdef.radar_trailer": "Прицеп РЛС",
"block.airdef.radar_panel": "РЛС обзора",
"block.airdef.radar_search_array": "Антенна РЛС обзора",
"block.airdef.radar_dish": "Зеркало РЛС сопровождения",
"block.airdef.radar_height_head": "Головка мачтовой РЛС",
"block.airdef.optical_head": "Головка оптического поста",
"block.airdef.optical_post": "Основание оптического поста",
"block.airdef.m57e6": "57Э6",
"block.airdef.m48n6": "48Н6",
"block.airdef.rm48u": "RM48U (игровой профиль)",
@@ -92,19 +97,22 @@
"block.airdef.tor_turret_burnt": "Башня Тора (остов)",
"block.airdef.p1sun_launcher_burnt": "Пусковая P1-SUN (остов)",
"block.airdef.radar_truck_burnt": "Шасси РЛС (остов)",
"block.airdef.radar_trailer_burnt": "Прицеп РЛС (остов)",
"block.airdef.optical_post_burnt": "Основание оптического поста (остов)",
"block.airdef.depot_burnt": "Склад боеприпасов (остов)",
"block.airdef.tzm_truck_burnt": "Транспортно-заряжающая машина (остов)",
"block.airdef.ew_truck_burnt": "Станция РЭБ (остов)",
"block.airdef.searchlight_burnt": "Прожектор (остов)",
"block.airdef.searchlight_head_burnt": "Голова прожектора (остов)",
"item.airdef.designator": "Целеуказатель",
"item.airdef.deploy_radar_search": "Развернуть РЛС обзора",
"item.airdef.deploy_radar_track": "Развернуть РЛС сопровождения",
"item.airdef.deploy_radar_height": "Развернуть мачтовую РЛС",
"item.airdef.mover": "Пульт перемещения",
"item.airdef.flare_gun": "Осветительная ракета",
"item.airdef.remover": "Свернуть ПВО",
"item.airdef.launch_shahed": "Пуск: Шахед-136",
"item.airdef.launch_geran3": "Пуск: Герань-3",
"item.airdef.deploy_patriot": "Развернуть Patriot",
"item.airdef.deploy_gepard": "Развернуть Гепард",
"item.airdef.deploy_pantsir": "Развернуть Панцирь-С1",
"item.airdef.deploy_s400": "Развернуть С-400",
"item.airdef.deploy_s500": "Развернуть С-500",
"item.airdef.launch_lancet": "Пуск: Ланцет-3",
"item.airdef.launch_kh101": "Пуск: Х-101",
"item.airdef.launch_kalibr": "Пуск: Калибр",
@@ -113,6 +121,11 @@
"item.airdef.launch_iskander": "Пуск: Искандер-М",
"item.airdef.launch_kinzhal": "Пуск: Кинжал",
"item.airdef.launch_oreshnik": "Пуск: Орешник",
"item.airdef.deploy_patriot": "Развернуть Patriot",
"item.airdef.deploy_gepard": "Развернуть Гепард",
"item.airdef.deploy_pantsir": "Развернуть Панцирь-С1",
"item.airdef.deploy_s400": "Развернуть С-400 (пусковая)",
"item.airdef.deploy_s500": "Развернуть С-500 (пусковая)",
"item.airdef.deploy_irist": "Развернуть IRIS-T SLM",
"item.airdef.deploy_nasams": "Развернуть NASAMS",
"item.airdef.deploy_buk": "Развернуть Бук-М2",
@@ -123,9 +136,7 @@
"item.airdef.deploy_tzm": "Развернуть ТЗМ",
"item.airdef.deploy_ew": "Развернуть станцию РЭБ",
"item.airdef.deploy_light": "Развернуть прожектор",
"item.airdef.mover": "Пульт перемещения",
"item.airdef.flare_gun": "Осветительная ракета",
"item.airdef.remover": "Свернуть ПВО",
"item.airdef.deploy_optical": "Развернуть оптический пост",
"item.airdef.cam_shahed": "Шахед-136",
"item.airdef.cam_geran3": "Герань-3",
"item.airdef.cam_lancet": "Ланцет-3",
+19 -8
View File
@@ -34,6 +34,11 @@
"block.airdef.radar_mast": "Радиомачта (секция высоты)",
"block.airdef.radar_trailer": "Прицеп РЛС",
"block.airdef.radar_panel": "РЛС обзора",
"block.airdef.radar_search_array": "Антенна РЛС обзора",
"block.airdef.radar_dish": "Зеркало РЛС сопровождения",
"block.airdef.radar_height_head": "Головка мачтовой РЛС",
"block.airdef.optical_head": "Головка оптического поста",
"block.airdef.optical_post": "Основание оптического поста",
"block.airdef.m57e6": "57Э6",
"block.airdef.m48n6": "48Н6",
"block.airdef.rm48u": "RM48U (игровой профиль)",
@@ -92,19 +97,22 @@
"block.airdef.tor_turret_burnt": "Башня Тора (остов)",
"block.airdef.p1sun_launcher_burnt": "Пусковая P1-SUN (остов)",
"block.airdef.radar_truck_burnt": "Шасси РЛС (остов)",
"block.airdef.radar_trailer_burnt": "Прицеп РЛС (остов)",
"block.airdef.optical_post_burnt": "Основание оптического поста (остов)",
"block.airdef.depot_burnt": "Склад боеприпасов (остов)",
"block.airdef.tzm_truck_burnt": "Транспортно-заряжающая машина (остов)",
"block.airdef.ew_truck_burnt": "Станция РЭБ (остов)",
"block.airdef.searchlight_burnt": "Прожектор (остов)",
"block.airdef.searchlight_head_burnt": "Голова прожектора (остов)",
"item.airdef.designator": "Целеуказатель",
"item.airdef.deploy_radar_search": "Развернуть РЛС обзора",
"item.airdef.deploy_radar_track": "Развернуть РЛС сопровождения",
"item.airdef.deploy_radar_height": "Развернуть мачтовую РЛС",
"item.airdef.mover": "Пульт перемещения",
"item.airdef.flare_gun": "Осветительная ракета",
"item.airdef.remover": "Свернуть ПВО",
"item.airdef.launch_shahed": "Пуск: Шахед-136",
"item.airdef.launch_geran3": "Пуск: Герань-3",
"item.airdef.deploy_patriot": "Развернуть Patriot",
"item.airdef.deploy_gepard": "Развернуть Гепард",
"item.airdef.deploy_pantsir": "Развернуть Панцирь-С1",
"item.airdef.deploy_s400": "Развернуть С-400",
"item.airdef.deploy_s500": "Развернуть С-500",
"item.airdef.launch_lancet": "Пуск: Ланцет-3",
"item.airdef.launch_kh101": "Пуск: Х-101",
"item.airdef.launch_kalibr": "Пуск: Калибр",
@@ -113,6 +121,11 @@
"item.airdef.launch_iskander": "Пуск: Искандер-М",
"item.airdef.launch_kinzhal": "Пуск: Кинжал",
"item.airdef.launch_oreshnik": "Пуск: Орешник",
"item.airdef.deploy_patriot": "Развернуть Patriot",
"item.airdef.deploy_gepard": "Развернуть Гепард",
"item.airdef.deploy_pantsir": "Развернуть Панцирь-С1",
"item.airdef.deploy_s400": "Развернуть С-400 (пусковая)",
"item.airdef.deploy_s500": "Развернуть С-500 (пусковая)",
"item.airdef.deploy_irist": "Развернуть IRIS-T SLM",
"item.airdef.deploy_nasams": "Развернуть NASAMS",
"item.airdef.deploy_buk": "Развернуть Бук-М2",
@@ -123,9 +136,7 @@
"item.airdef.deploy_tzm": "Развернуть ТЗМ",
"item.airdef.deploy_ew": "Развернуть станцию РЭБ",
"item.airdef.deploy_light": "Развернуть прожектор",
"item.airdef.mover": "Пульт перемещения",
"item.airdef.flare_gun": "Осветительная ракета",
"item.airdef.remover": "Свернуть ПВО",
"item.airdef.deploy_optical": "Развернуть оптический пост",
"item.airdef.cam_shahed": "Шахед-136",
"item.airdef.cam_geran3": "Герань-3",
"item.airdef.cam_lancet": "Ланцет-3",
+598 -54
View File
@@ -741,8 +741,8 @@
2.0
],
"to": [
22.0,
7.6,
13.55,
7.5,
11.0
],
"faces": {
@@ -750,8 +750,8 @@
"uv": [
0,
0,
11.5,
0.6999999999999993
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
@@ -759,8 +759,8 @@
"uv": [
0,
0,
11.5,
0.6999999999999993
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
@@ -769,7 +769,7 @@
0,
0,
9.0,
0.6999999999999993
0.5999999999999996
],
"texture": "#kh101"
},
@@ -778,7 +778,7 @@
0,
0,
9.0,
0.6999999999999993
0.5999999999999996
],
"texture": "#kh101"
},
@@ -786,7 +786,7 @@
"uv": [
0,
0,
11.5,
3.0500000000000007,
9.0
],
"texture": "#kh101"
@@ -795,7 +795,7 @@
"uv": [
0,
0,
11.5,
3.0500000000000007,
9.0
],
"texture": "#kh101_belly"
@@ -804,13 +804,13 @@
},
{
"from": [
-6.0,
2.4499999999999993,
6.9,
2.0
],
"to": [
5.5,
7.6,
7.5,
11.0
],
"faces": {
@@ -818,8 +818,8 @@
"uv": [
0,
0,
11.5,
0.6999999999999993
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
@@ -827,8 +827,8 @@
"uv": [
0,
0,
11.5,
0.6999999999999993
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
@@ -837,7 +837,7 @@
0,
0,
9.0,
0.6999999999999993
0.5999999999999996
],
"texture": "#kh101"
},
@@ -846,7 +846,7 @@
0,
0,
9.0,
0.6999999999999993
0.5999999999999996
],
"texture": "#kh101"
},
@@ -854,7 +854,7 @@
"uv": [
0,
0,
11.5,
3.0500000000000007,
9.0
],
"texture": "#kh101"
@@ -863,7 +863,7 @@
"uv": [
0,
0,
11.5,
3.0500000000000007,
9.0
],
"texture": "#kh101_belly"
@@ -872,22 +872,22 @@
},
{
"from": [
22.0,
13.5,
6.9,
5.0
2.65
],
"to": [
28.5,
7.4,
11.0
16.55,
7.5,
10.88
],
"faces": {
"north": {
"uv": [
0,
0,
6.5,
0.5
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
@@ -895,8 +895,8 @@
"uv": [
0,
0,
6.5,
0.5
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
@@ -904,8 +904,8 @@
"uv": [
0,
0,
6.0,
0.5
8.23,
0.5999999999999996
],
"texture": "#kh101"
},
@@ -913,8 +913,8 @@
"uv": [
0,
0,
6.0,
0.5
8.23,
0.5999999999999996
],
"texture": "#kh101"
},
@@ -922,8 +922,8 @@
"uv": [
0,
0,
6.5,
6.0
3.0500000000000007,
8.23
],
"texture": "#kh101"
},
@@ -931,8 +931,552 @@
"uv": [
0,
0,
6.5,
6.0
3.0500000000000007,
8.23
],
"texture": "#kh101_belly"
}
}
},
{
"from": [
-0.5500000000000007,
6.9,
2.65
],
"to": [
2.5,
7.5,
10.88
],
"faces": {
"north": {
"uv": [
0,
0,
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
"south": {
"uv": [
0,
0,
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
"east": {
"uv": [
0,
0,
8.23,
0.5999999999999996
],
"texture": "#kh101"
},
"west": {
"uv": [
0,
0,
8.23,
0.5999999999999996
],
"texture": "#kh101"
},
"up": {
"uv": [
0,
0,
3.0500000000000007,
8.23
],
"texture": "#kh101"
},
"down": {
"uv": [
0,
0,
3.0500000000000007,
8.23
],
"texture": "#kh101_belly"
}
}
},
{
"from": [
16.5,
6.9,
3.3
],
"to": [
19.55,
7.5,
10.76
],
"faces": {
"north": {
"uv": [
0,
0,
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
"south": {
"uv": [
0,
0,
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
"east": {
"uv": [
0,
0,
7.46,
0.5999999999999996
],
"texture": "#kh101"
},
"west": {
"uv": [
0,
0,
7.46,
0.5999999999999996
],
"texture": "#kh101"
},
"up": {
"uv": [
0,
0,
3.0500000000000007,
7.46
],
"texture": "#kh101"
},
"down": {
"uv": [
0,
0,
3.0500000000000007,
7.46
],
"texture": "#kh101_belly"
}
}
},
{
"from": [
-3.5500000000000007,
6.9,
3.3
],
"to": [
-0.5,
7.5,
10.76
],
"faces": {
"north": {
"uv": [
0,
0,
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
"south": {
"uv": [
0,
0,
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
"east": {
"uv": [
0,
0,
7.46,
0.5999999999999996
],
"texture": "#kh101"
},
"west": {
"uv": [
0,
0,
7.46,
0.5999999999999996
],
"texture": "#kh101"
},
"up": {
"uv": [
0,
0,
3.0500000000000007,
7.46
],
"texture": "#kh101"
},
"down": {
"uv": [
0,
0,
3.0500000000000007,
7.46
],
"texture": "#kh101_belly"
}
}
},
{
"from": [
19.5,
6.9,
3.95
],
"to": [
22.55,
7.5,
10.64
],
"faces": {
"north": {
"uv": [
0,
0,
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
"south": {
"uv": [
0,
0,
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
"east": {
"uv": [
0,
0,
6.69,
0.5999999999999996
],
"texture": "#kh101"
},
"west": {
"uv": [
0,
0,
6.69,
0.5999999999999996
],
"texture": "#kh101"
},
"up": {
"uv": [
0,
0,
3.0500000000000007,
6.69
],
"texture": "#kh101"
},
"down": {
"uv": [
0,
0,
3.0500000000000007,
6.69
],
"texture": "#kh101_belly"
}
}
},
{
"from": [
-6.550000000000001,
6.9,
3.95
],
"to": [
-3.5,
7.5,
10.64
],
"faces": {
"north": {
"uv": [
0,
0,
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
"south": {
"uv": [
0,
0,
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
"east": {
"uv": [
0,
0,
6.69,
0.5999999999999996
],
"texture": "#kh101"
},
"west": {
"uv": [
0,
0,
6.69,
0.5999999999999996
],
"texture": "#kh101"
},
"up": {
"uv": [
0,
0,
3.0500000000000007,
6.69
],
"texture": "#kh101"
},
"down": {
"uv": [
0,
0,
3.0500000000000007,
6.69
],
"texture": "#kh101_belly"
}
}
},
{
"from": [
22.5,
6.9,
4.6
],
"to": [
25.55,
7.5,
10.52
],
"faces": {
"north": {
"uv": [
0,
0,
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
"south": {
"uv": [
0,
0,
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
"east": {
"uv": [
0,
0,
5.92,
0.5999999999999996
],
"texture": "#kh101"
},
"west": {
"uv": [
0,
0,
5.92,
0.5999999999999996
],
"texture": "#kh101"
},
"up": {
"uv": [
0,
0,
3.0500000000000007,
5.92
],
"texture": "#kh101"
},
"down": {
"uv": [
0,
0,
3.0500000000000007,
5.92
],
"texture": "#kh101_belly"
}
}
},
{
"from": [
-9.55,
6.9,
4.6
],
"to": [
-6.5,
7.5,
10.52
],
"faces": {
"north": {
"uv": [
0,
0,
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
"south": {
"uv": [
0,
0,
3.0500000000000007,
0.5999999999999996
],
"texture": "#kh101"
},
"east": {
"uv": [
0,
0,
5.92,
0.5999999999999996
],
"texture": "#kh101"
},
"west": {
"uv": [
0,
0,
5.92,
0.5999999999999996
],
"texture": "#kh101"
},
"up": {
"uv": [
0,
0,
3.0500000000000007,
5.92
],
"texture": "#kh101"
},
"down": {
"uv": [
0,
0,
3.0500000000000007,
5.92
],
"texture": "#kh101_belly"
}
}
},
{
"from": [
25.5,
6.9,
5.25
],
"to": [
28.5,
7.5,
10.4
],
"faces": {
"north": {
"uv": [
0,
0,
3.0,
0.5999999999999996
],
"texture": "#kh101"
},
"south": {
"uv": [
0,
0,
3.0,
0.5999999999999996
],
"texture": "#kh101"
},
"east": {
"uv": [
0,
0,
5.15,
0.5999999999999996
],
"texture": "#kh101"
},
"west": {
"uv": [
0,
0,
5.15,
0.5999999999999996
],
"texture": "#kh101"
},
"up": {
"uv": [
0,
0,
3.0,
5.15
],
"texture": "#kh101"
},
"down": {
"uv": [
0,
0,
3.0,
5.15
],
"texture": "#kh101_belly"
}
@@ -942,20 +1486,20 @@
"from": [
-12.5,
6.9,
5.0
5.25
],
"to": [
-6.0,
7.4,
11.0
-9.5,
7.5,
10.4
],
"faces": {
"north": {
"uv": [
0,
0,
6.5,
0.5
3.0,
0.5999999999999996
],
"texture": "#kh101"
},
@@ -963,8 +1507,8 @@
"uv": [
0,
0,
6.5,
0.5
3.0,
0.5999999999999996
],
"texture": "#kh101"
},
@@ -972,8 +1516,8 @@
"uv": [
0,
0,
6.0,
0.5
5.15,
0.5999999999999996
],
"texture": "#kh101"
},
@@ -981,8 +1525,8 @@
"uv": [
0,
0,
6.0,
0.5
5.15,
0.5999999999999996
],
"texture": "#kh101"
},
@@ -990,8 +1534,8 @@
"uv": [
0,
0,
6.5,
6.0
3.0,
5.15
],
"texture": "#kh101"
},
@@ -999,8 +1543,8 @@
"uv": [
0,
0,
6.5,
6.0
3.0,
5.15
],
"texture": "#kh101_belly"
}
@@ -1551,4 +2095,4 @@
}
}
]
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,487 @@
{
"ambientocclusion": false,
"textures": {
"dark_metal": "airdef:block/dark_metal",
"ru_khaki": "airdef:block/ru_khaki",
"glass_cab": "airdef:block/glass_cab",
"particle": "airdef:block/dark_metal"
},
"elements": [
{
"from": [
4.0,
-6.0,
4.0
],
"to": [
12.0,
-1.0,
12.0
],
"faces": {
"north": {
"uv": [
0,
0,
8.0,
5.0
],
"texture": "#dark_metal"
},
"south": {
"uv": [
0,
0,
8.0,
5.0
],
"texture": "#dark_metal"
},
"east": {
"uv": [
0,
0,
8.0,
5.0
],
"texture": "#dark_metal"
},
"west": {
"uv": [
0,
0,
8.0,
5.0
],
"texture": "#dark_metal"
},
"up": {
"uv": [
0,
0,
8.0,
8.0
],
"texture": "#dark_metal"
},
"down": {
"uv": [
0,
0,
8.0,
8.0
],
"texture": "#dark_metal"
}
}
},
{
"from": [
2.5,
-1.0,
6.5
],
"to": [
5.5,
6.0,
9.5
],
"faces": {
"north": {
"uv": [
0,
0,
3.0,
7.0
],
"texture": "#ru_khaki"
},
"south": {
"uv": [
0,
0,
3.0,
7.0
],
"texture": "#ru_khaki"
},
"east": {
"uv": [
0,
0,
3.0,
7.0
],
"texture": "#ru_khaki"
},
"west": {
"uv": [
0,
0,
3.0,
7.0
],
"texture": "#ru_khaki"
},
"up": {
"uv": [
0,
0,
3.0,
3.0
],
"texture": "#ru_khaki"
},
"down": {
"uv": [
0,
0,
3.0,
3.0
],
"texture": "#ru_khaki"
}
}
},
{
"from": [
10.5,
-1.0,
6.5
],
"to": [
13.5,
6.0,
9.5
],
"faces": {
"north": {
"uv": [
0,
0,
3.0,
7.0
],
"texture": "#ru_khaki"
},
"south": {
"uv": [
0,
0,
3.0,
7.0
],
"texture": "#ru_khaki"
},
"east": {
"uv": [
0,
0,
3.0,
7.0
],
"texture": "#ru_khaki"
},
"west": {
"uv": [
0,
0,
3.0,
7.0
],
"texture": "#ru_khaki"
},
"up": {
"uv": [
0,
0,
3.0,
3.0
],
"texture": "#ru_khaki"
},
"down": {
"uv": [
0,
0,
3.0,
3.0
],
"texture": "#ru_khaki"
}
}
},
{
"from": [
3.0,
-1.0,
-6.0
],
"to": [
13.0,
7.0,
7.0
],
"faces": {
"north": {
"uv": [
0,
0,
10.0,
8.0
],
"texture": "#ru_khaki"
},
"south": {
"uv": [
0,
0,
10.0,
8.0
],
"texture": "#ru_khaki"
},
"east": {
"uv": [
0,
0,
13.0,
8.0
],
"texture": "#ru_khaki"
},
"west": {
"uv": [
0,
0,
13.0,
8.0
],
"texture": "#ru_khaki"
},
"up": {
"uv": [
0,
0,
10.0,
13.0
],
"texture": "#ru_khaki"
},
"down": {
"uv": [
0,
0,
10.0,
13.0
],
"texture": "#ru_khaki"
}
}
},
{
"from": [
5.0,
1.0,
-7.5
],
"to": [
11.0,
5.0,
-6.0
],
"faces": {
"north": {
"uv": [
0,
0,
6.0,
4.0
],
"texture": "#glass_cab"
},
"south": {
"uv": [
0,
0,
6.0,
4.0
],
"texture": "#glass_cab"
},
"east": {
"uv": [
0,
0,
1.5,
4.0
],
"texture": "#glass_cab"
},
"west": {
"uv": [
0,
0,
1.5,
4.0
],
"texture": "#glass_cab"
},
"up": {
"uv": [
0,
0,
6.0,
1.5
],
"texture": "#glass_cab"
},
"down": {
"uv": [
0,
0,
6.0,
1.5
],
"texture": "#glass_cab"
}
}
},
{
"from": [
9.0,
7.0,
-4.0
],
"to": [
12.0,
10.0,
3.0
],
"faces": {
"north": {
"uv": [
0,
0,
3.0,
3.0
],
"texture": "#dark_metal"
},
"south": {
"uv": [
0,
0,
3.0,
3.0
],
"texture": "#dark_metal"
},
"east": {
"uv": [
0,
0,
7.0,
3.0
],
"texture": "#dark_metal"
},
"west": {
"uv": [
0,
0,
7.0,
3.0
],
"texture": "#dark_metal"
},
"up": {
"uv": [
0,
0,
3.0,
7.0
],
"texture": "#dark_metal"
},
"down": {
"uv": [
0,
0,
3.0,
7.0
],
"texture": "#dark_metal"
}
}
},
{
"from": [
10.0,
7.5,
-5.0
],
"to": [
11.0,
9.5,
-4.0
],
"faces": {
"north": {
"uv": [
0,
0,
1.0,
2.0
],
"texture": "#glass_cab"
},
"south": {
"uv": [
0,
0,
1.0,
2.0
],
"texture": "#glass_cab"
},
"east": {
"uv": [
0,
0,
1.0,
2.0
],
"texture": "#glass_cab"
},
"west": {
"uv": [
0,
0,
1.0,
2.0
],
"texture": "#glass_cab"
},
"up": {
"uv": [
0,
0,
1.0,
1.0
],
"texture": "#glass_cab"
},
"down": {
"uv": [
0,
0,
1.0,
1.0
],
"texture": "#glass_cab"
}
}
}
]
}
@@ -0,0 +1,216 @@
{
"ambientocclusion": false,
"textures": {
"concrete": "airdef:block/concrete",
"ru_khaki": "airdef:block/ru_khaki",
"metal": "airdef:block/metal",
"crate": "airdef:block/crate",
"particle": "airdef:block/concrete"
},
"elements": [
{
"from": [
-6.0,
0.0,
-6.0
],
"to": [
22.0,
2.0,
22.0
],
"faces": {
"north": {
"uv": [
0,
0,
16,
2.0
],
"texture": "#concrete"
},
"south": {
"uv": [
0,
0,
16,
2.0
],
"texture": "#concrete"
},
"east": {
"uv": [
0,
0,
16,
2.0
],
"texture": "#concrete"
},
"west": {
"uv": [
0,
0,
16,
2.0
],
"texture": "#concrete"
},
"up": {
"uv": [
0,
0,
16,
16
],
"texture": "#concrete"
},
"down": {
"uv": [
0,
0,
16,
16
],
"texture": "#concrete"
}
}
},
{
"from": [
1.0,
2.0,
1.0
],
"to": [
15.0,
9.0,
15.0
],
"faces": {
"north": {
"uv": [
0,
0,
14.0,
7.0
],
"texture": "#ru_khaki"
},
"south": {
"uv": [
0,
0,
14.0,
7.0
],
"texture": "#ru_khaki"
},
"east": {
"uv": [
0,
0,
14.0,
7.0
],
"texture": "#metal"
},
"west": {
"uv": [
0,
0,
14.0,
7.0
],
"texture": "#ru_khaki"
},
"up": {
"uv": [
0,
0,
14.0,
14.0
],
"texture": "#ru_khaki"
},
"down": {
"uv": [
0,
0,
14.0,
14.0
],
"texture": "#ru_khaki"
}
}
},
{
"from": [
-4.0,
2.0,
-2.0
],
"to": [
1.0,
7.0,
4.0
],
"faces": {
"north": {
"uv": [
0,
0,
5.0,
5.0
],
"texture": "#crate"
},
"south": {
"uv": [
0,
0,
5.0,
5.0
],
"texture": "#crate"
},
"east": {
"uv": [
0,
0,
6.0,
5.0
],
"texture": "#crate"
},
"west": {
"uv": [
0,
0,
6.0,
5.0
],
"texture": "#crate"
},
"up": {
"uv": [
0,
0,
5.0,
6.0
],
"texture": "#crate"
},
"down": {
"uv": [
0,
0,
5.0,
6.0
],
"texture": "#crate"
}
}
}
]
}
@@ -0,0 +1,216 @@
{
"ambientocclusion": false,
"textures": {
"concrete_b": "airdef:block/concrete_b",
"ru_khaki_b": "airdef:block/ru_khaki_b",
"metal_b": "airdef:block/metal_b",
"crate_b": "airdef:block/crate_b",
"particle": "airdef:block/concrete_b"
},
"elements": [
{
"from": [
-6.0,
0.0,
-6.0
],
"to": [
22.0,
2.0,
22.0
],
"faces": {
"north": {
"uv": [
0,
0,
16,
2.0
],
"texture": "#concrete_b"
},
"south": {
"uv": [
0,
0,
16,
2.0
],
"texture": "#concrete_b"
},
"east": {
"uv": [
0,
0,
16,
2.0
],
"texture": "#concrete_b"
},
"west": {
"uv": [
0,
0,
16,
2.0
],
"texture": "#concrete_b"
},
"up": {
"uv": [
0,
0,
16,
16
],
"texture": "#concrete_b"
},
"down": {
"uv": [
0,
0,
16,
16
],
"texture": "#concrete_b"
}
}
},
{
"from": [
1.0,
2.0,
1.0
],
"to": [
15.0,
9.0,
15.0
],
"faces": {
"north": {
"uv": [
0,
0,
14.0,
7.0
],
"texture": "#ru_khaki_b"
},
"south": {
"uv": [
0,
0,
14.0,
7.0
],
"texture": "#ru_khaki_b"
},
"east": {
"uv": [
0,
0,
14.0,
7.0
],
"texture": "#metal_b"
},
"west": {
"uv": [
0,
0,
14.0,
7.0
],
"texture": "#ru_khaki_b"
},
"up": {
"uv": [
0,
0,
14.0,
14.0
],
"texture": "#ru_khaki_b"
},
"down": {
"uv": [
0,
0,
14.0,
14.0
],
"texture": "#ru_khaki_b"
}
}
},
{
"from": [
-4.0,
2.0,
-2.0
],
"to": [
1.0,
7.0,
4.0
],
"faces": {
"north": {
"uv": [
0,
0,
5.0,
5.0
],
"texture": "#crate_b"
},
"south": {
"uv": [
0,
0,
5.0,
5.0
],
"texture": "#crate_b"
},
"east": {
"uv": [
0,
0,
6.0,
5.0
],
"texture": "#crate_b"
},
"west": {
"uv": [
0,
0,
6.0,
5.0
],
"texture": "#crate_b"
},
"up": {
"uv": [
0,
0,
5.0,
6.0
],
"texture": "#crate_b"
},
"down": {
"uv": [
0,
0,
5.0,
6.0
],
"texture": "#crate_b"
}
}
}
]
}
@@ -0,0 +1,555 @@
{
"ambientocclusion": false,
"textures": {
"bare_dish": "airdef:block/bare_dish",
"dark_metal": "airdef:block/dark_metal",
"metal": "airdef:block/metal",
"particle": "airdef:block/bare_dish"
},
"elements": [
{
"from": [
-8.0,
-6.0,
8.0
],
"to": [
24.0,
20.0,
10.0
],
"faces": {
"north": {
"uv": [
0,
0,
16,
16
],
"texture": "#bare_dish"
},
"south": {
"uv": [
0,
0,
16,
16
],
"texture": "#bare_dish"
},
"east": {
"uv": [
0,
0,
2.0,
16
],
"texture": "#bare_dish"
},
"west": {
"uv": [
0,
0,
2.0,
16
],
"texture": "#bare_dish"
},
"up": {
"uv": [
0,
0,
16,
2.0
],
"texture": "#bare_dish"
},
"down": {
"uv": [
0,
0,
16,
2.0
],
"texture": "#bare_dish"
}
}
},
{
"from": [
-4.0,
-2.0,
10.0
],
"to": [
16.0,
16.0,
12.0
],
"faces": {
"north": {
"uv": [
0,
0,
16,
16
],
"texture": "#bare_dish"
},
"south": {
"uv": [
0,
0,
16,
16
],
"texture": "#bare_dish"
},
"east": {
"uv": [
0,
0,
2.0,
16
],
"texture": "#bare_dish"
},
"west": {
"uv": [
0,
0,
2.0,
16
],
"texture": "#bare_dish"
},
"up": {
"uv": [
0,
0,
16,
2.0
],
"texture": "#bare_dish"
},
"down": {
"uv": [
0,
0,
16,
2.0
],
"texture": "#bare_dish"
}
}
},
{
"from": [
0.0,
2.0,
12.0
],
"to": [
12.0,
12.0,
14.0
],
"faces": {
"north": {
"uv": [
0,
0,
12.0,
10.0
],
"texture": "#bare_dish"
},
"south": {
"uv": [
0,
0,
12.0,
10.0
],
"texture": "#bare_dish"
},
"east": {
"uv": [
0,
0,
2.0,
10.0
],
"texture": "#bare_dish"
},
"west": {
"uv": [
0,
0,
2.0,
10.0
],
"texture": "#bare_dish"
},
"up": {
"uv": [
0,
0,
12.0,
2.0
],
"texture": "#bare_dish"
},
"down": {
"uv": [
0,
0,
12.0,
2.0
],
"texture": "#bare_dish"
}
}
},
{
"from": [
-8.5,
-6.5,
10.0
],
"to": [
24.5,
20.5,
11.0
],
"faces": {
"north": {
"uv": [
0,
0,
16,
16
],
"texture": "#dark_metal"
},
"south": {
"uv": [
0,
0,
16,
16
],
"texture": "#dark_metal"
},
"east": {
"uv": [
0,
0,
1.0,
16
],
"texture": "#dark_metal"
},
"west": {
"uv": [
0,
0,
1.0,
16
],
"texture": "#dark_metal"
},
"up": {
"uv": [
0,
0,
16,
1.0
],
"texture": "#dark_metal"
},
"down": {
"uv": [
0,
0,
16,
1.0
],
"texture": "#dark_metal"
}
}
},
{
"from": [
3.0,
-3.0,
14.0
],
"to": [
13.0,
3.0,
17.0
],
"faces": {
"north": {
"uv": [
0,
0,
10.0,
6.0
],
"texture": "#dark_metal"
},
"south": {
"uv": [
0,
0,
10.0,
6.0
],
"texture": "#dark_metal"
},
"east": {
"uv": [
0,
0,
3.0,
6.0
],
"texture": "#dark_metal"
},
"west": {
"uv": [
0,
0,
3.0,
6.0
],
"texture": "#dark_metal"
},
"up": {
"uv": [
0,
0,
10.0,
3.0
],
"texture": "#dark_metal"
},
"down": {
"uv": [
0,
0,
10.0,
3.0
],
"texture": "#dark_metal"
}
}
},
{
"from": [
7.0,
6.0,
2.0
],
"to": [
9.0,
8.0,
9.0
],
"faces": {
"north": {
"uv": [
0,
0,
2.0,
2.0
],
"texture": "#metal"
},
"south": {
"uv": [
0,
0,
2.0,
2.0
],
"texture": "#metal"
},
"east": {
"uv": [
0,
0,
7.0,
2.0
],
"texture": "#metal"
},
"west": {
"uv": [
0,
0,
7.0,
2.0
],
"texture": "#metal"
},
"up": {
"uv": [
0,
0,
2.0,
7.0
],
"texture": "#metal"
},
"down": {
"uv": [
0,
0,
2.0,
7.0
],
"texture": "#metal"
}
}
},
{
"from": [
5.5,
4.5,
-2.0
],
"to": [
10.5,
9.5,
2.0
],
"faces": {
"north": {
"uv": [
0,
0,
5.0,
5.0
],
"texture": "#dark_metal"
},
"south": {
"uv": [
0,
0,
5.0,
5.0
],
"texture": "#dark_metal"
},
"east": {
"uv": [
0,
0,
4.0,
5.0
],
"texture": "#dark_metal"
},
"west": {
"uv": [
0,
0,
4.0,
5.0
],
"texture": "#dark_metal"
},
"up": {
"uv": [
0,
0,
5.0,
4.0
],
"texture": "#dark_metal"
},
"down": {
"uv": [
0,
0,
5.0,
4.0
],
"texture": "#dark_metal"
}
}
},
{
"from": [
6.5,
-10.0,
6.5
],
"to": [
9.5,
-3.0,
9.5
],
"faces": {
"north": {
"uv": [
0,
0,
3.0,
7.0
],
"texture": "#metal"
},
"south": {
"uv": [
0,
0,
3.0,
7.0
],
"texture": "#metal"
},
"east": {
"uv": [
0,
0,
3.0,
7.0
],
"texture": "#metal"
},
"west": {
"uv": [
0,
0,
3.0,
7.0
],
"texture": "#metal"
},
"up": {
"uv": [
0,
0,
3.0,
3.0
],
"texture": "#metal"
},
"down": {
"uv": [
0,
0,
3.0,
3.0
],
"texture": "#metal"
}
}
}
]
}
@@ -0,0 +1,351 @@
{
"ambientocclusion": false,
"textures": {
"radar_face": "airdef:block/radar_face",
"dark_metal": "airdef:block/dark_metal",
"metal": "airdef:block/metal",
"particle": "airdef:block/radar_face"
},
"elements": [
{
"from": [
1.0,
-2.0,
5.0
],
"to": [
15.0,
14.0,
7.0
],
"faces": {
"north": {
"uv": [
0,
0,
14.0,
16
],
"texture": "#radar_face"
},
"south": {
"uv": [
0,
0,
14.0,
16
],
"texture": "#radar_face"
},
"east": {
"uv": [
0,
0,
2.0,
16
],
"texture": "#radar_face"
},
"west": {
"uv": [
0,
0,
2.0,
16
],
"texture": "#radar_face"
},
"up": {
"uv": [
0,
0,
14.0,
2.0
],
"texture": "#radar_face"
},
"down": {
"uv": [
0,
0,
14.0,
2.0
],
"texture": "#radar_face"
}
}
},
{
"from": [
1.0,
-2.0,
9.0
],
"to": [
15.0,
14.0,
11.0
],
"faces": {
"north": {
"uv": [
0,
0,
14.0,
16
],
"texture": "#radar_face"
},
"south": {
"uv": [
0,
0,
14.0,
16
],
"texture": "#radar_face"
},
"east": {
"uv": [
0,
0,
2.0,
16
],
"texture": "#radar_face"
},
"west": {
"uv": [
0,
0,
2.0,
16
],
"texture": "#radar_face"
},
"up": {
"uv": [
0,
0,
14.0,
2.0
],
"texture": "#radar_face"
},
"down": {
"uv": [
0,
0,
14.0,
2.0
],
"texture": "#radar_face"
}
}
},
{
"from": [
0.5,
-2.5,
7.0
],
"to": [
15.5,
14.5,
9.0
],
"faces": {
"north": {
"uv": [
0,
0,
15.0,
16
],
"texture": "#dark_metal"
},
"south": {
"uv": [
0,
0,
15.0,
16
],
"texture": "#dark_metal"
},
"east": {
"uv": [
0,
0,
2.0,
16
],
"texture": "#dark_metal"
},
"west": {
"uv": [
0,
0,
2.0,
16
],
"texture": "#dark_metal"
},
"up": {
"uv": [
0,
0,
15.0,
2.0
],
"texture": "#dark_metal"
},
"down": {
"uv": [
0,
0,
15.0,
2.0
],
"texture": "#dark_metal"
}
}
},
{
"from": [
6.0,
-8.0,
6.0
],
"to": [
10.0,
-2.0,
10.0
],
"faces": {
"north": {
"uv": [
0,
0,
4.0,
6.0
],
"texture": "#metal"
},
"south": {
"uv": [
0,
0,
4.0,
6.0
],
"texture": "#metal"
},
"east": {
"uv": [
0,
0,
4.0,
6.0
],
"texture": "#metal"
},
"west": {
"uv": [
0,
0,
4.0,
6.0
],
"texture": "#metal"
},
"up": {
"uv": [
0,
0,
4.0,
4.0
],
"texture": "#metal"
},
"down": {
"uv": [
0,
0,
4.0,
4.0
],
"texture": "#metal"
}
}
},
{
"from": [
2.0,
14.0,
7.0
],
"to": [
14.0,
16.0,
9.0
],
"faces": {
"north": {
"uv": [
0,
0,
12.0,
2.0
],
"texture": "#dark_metal"
},
"south": {
"uv": [
0,
0,
12.0,
2.0
],
"texture": "#dark_metal"
},
"east": {
"uv": [
0,
0,
2.0,
2.0
],
"texture": "#dark_metal"
},
"west": {
"uv": [
0,
0,
2.0,
2.0
],
"texture": "#dark_metal"
},
"up": {
"uv": [
0,
0,
12.0,
2.0
],
"texture": "#dark_metal"
},
"down": {
"uv": [
0,
0,
12.0,
2.0
],
"texture": "#dark_metal"
}
}
}
]
}
@@ -0,0 +1,641 @@
{
"ambientocclusion": false,
"textures": {
"radar_face": "airdef:block/radar_face",
"dark_metal": "airdef:block/dark_metal",
"metal": "airdef:block/metal",
"particle": "airdef:block/radar_face"
},
"elements": [
{
"from": [
-6.0,
0.0,
7.0
],
"to": [
22.0,
30.0,
9.0
],
"faces": {
"north": {
"uv": [
0,
0,
16,
16
],
"texture": "#radar_face"
},
"south": {
"uv": [
0,
0,
16,
16
],
"texture": "#radar_face"
},
"east": {
"uv": [
0,
0,
2.0,
16
],
"texture": "#radar_face"
},
"west": {
"uv": [
0,
0,
2.0,
16
],
"texture": "#radar_face"
},
"up": {
"uv": [
0,
0,
16,
2.0
],
"texture": "#radar_face"
},
"down": {
"uv": [
0,
0,
16,
2.0
],
"texture": "#radar_face"
}
}
},
{
"from": [
-16.0,
0.0,
7.0
],
"to": [
-6.0,
30.0,
9.0
],
"faces": {
"north": {
"uv": [
0,
0,
10.0,
16
],
"texture": "#radar_face"
},
"south": {
"uv": [
0,
0,
10.0,
16
],
"texture": "#radar_face"
},
"east": {
"uv": [
0,
0,
2.0,
16
],
"texture": "#radar_face"
},
"west": {
"uv": [
0,
0,
2.0,
16
],
"texture": "#radar_face"
},
"up": {
"uv": [
0,
0,
10.0,
2.0
],
"texture": "#radar_face"
},
"down": {
"uv": [
0,
0,
10.0,
2.0
],
"texture": "#radar_face"
}
},
"rotation": {
"angle": -22.5,
"axis": "y",
"origin": [
-11.0,
15.0,
8.0
]
}
},
{
"from": [
22.0,
0.0,
7.0
],
"to": [
32.0,
30.0,
9.0
],
"faces": {
"north": {
"uv": [
0,
0,
10.0,
16
],
"texture": "#radar_face"
},
"south": {
"uv": [
0,
0,
10.0,
16
],
"texture": "#radar_face"
},
"east": {
"uv": [
0,
0,
2.0,
16
],
"texture": "#radar_face"
},
"west": {
"uv": [
0,
0,
2.0,
16
],
"texture": "#radar_face"
},
"up": {
"uv": [
0,
0,
10.0,
2.0
],
"texture": "#radar_face"
},
"down": {
"uv": [
0,
0,
10.0,
2.0
],
"texture": "#radar_face"
}
},
"rotation": {
"angle": 22.5,
"axis": "y",
"origin": [
27.0,
15.0,
8.0
]
}
},
{
"from": [
-6.5,
-0.5,
9.0
],
"to": [
22.5,
30.5,
10.0
],
"faces": {
"north": {
"uv": [
0,
0,
16,
16
],
"texture": "#dark_metal"
},
"south": {
"uv": [
0,
0,
16,
16
],
"texture": "#dark_metal"
},
"east": {
"uv": [
0,
0,
1.0,
16
],
"texture": "#dark_metal"
},
"west": {
"uv": [
0,
0,
1.0,
16
],
"texture": "#dark_metal"
},
"up": {
"uv": [
0,
0,
16,
1.0
],
"texture": "#dark_metal"
},
"down": {
"uv": [
0,
0,
16,
1.0
],
"texture": "#dark_metal"
}
}
},
{
"from": [
-6.0,
30.0,
6.0
],
"to": [
22.0,
32.0,
10.0
],
"faces": {
"north": {
"uv": [
0,
0,
16,
2.0
],
"texture": "#dark_metal"
},
"south": {
"uv": [
0,
0,
16,
2.0
],
"texture": "#dark_metal"
},
"east": {
"uv": [
0,
0,
4.0,
2.0
],
"texture": "#dark_metal"
},
"west": {
"uv": [
0,
0,
4.0,
2.0
],
"texture": "#dark_metal"
},
"up": {
"uv": [
0,
0,
16,
4.0
],
"texture": "#dark_metal"
},
"down": {
"uv": [
0,
0,
16,
4.0
],
"texture": "#dark_metal"
}
}
},
{
"from": [
-10.0,
13.0,
9.0
],
"to": [
-6.0,
17.0,
13.0
],
"faces": {
"north": {
"uv": [
0,
0,
4.0,
4.0
],
"texture": "#dark_metal"
},
"south": {
"uv": [
0,
0,
4.0,
4.0
],
"texture": "#dark_metal"
},
"east": {
"uv": [
0,
0,
4.0,
4.0
],
"texture": "#dark_metal"
},
"west": {
"uv": [
0,
0,
4.0,
4.0
],
"texture": "#dark_metal"
},
"up": {
"uv": [
0,
0,
4.0,
4.0
],
"texture": "#dark_metal"
},
"down": {
"uv": [
0,
0,
4.0,
4.0
],
"texture": "#dark_metal"
}
}
},
{
"from": [
22.0,
13.0,
9.0
],
"to": [
26.0,
17.0,
13.0
],
"faces": {
"north": {
"uv": [
0,
0,
4.0,
4.0
],
"texture": "#dark_metal"
},
"south": {
"uv": [
0,
0,
4.0,
4.0
],
"texture": "#dark_metal"
},
"east": {
"uv": [
0,
0,
4.0,
4.0
],
"texture": "#dark_metal"
},
"west": {
"uv": [
0,
0,
4.0,
4.0
],
"texture": "#dark_metal"
},
"up": {
"uv": [
0,
0,
4.0,
4.0
],
"texture": "#dark_metal"
},
"down": {
"uv": [
0,
0,
4.0,
4.0
],
"texture": "#dark_metal"
}
}
},
{
"from": [
4.0,
-4.0,
4.0
],
"to": [
12.0,
2.0,
12.0
],
"faces": {
"north": {
"uv": [
0,
0,
8.0,
6.0
],
"texture": "#dark_metal"
},
"south": {
"uv": [
0,
0,
8.0,
6.0
],
"texture": "#dark_metal"
},
"east": {
"uv": [
0,
0,
8.0,
6.0
],
"texture": "#dark_metal"
},
"west": {
"uv": [
0,
0,
8.0,
6.0
],
"texture": "#dark_metal"
},
"up": {
"uv": [
0,
0,
8.0,
8.0
],
"texture": "#dark_metal"
},
"down": {
"uv": [
0,
0,
8.0,
8.0
],
"texture": "#dark_metal"
}
}
},
{
"from": [
6.5,
-10.0,
6.5
],
"to": [
9.5,
-4.0,
9.5
],
"faces": {
"north": {
"uv": [
0,
0,
3.0,
6.0
],
"texture": "#metal"
},
"south": {
"uv": [
0,
0,
3.0,
6.0
],
"texture": "#metal"
},
"east": {
"uv": [
0,
0,
3.0,
6.0
],
"texture": "#metal"
},
"west": {
"uv": [
0,
0,
3.0,
6.0
],
"texture": "#metal"
},
"up": {
"uv": [
0,
0,
3.0,
3.0
],
"texture": "#metal"
},
"down": {
"uv": [
0,
0,
3.0,
3.0
],
"texture": "#metal"
}
}
}
]
}
@@ -0,0 +1,798 @@
{
"ambientocclusion": false,
"textures": {
"ru_khaki_s21_b": "airdef:block/ru_khaki_s21_b",
"ru_khaki_s22_b": "airdef:block/ru_khaki_s22_b",
"dark_metal_b": "airdef:block/dark_metal_b",
"ru_khaki_b": "airdef:block/ru_khaki_b",
"tire_b": "airdef:block/tire_b",
"hub_b": "airdef:block/hub_b",
"particle": "airdef:block/ru_khaki_s21_b"
},
"elements": [
{
"from": [
-6.0,
5.0,
-12.0
],
"to": [
22.0,
10.0,
26.0
],
"faces": {
"north": {
"uv": [
0,
0,
16,
5.0
],
"texture": "#ru_khaki_s21_b"
},
"south": {
"uv": [
0,
0,
16,
5.0
],
"texture": "#ru_khaki_s21_b"
},
"east": {
"uv": [
0,
0,
16,
5.0
],
"texture": "#ru_khaki_s21_b"
},
"west": {
"uv": [
0,
0,
16,
5.0
],
"texture": "#ru_khaki_s21_b"
},
"up": {
"uv": [
0,
0,
16,
16
],
"texture": "#ru_khaki_s22_b"
},
"down": {
"uv": [
0,
0,
16,
16
],
"texture": "#ru_khaki_s22_b"
}
}
},
{
"from": [
2.0,
10.0,
2.0
],
"to": [
14.0,
16.0,
14.0
],
"faces": {
"north": {
"uv": [
0,
0,
12.0,
6.0
],
"texture": "#dark_metal_b"
},
"south": {
"uv": [
0,
0,
12.0,
6.0
],
"texture": "#dark_metal_b"
},
"east": {
"uv": [
0,
0,
12.0,
6.0
],
"texture": "#dark_metal_b"
},
"west": {
"uv": [
0,
0,
12.0,
6.0
],
"texture": "#dark_metal_b"
},
"up": {
"uv": [
0,
0,
12.0,
12.0
],
"texture": "#dark_metal_b"
},
"down": {
"uv": [
0,
0,
12.0,
12.0
],
"texture": "#dark_metal_b"
}
}
},
{
"from": [
-5.0,
10.0,
16.0
],
"to": [
21.0,
18.0,
26.0
],
"faces": {
"north": {
"uv": [
0,
0,
16,
8.0
],
"texture": "#ru_khaki_s21_b"
},
"south": {
"uv": [
0,
0,
16,
8.0
],
"texture": "#ru_khaki_s21_b"
},
"east": {
"uv": [
0,
0,
10.0,
8.0
],
"texture": "#ru_khaki_b"
},
"west": {
"uv": [
0,
0,
10.0,
8.0
],
"texture": "#ru_khaki_b"
},
"up": {
"uv": [
0,
0,
16,
10.0
],
"texture": "#ru_khaki_s21_b"
},
"down": {
"uv": [
0,
0,
16,
10.0
],
"texture": "#ru_khaki_s21_b"
}
}
},
{
"from": [
-9.0,
0.3424499999999995,
-9.65755
],
"to": [
-5.5,
8.65755,
-1.3424499999999995
],
"faces": {
"north": {
"uv": [
0,
0,
3.5,
8.315100000000001
],
"texture": "#tire_b"
},
"south": {
"uv": [
0,
0,
3.5,
8.315100000000001
],
"texture": "#tire_b"
},
"east": {
"uv": [
0,
0,
8.315100000000001,
8.315100000000001
],
"texture": "#hub_b"
},
"west": {
"uv": [
0,
0,
8.315100000000001,
8.315100000000001
],
"texture": "#hub_b"
},
"up": {
"uv": [
0,
0,
3.5,
8.315100000000001
],
"texture": "#tire_b"
},
"down": {
"uv": [
0,
0,
3.5,
8.315100000000001
],
"texture": "#tire_b"
}
}
},
{
"from": [
21.5,
0.3424499999999995,
-9.65755
],
"to": [
25.0,
8.65755,
-1.3424499999999995
],
"faces": {
"north": {
"uv": [
0,
0,
3.5,
8.315100000000001
],
"texture": "#tire_b"
},
"south": {
"uv": [
0,
0,
3.5,
8.315100000000001
],
"texture": "#tire_b"
},
"east": {
"uv": [
0,
0,
8.315100000000001,
8.315100000000001
],
"texture": "#hub_b"
},
"west": {
"uv": [
0,
0,
8.315100000000001,
8.315100000000001
],
"texture": "#hub_b"
},
"up": {
"uv": [
0,
0,
3.5,
8.315100000000001
],
"texture": "#tire_b"
},
"down": {
"uv": [
0,
0,
3.5,
8.315100000000001
],
"texture": "#tire_b"
}
}
},
{
"from": [
-8.97,
0.3424499999999995,
-9.65755
],
"to": [
-5.53,
8.65755,
-1.3424499999999995
],
"faces": {
"north": {
"uv": [
0,
0,
3.4400000000000004,
8.315100000000001
],
"texture": "#tire_b"
},
"south": {
"uv": [
0,
0,
3.4400000000000004,
8.315100000000001
],
"texture": "#tire_b"
},
"east": {
"uv": [
0,
0,
8.315100000000001,
8.315100000000001
],
"texture": "#hub_b"
},
"west": {
"uv": [
0,
0,
8.315100000000001,
8.315100000000001
],
"texture": "#hub_b"
},
"up": {
"uv": [
0,
0,
3.4400000000000004,
8.315100000000001
],
"texture": "#tire_b"
},
"down": {
"uv": [
0,
0,
3.4400000000000004,
8.315100000000001
],
"texture": "#tire_b"
}
},
"rotation": {
"angle": 45,
"axis": "x",
"origin": [
-7.25,
4.5,
-5.5
]
}
},
{
"from": [
21.53,
0.3424499999999995,
-9.65755
],
"to": [
24.97,
8.65755,
-1.3424499999999995
],
"faces": {
"north": {
"uv": [
0,
0,
3.4399999999999977,
8.315100000000001
],
"texture": "#tire_b"
},
"south": {
"uv": [
0,
0,
3.4399999999999977,
8.315100000000001
],
"texture": "#tire_b"
},
"east": {
"uv": [
0,
0,
8.315100000000001,
8.315100000000001
],
"texture": "#hub_b"
},
"west": {
"uv": [
0,
0,
8.315100000000001,
8.315100000000001
],
"texture": "#hub_b"
},
"up": {
"uv": [
0,
0,
3.4399999999999977,
8.315100000000001
],
"texture": "#tire_b"
},
"down": {
"uv": [
0,
0,
3.4399999999999977,
8.315100000000001
],
"texture": "#tire_b"
}
},
"rotation": {
"angle": 45,
"axis": "x",
"origin": [
23.25,
4.5,
-5.5
]
}
},
{
"from": [
-9.0,
0.3424499999999995,
16.34245
],
"to": [
-5.5,
8.65755,
24.65755
],
"faces": {
"north": {
"uv": [
0,
0,
3.5,
8.315100000000001
],
"texture": "#tire_b"
},
"south": {
"uv": [
0,
0,
3.5,
8.315100000000001
],
"texture": "#tire_b"
},
"east": {
"uv": [
0,
0,
8.315100000000001,
8.315100000000001
],
"texture": "#hub_b"
},
"west": {
"uv": [
0,
0,
8.315100000000001,
8.315100000000001
],
"texture": "#hub_b"
},
"up": {
"uv": [
0,
0,
3.5,
8.315100000000001
],
"texture": "#tire_b"
},
"down": {
"uv": [
0,
0,
3.5,
8.315100000000001
],
"texture": "#tire_b"
}
}
},
{
"from": [
21.5,
0.3424499999999995,
16.34245
],
"to": [
25.0,
8.65755,
24.65755
],
"faces": {
"north": {
"uv": [
0,
0,
3.5,
8.315100000000001
],
"texture": "#tire_b"
},
"south": {
"uv": [
0,
0,
3.5,
8.315100000000001
],
"texture": "#tire_b"
},
"east": {
"uv": [
0,
0,
8.315100000000001,
8.315100000000001
],
"texture": "#hub_b"
},
"west": {
"uv": [
0,
0,
8.315100000000001,
8.315100000000001
],
"texture": "#hub_b"
},
"up": {
"uv": [
0,
0,
3.5,
8.315100000000001
],
"texture": "#tire_b"
},
"down": {
"uv": [
0,
0,
3.5,
8.315100000000001
],
"texture": "#tire_b"
}
}
},
{
"from": [
-8.97,
0.3424499999999995,
16.34245
],
"to": [
-5.53,
8.65755,
24.65755
],
"faces": {
"north": {
"uv": [
0,
0,
3.4400000000000004,
8.315100000000001
],
"texture": "#tire_b"
},
"south": {
"uv": [
0,
0,
3.4400000000000004,
8.315100000000001
],
"texture": "#tire_b"
},
"east": {
"uv": [
0,
0,
8.315100000000001,
8.315100000000001
],
"texture": "#hub_b"
},
"west": {
"uv": [
0,
0,
8.315100000000001,
8.315100000000001
],
"texture": "#hub_b"
},
"up": {
"uv": [
0,
0,
3.4400000000000004,
8.315100000000001
],
"texture": "#tire_b"
},
"down": {
"uv": [
0,
0,
3.4400000000000004,
8.315100000000001
],
"texture": "#tire_b"
}
},
"rotation": {
"angle": 45,
"axis": "x",
"origin": [
-7.25,
4.5,
20.5
]
}
},
{
"from": [
21.53,
0.3424499999999995,
16.34245
],
"to": [
24.97,
8.65755,
24.65755
],
"faces": {
"north": {
"uv": [
0,
0,
3.4399999999999977,
8.315100000000001
],
"texture": "#tire_b"
},
"south": {
"uv": [
0,
0,
3.4399999999999977,
8.315100000000001
],
"texture": "#tire_b"
},
"east": {
"uv": [
0,
0,
8.315100000000001,
8.315100000000001
],
"texture": "#hub_b"
},
"west": {
"uv": [
0,
0,
8.315100000000001,
8.315100000000001
],
"texture": "#hub_b"
},
"up": {
"uv": [
0,
0,
3.4399999999999977,
8.315100000000001
],
"texture": "#tire_b"
},
"down": {
"uv": [
0,
0,
3.4399999999999977,
8.315100000000001
],
"texture": "#tire_b"
}
},
"rotation": {
"angle": 45,
"axis": "x",
"origin": [
23.25,
4.5,
20.5
]
}
}
]
}
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "airdef:item/deploy_radar"
}
}
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "airdef:item/deploy_radar"
}
}
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "airdef:item/deploy_radar"
}
}
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "airdef:item/deploy_radar"
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+65
View File
@@ -0,0 +1,65 @@
use horizon_assets::{
bake::{BlockModelTransform, bake_block_model},
model::CuboidModel,
resolve::ModelLibrary,
};
use std::{collections::BTreeMap, env, fmt::Write, fs, path::PathBuf};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let models = PathBuf::from("assets/airdef/models/block");
println!("cargo:rerun-if-changed={}", models.display());
let output = PathBuf::from(env::var_os("OUT_DIR").expect("Cargo sets OUT_DIR"));
let mut decoded = BTreeMap::new();
for entry in fs::read_dir(models)? {
let path = entry?.path();
if path.extension().is_some_and(|ext| ext == "json") {
let name = path
.file_stem()
.and_then(|s| s.to_str())
.expect("UTF-8 model name");
let model = CuboidModel::from_json(&fs::read_to_string(&path)?)
.unwrap_or_else(|e| panic!("{}: {e}", path.display()));
decoded.insert(format!("airdef:block/{name}"), model);
}
}
// Use the same cuboid baker as the client so element rotations, omitted faces and
// model coordinates match. Include only positions, with offsets for the local AABBs.
let names: Vec<_> = decoded.keys().cloned().collect();
let library = ModelLibrary::new(decoded)?;
let transform = BlockModelTransform::new([0; 3], false);
let mut bytes = Vec::new();
let mut table = String::from("&[\n");
for name in names {
let model = library.resolve(&name)?;
let faces = bake_block_model(&model, transform)?;
if faces.is_empty() {
continue;
}
let start = bytes.len();
let mut min = [f32::INFINITY; 3];
let mut max = [f32::NEG_INFINITY; 3];
for face in faces {
for position in face.positions {
for (i, coordinate) in position.into_iter().enumerate() {
let centred = coordinate - 0.5;
min[i] = min[i].min(centred);
max[i] = max[i].max(centred);
bytes.extend_from_slice(&centred.to_le_bytes());
}
}
}
let id = name.replace(":block/", ":");
let extent = std::array::from_fn::<_, 3, _>(|i| min[i].abs().max(max[i].abs()));
let radius = extent.iter().map(|value| value * value).sum::<f32>().sqrt();
writeln!(
table,
" ({id:?}, Mesh {{ min: {min:?}, max: {max:?}, radius: {radius:?}, start: {start}, end: {} }}),",
bytes.len()
)?;
}
table.push_str("]\n");
fs::write(output.join("inspect-meshes.rs"), table)?;
fs::write(output.join("inspect-faces.bin"), bytes)?;
Ok(())
}
@@ -0,0 +1,4 @@
{
"template": "minecraft:stone",
"item": false
}
@@ -0,0 +1,4 @@
{
"template": "minecraft:stone",
"item": false
}
@@ -0,0 +1,4 @@
{
"template": "minecraft:stone",
"item": false
}
@@ -0,0 +1,4 @@
{
"template": "minecraft:stone",
"item": false
}
@@ -0,0 +1,4 @@
{
"template": "minecraft:stone",
"item": false
}
@@ -0,0 +1,4 @@
{
"template": "minecraft:stone",
"item": false
}
@@ -0,0 +1,4 @@
{
"template": "minecraft:stone",
"item": false
}
@@ -0,0 +1,4 @@
{
"template": "minecraft:stick",
"max_stack_size": 1
}
@@ -0,0 +1,4 @@
{
"template": "minecraft:stick",
"max_stack_size": 1
}
@@ -0,0 +1,4 @@
{
"template": "minecraft:stick",
"max_stack_size": 1
}
@@ -0,0 +1,4 @@
{
"template": "minecraft:stick",
"max_stack_size": 1
}
+57
View File
@@ -0,0 +1,57 @@
//! Enemy-picture outcomes on fixed seeds (#127): what changed for the raids, measured.
//!
//! Runs the standard scenarios over a fixed seed set and prints one JSON object with the
//! completion, losses and failure reasons of every run — the before/after comparison of the
//! honest EnemyPicture is judged on these, not on "it got smarter".
//!
//! cargo run --release --example intel_bench
#[path = "sim_run/harness.rs"]
mod harness;
use harness::{big_smart, ew_adaptive, logistics, Scenario};
fn esc(s: &str) -> String {
s.chars().flat_map(|c| match c {
'"' => "\\\"".chars().collect::<Vec<_>>(),
'\\' => "\\\\".chars().collect::<Vec<_>>(),
c => vec![c],
}).collect()
}
fn run(sc: &Scenario) -> String {
let r = harness::run(sc);
format!(
"{{\"scenario\":\"{}\",\"seed\":{},\"ticks_run\":{},\"raids_ordered\":{},\"raids_ended\":{},\"all_ended\":{},\"launched\":{},\"kills\":{},\"hits\":{},\"crashes\":{},\"sams_lost\":{},\"fired\":{},\"retargets_max\":{},\"air_bytes\":{},\"switches_max\":{},\"intents\":\"{}\",\"failures\":\"{}\"}}",
esc(&r.name),
r.seed,
r.ticks_run,
r.raids_ordered,
r.raids_ended,
r.all_ended,
r.launched,
r.kills,
r.hits,
r.crashes,
r.sams_lost,
r.fired,
r.retargets_max,
r.air_bytes,
r.switches_max,
esc(&r.intents),
esc(&r.failures),
)
}
pub fn main() {
let scenarios: Vec<fn() -> Scenario> = vec![big_smart, logistics, ew_adaptive];
let seeds = [1u64, 7, 42];
let mut rows = Vec::new();
for make in &scenarios {
for &seed in &seeds {
let mut sc = make();
sc.seed = seed;
rows.push(run(&sc));
}
}
println!("[{}]", rows.join(",\n"));
}
+261
View File
@@ -0,0 +1,261 @@
//! Replay hot-path benchmark (#150): a 10-minute raid with its journals almost full.
//!
//! Plays the recording the ways a player does — ordinary playback, reverse seeks, a pause and
//! an MP4 export (the director's film) — and reports the CPU per frame (p50/p95/p99) and the
//! events the by-time readers handed out. Run it with the counters built in:
//!
//! cargo run --release --example replay_bench --features bench-counters
//!
//! Without `bench-counters` the scanned-events numbers read 0. Native timings compare runs on
//! one machine; they say nothing about the WASM build or the GPU.
use airdef::film::{Film, Which};
use airdef::replay::{Control, Mode, Player};
use airdef::sim::record::{Event, EventKind, Recording, SceneEvent, SceneJournal, SceneKind, StrikeResult, What};
use airdef::sim::{DroneKind, Ground, MissileKind, Out, SamKind, Sim};
use glam::DVec3;
use std::time::{Duration, Instant};
/// The longest recording, ticks (10 minutes at 20 a second).
const TICKS: u32 = 12_000;
/// The event journal's cap, and the scene journal's (`MAX_SCENE_EVENTS`), nearly reached.
const EVENTS: usize = 64_000;
const SCENE: usize = 65_000;
/// Frames measured per mode (20 a second, half a minute of playback; a film frame is 0.05 s).
const FRAMES: usize = 600;
const LISTENER: DVec3 = DVec3::new(0.0, 70.0, 0.0);
/// A 10-minute raid's recording: 200 flights, a nearly full event journal and scene journal,
/// the objects, systems, tracks and the fires — the journal a busy raid leaves.
fn recording() -> Recording {
let mut rec = Recording::blank(TICKS);
rec.number = 1;
rec.len = TICKS;
rec.origin = DVec3::ZERO;
rec.sams = (0..8).map(|i| (10 + i, SamKind::S400, DVec3::new(i as f64 * 120.0, 64.0, 400.0))).collect();
rec.objects = (0..8).map(|i| DVec3::new(i as f64 * 90.0, 70.0, 0.0)).collect();
// 200 flights, each a few hundred ticks of the raid (a point every 2 ticks): the map and
// the ghosts draw them, the sounds read their launches.
for k in 0..200u32 {
let first = k * 55 % (TICKS - 700);
let last = first + 600;
let what = match k % 4 {
0 => What::Drone(DroneKind::Geran3),
1 => What::Drone(DroneKind::Shahed),
2 => What::Missile(MissileKind::M48n6, 10 + k % 8),
_ => What::Strike,
};
rec.straight(1000 + k, what, first, last, DVec3::new(-2000.0, 100.0, k as f64 * 5.0), DVec3::new(500.0, 70.0, k as f64 * 5.0));
}
// The events: interceptions, hits, losses and splits spread through the raid.
rec.events = (0..EVENTS)
.map(|i| {
let at = (i as u64 * u64::from(TICKS) / EVENTS as u64) as u32;
let drone = 1000 + (i as u32 * 7 % 200);
let pos = DVec3::new((i % 40) as f64 * 10.0, 95.0, (i % 17) as f64 * 12.0);
let kind = match i % 10 {
0 | 1 => EventKind::Kill { drone, kind: DroneKind::Geran3, sam: 10, sam_kind: SamKind::S400, sam_index: 0, missile: None, outcome: Default::default() },
2 | 3 => EventKind::Hit { drone, kind: DroneKind::Geran3, power: (i % 5) as u32, object: Some(i % 8), sam: None },
4 | 5 => EventKind::Crash { drone, kind: DroneKind::Geran3, power: (i % 5) as u32 },
6 => EventKind::SamLost { sam: 10 + (i % 8) as u32, kind: SamKind::S400, index: i % 8 },
7 => EventKind::Split { drone },
_ => EventKind::Strike { site: 1, result: StrikeResult::Destroyed },
};
Event { at, pos, kind }
})
.collect();
// The scene journal: launches and ignitions (the exact sounds), track changes and fires.
let mut scene = SceneJournal::default();
for i in 0..SCENE {
let at = (i as u64 * u64::from(TICKS) / SCENE as u64) as u32;
let missile = 5000 + (i as u32 % 300);
let pos = DVec3::new((i % 30) as f64 * 8.0, 66.0, 300.0);
let kind = match i % 100 {
// Fires are a small share of a raid's transitions (hundreds over ten minutes).
0 => SceneKind::FireStarted { fire: (i / 100) as u32, age: 0, life: 4000, size: 1.0, quiet: false, shown: true, water: Some(false) },
1 => SceneKind::FireEnded { fire: (i / 100) as u32 },
2 | 3 => SceneKind::MissileLaunch { missile, sam: 10, target: 2000, kind: MissileKind::M48n6, sound: "airdef:launch.s400", pitch: 1.0 },
4 | 5 => SceneKind::MotorIgnition { missile, kind: MissileKind::M48n6, sound: Some("airdef:launch.s400") },
6 => SceneKind::MotorBurnout { missile, kind: MissileKind::M48n6 },
7 => SceneKind::MotorEnergyLost { missile, kind: MissileKind::M48n6, speed: 4.0 },
8 | 9 => SceneKind::TrackAcquired { sam: 10, target: 2000 + (i as u32 % 200), ever_own: true },
_ => SceneKind::TrackLost { sam: 10, target: 2000 + (i as u32 % 200) },
};
scene.fixture_push(SceneEvent { at, pos, kind });
}
rec.scene = Some(scene);
rec.close();
rec
}
/// Answers the ground queries the replays make with a flat 70-block land, as the game would.
fn settle(ground: &mut Ground, now: u64) {
let wanted = ground.take_wanted();
if !wanted.is_empty() {
ground.answer(wanted.into_iter().map(|(x, z)| (x, z, 70)).collect(), now);
}
}
fn percentile(sorted: &[Duration], p: f64) -> f64 {
if sorted.is_empty() {
return 0.0;
}
let i = (((sorted.len() - 1) as f64) * p).round() as usize;
sorted[i].as_secs_f64() * 1e6
}
struct Measured {
mode: &'static str,
frames: usize,
scanned: u64,
cpu: Vec<Duration>,
}
impl Measured {
fn cpu_p(&self, p: f64) -> f64 {
let mut sorted = self.cpu.clone();
sorted.sort_unstable();
percentile(&sorted, p)
}
fn json(&self, rec: &Recording, sim: &Sim) -> String {
let events_bytes = rec.events.capacity() * std::mem::size_of::<Event>();
let scene_events = rec.scene.as_ref().map_or(0, |s| s.events().len());
let scene_bytes = scene_events * std::mem::size_of::<SceneEvent>();
let index_bytes: usize = sim.replays.iter().map(Recording::index_bytes).sum();
format!(
"{{\"mode\":\"{}\",\"frames\":{},\"journal_events\":{},\"journal_scene\":{},\
\"scanned_events\":{},\"scanned_per_frame\":{:.1},\"full_pass_events\":{},\
\"p50_us\":{:.1},\"p95_us\":{:.1},\"p99_us\":{:.1},\"max_us\":{:.1},\
\"events_bytes\":{},\"scene_bytes\":{},\"index_bytes\":{}}}",
self.mode,
self.frames,
rec.events.len(),
scene_events,
self.scanned,
self.scanned as f64 / self.frames.max(1) as f64,
// One whole-journal pass per frame: what the readers did before the ranges (#150).
(rec.events.len() + scene_events) as u64 * self.frames as u64,
self.cpu_p(0.50),
self.cpu_p(0.95),
self.cpu_p(0.99),
self.cpu.iter().copied().max().unwrap_or_default().as_secs_f64() * 1e6,
events_bytes,
scene_bytes,
index_bytes,
)
}
}
/// Steps the replay's clock to `t` the way the wheel does (5 s a press), so the seek resets the
/// sound cursor and the shot as a player's would.
fn seek_to(p: &mut Player, rec: &Recording, t: f64) {
for _ in 0..((t.max(0.0) / 100.0) as usize) {
p.control(Control::Forward, rec);
}
}
fn sim_with(rec: Recording) -> (Sim, u64) {
let mut sim = Sim::new(1);
sim.replays.push(rec);
(sim, 1)
}
/// Ordinary playback from a moment near the end of the raid, time running at ×2.
fn playback() -> Measured {
let (sim, mut tick) = sim_with(recording());
let rec = &sim.replays[0];
let mut p = Player::new(1, Mode::Full, &sim);
seek_to(&mut p, rec, rec.len as f64 - 1_200.0);
let mut ground = Ground::default();
let mut out = Out::default();
let _ = airdef::sim::record::scanned_events();
let mut cpu = Vec::with_capacity(FRAMES);
for _ in 0..FRAMES {
let started = Instant::now();
p.tick(&sim, &mut ground, LISTENER, &mut out);
settle(&mut ground, tick);
tick += 1;
cpu.push(started.elapsed());
out = Out::default();
}
Measured { mode: "playback", frames: FRAMES, scanned: airdef::sim::record::scanned_events(), cpu }
}
/// Reverse seeks: five seconds back every frame, then a frame of playback.
fn reverse_seek() -> Measured {
let (sim, mut tick) = sim_with(recording());
let rec = &sim.replays[0];
let mut p = Player::new(1, Mode::Full, &sim);
seek_to(&mut p, rec, rec.len as f64 - 200.0);
let mut ground = Ground::default();
let mut out = Out::default();
let _ = airdef::sim::record::scanned_events();
let mut cpu = Vec::with_capacity(FRAMES);
for _ in 0..FRAMES {
let started = Instant::now();
p.control(Control::Back, rec);
p.tick(&sim, &mut ground, LISTENER, &mut out);
settle(&mut ground, tick);
tick += 1;
cpu.push(started.elapsed());
out = Out::default();
}
Measured { mode: "reverse_seek", frames: FRAMES, scanned: airdef::sim::record::scanned_events(), cpu }
}
/// A pause held while frames keep coming (the HUD and the ghosts stay, nothing sounds).
fn paused() -> Measured {
let (sim, mut tick) = sim_with(recording());
let rec = &sim.replays[0];
let mut p = Player::new(1, Mode::Full, &sim);
seek_to(&mut p, rec, rec.len as f64 * 0.75);
p.control(Control::Pause, rec);
let mut ground = Ground::default();
let mut out = Out::default();
let _ = airdef::sim::record::scanned_events();
let mut cpu = Vec::with_capacity(FRAMES);
for _ in 0..FRAMES {
let started = Instant::now();
p.tick(&sim, &mut ground, LISTENER, &mut out);
settle(&mut ground, tick);
tick += 1;
cpu.push(started.elapsed());
out = Out::default();
}
Measured { mode: "pause", frames: FRAMES, scanned: airdef::sim::record::scanned_events(), cpu }
}
/// An MP4 export: the director's film, its frames prepared and drawn as the game records them.
fn mp4() -> Measured {
let (sim, mut tick) = sim_with(recording());
let rec = &sim.replays[0];
let film = Film::build(rec, Which::Best).expect("the raid has moments to film");
let mut p = Player::new(1, Mode::Film(Box::new(film)), &sim);
p.wait = true;
p.clean = true;
let mut ground = Ground::default();
let mut out = Out::default();
let _ = airdef::sim::record::scanned_events();
let mut cpu = Vec::with_capacity(FRAMES);
for _ in 0..FRAMES {
let started = Instant::now();
p.tick(&sim, &mut ground, LISTENER, &mut out);
settle(&mut ground, tick);
tick += 1;
cpu.push(started.elapsed());
out = Out::default();
}
Measured { mode: "mp4", frames: FRAMES, scanned: airdef::sim::record::scanned_events(), cpu }
}
pub fn main() {
let (playback, reverse_seek, paused, mp4) = (playback(), reverse_seek(), paused(), mp4());
let (sim, _) = sim_with(recording());
let rec = &sim.replays[0];
if !airdef::sim::record::scan_counters() {
eprintln!("replay_bench: scanned events read 0; rerun with --features bench-counters");
}
let rows = [playback.json(rec, &sim), reverse_seek.json(rec, &sim), paused.json(rec, &sim), mp4.json(rec, &sim)];
println!("[");
println!("{}", rows.join(",\n"));
println!("]");
}
+78 -1
View File
@@ -5,6 +5,8 @@
//! Native timings say nothing about the WASM build or the GPU; use them to compare runs of the
//! same machine.
#![allow(dead_code)]
#[path = "../../src/world_view.rs"]
mod world_view;
use airdef::sim::{Aim, Approach, DroneKind, Ground, Out, RaidOrder, Sam, SamKind, Sim};
use glam::DVec3;
use std::collections::HashMap;
@@ -70,6 +72,9 @@ pub struct Scenario {
pub ew: bool,
/// Ticks a truck on a job may stand still before it counts as stuck.
pub stuck_after: u64,
/// The smart enemy runs the legacy picks (#149's comparison runner): separate hint lists,
/// the lifetime bearing tally, no mark pricing and no refresh of the unreleased portion.
pub legacy: bool,
}
impl Scenario {
@@ -85,6 +90,7 @@ impl Scenario {
stop_at_end: true,
ew: false,
stuck_after: 600,
legacy: false,
}
}
pub fn unit(&mut self, kind: SamKind, x: f64, z: f64) -> &mut Unit {
@@ -126,6 +132,37 @@ pub struct Report {
pub raids_ordered: usize,
pub raids_ended: usize,
pub all_ended: bool,
/// Systems the defence lost (destroyed units at the end).
pub sams_lost: u32,
/// The most retarget route jobs waiting at once (#127).
pub retargets_max: usize,
/// The largest air section a save would have taken, in bytes (#127).
pub air_bytes: usize,
/// The aims every drone ended with, by intent: "plan:1,sead:2,react:3,replace:0".
pub intents: String,
/// The most aim switches one drone went through.
pub switches_max: u16,
/// Smart drones seen over the run (#149's comparison).
pub smart_seen: u32,
/// The share of them whose last aim was a live public hint when last seen (#149).
pub useful_share: f64,
/// Distinct aim units over the smart drones seen, per drone (#149).
pub diversity: f64,
/// The share of smart drones switched twice or more (#149's jitter).
pub jittery_share: f64,
/// The bearing picker's last typed reason (#149).
pub bearing_reason: String,
/// Aims the bounded refresh re-chose (#149).
pub refresh_applied: u32,
}
/// The last intent every smart drone of the run was seen carrying, as `name:count`.
fn intent_counts(seen: &HashMap<u32, &'static str>) -> String {
let mut counts = std::collections::BTreeMap::new();
for name in seen.values() {
*counts.entry(*name).or_insert(0usize) += 1;
}
["plan", "sead", "react", "replace", "refresh"].iter().map(|k| format!("{k}:{}", counts.get(*k).copied().unwrap_or(0))).collect::<Vec<_>>().join(",")
}
fn finite(v: DVec3) -> bool {
@@ -133,7 +170,14 @@ fn finite(v: DVec3) -> bool {
}
pub fn run(sc: &Scenario) -> Report {
run_with_hook(sc, &mut |_, _| {})
}
/// The same, with a hook called after every tick (#149's comparison runner): a scenario may
/// change the defence between waves or shoot a recon flight down before its report.
pub fn run_with_hook(sc: &Scenario, hook: &mut dyn FnMut(u64, &mut Sim)) -> Report {
let mut sim = Sim::new(sc.seed);
sim.smart_legacy = sc.legacy;
sim.damage = false; // explosions would change the land the height function describes
for u in &sc.units {
let id = sim.id();
@@ -160,6 +204,10 @@ pub fn run(sc: &Scenario) -> Report {
let mut ended = vec![false; sc.raids.len()];
// truck id -> (last position, ticks standing while busy)
let mut standing: HashMap<u32, (DVec3, u64)> = HashMap::new();
// drone id -> the last structured intent it carried (#127).
let mut intents_seen: HashMap<u32, &'static str> = HashMap::new();
// drone id -> (last aim unit, whether the picture held it live then, switches) (#149).
let mut decisions: HashMap<u32, (u32, bool, u16)> = HashMap::new();
let mut out = Out::default();
for now in 1..=sc.ticks {
// Raids come in order: one is ordered once the previous one has been sent.
@@ -182,6 +230,7 @@ pub fn run(sc: &Scenario) -> Report {
ground.world.serve(&sc.terrain, sections, now);
let dt = t.elapsed();
times.push(dt);
hook(now, &mut sim);
if planning {
r.planning += dt;
r.planning_ticks += 1;
@@ -192,6 +241,20 @@ pub fn run(sc: &Scenario) -> Report {
pending = wanted.into_iter().map(|(x, z)| (x, z, sc.terrain.height(x, z))).collect();
}
r.ticks_run = now;
r.retargets_max = r.retargets_max.max(sim.retargets_len());
r.switches_max = sim.drones.iter().chain(sim.queue.iter().map(|(_, d)| d)).map(|d| d.aim_switches()).max().unwrap_or(0).max(r.switches_max);
for d in sim.drones.iter().chain(sim.queue.iter().map(|(_, d)| d)) {
if d.alive() && d.smart() {
intents_seen.insert(d.id, d.intent().name());
let unit = d.aim_unit();
decisions.insert(d.id, (unit, unit != 0 && sim.known_live(unit), d.aim_switches()));
}
}
// The air section a save would take, sampled when the sky is fullest (writing it every tick
// would distort the timings the bench measures).
if sim.drones.len() > r.air_bytes {
r.air_bytes = sim.air_text().map_or(0, |t| t.len());
}
// NaN check on everything with a position.
let bad = sim.drones.iter().filter(|d| !finite(d.pos) || !finite(d.vel)).count()
+ sim.missiles.iter().filter(|m| !finite(m.pos)).count()
@@ -225,15 +288,29 @@ pub fn run(sc: &Scenario) -> Report {
}
}
r.launched = sim.launched;
r.sams_lost = sim.sams.iter().filter(|s| !s.alive()).count() as u32;
r.kills = sim.kills;
r.hits = sim.hits;
r.fired = sim.sams.iter().map(|s| s.fired).sum();
r.raids_ordered = ordered.iter().filter(|o| **o).count();
r.world = ground.world.text();
r.world = world_view::text(&ground.world);
r.crashes = sim.crashes;
r.failures = sim.tally.text();
r.raids_ended = ended.iter().filter(|o| **o).count();
r.all_ended = r.raids_ended == sc.raids.len();
r.intents = intent_counts(&intents_seen);
r.smart_seen = decisions.len() as u32;
if !decisions.is_empty() {
let n = decisions.len() as f64;
r.useful_share = decisions.values().filter(|(_, live, _)| *live).count() as f64 / n;
let mut units: Vec<u32> = decisions.values().map(|(u, _, _)| *u).collect();
units.sort_unstable();
units.dedup();
r.diversity = units.len() as f64 / n;
r.jittery_share = decisions.values().filter(|(_, _, s)| *s >= 2).count() as f64 / n;
}
r.bearing_reason = sim.bearing_report().reason.name().to_string();
r.refresh_applied = sim.refresh_applied();
r.tick_total = times.iter().sum();
times.sort();
if !times.is_empty() {
+187
View File
@@ -0,0 +1,187 @@
//! Smart v2 comparison runner (#149): the simple mode, the current (legacy) Smart and the
//! candidate, on fixed seeds and one scenario set — open map, hills, a configuration changed
//! between waves, and a recon flight shot down before its report.
//!
//! It prints one JSON array of rows: the share of useful decisions (a smart drone whose last
//! aim was a live public hint), the diversity of aims, the reasons (intents) on the review,
//! the share of jittery drones (two switches or more), the bearing picker's typed reason, the
//! refresh count, and the CPU/worst-job figures. The goal is interesting counterplay and clear
//! mistakes, not a maximised hit count — read the reasons and the jitter beside the losses.
//!
//! cargo run --release --example smart_bench
#[path = "sim_run/harness.rs"]
mod harness;
use airdef::sim::{Aim, Approach, DroneKind, Sam, SamKind, Sim};
use glam::DVec3;
use harness::{Report, Scenario, Terrain};
#[derive(Clone, Copy, PartialEq)]
enum Mode {
Simple,
Current,
Candidate,
}
impl Mode {
fn name(self) -> &'static str {
match self {
Mode::Simple => "simple",
Mode::Current => "current",
Mode::Candidate => "candidate",
}
}
fn apply(self, sc: &mut Scenario) {
sc.legacy = self == Mode::Current;
let aim = match self {
Mode::Simple => Aim::ObjectsAndSams,
_ => Aim::Smart,
};
for raid in &mut sc.raids {
raid.aim = aim;
}
}
}
fn esc(s: &str) -> String {
s.chars().flat_map(|c| match c {
'"' => "\\\"".chars().collect::<Vec<_>>(),
'\\' => "\\\\".chars().collect::<Vec<_>>(),
c => vec![c],
}).collect()
}
fn row(sc: &str, mode: Mode, r: &Report) -> String {
format!(
"{{\"scenario\":\"{}\",\"mode\":\"{}\",\"seed\":{},\"ticks\":{},\"all_ended\":{},\"launched\":{},\"kills\":{},\"hits\":{},\"fired\":{},\"sams_lost\":{},\"smart_seen\":{},\"useful_share\":{:.3},\"diversity\":{:.3},\"jittery_share\":{:.3},\"intents\":\"{}\",\"bearing_reason\":\"{}\",\"refresh_applied\":{},\"switches_max\":{},\"retargets_max\":{},\"tick_p95_ms\":{:.3},\"tick_max_ms\":{:.3},\"planning_ms\":{:.1},\"air_bytes\":{}}}",
esc(sc),
mode.name(),
r.seed,
r.ticks_run,
r.all_ended,
r.launched,
r.kills,
r.hits,
r.fired,
r.sams_lost,
r.smart_seen,
r.useful_share,
r.diversity,
r.jittery_share,
esc(&r.intents),
esc(&r.bearing_reason),
r.refresh_applied,
r.switches_max,
r.retargets_max,
r.tick_p95.as_secs_f64() * 1000.0,
r.tick_max.as_secs_f64() * 1000.0,
r.planning.as_secs_f64() * 1000.0,
r.air_bytes,
)
}
/// An open map: a ring of systems on flat land, one combined strike.
fn open() -> Scenario {
let mut sc = Scenario::new("open");
sc.terrain = Terrain::Flat(70);
for i in 0..18 {
let a = i as f64 * 2.399_963;
let r = 120.0 + (i as f64 / 18.0) * 320.0;
let kind = [SamKind::Radar, SamKind::S400, SamKind::Pantsir, SamKind::Ew, SamKind::Tor][i % 5];
sc.unit(kind, a.sin() * r, a.cos() * r).heading = a;
}
sc.raids.push(harness::RaidSpec {
kinds: vec![(DroneKind::Gerbera, 6), (DroneKind::Shahed, 10), (DroneKind::Kh101, 3), (DroneKind::Kh22, 2), (DroneKind::Lancet, 3)],
approach: Approach::AllSides,
aim: Aim::Smart,
dist: 500.0,
at: 1,
});
sc.ticks = 20 * 60 * 6;
sc
}
/// Hills: the standard big smart scenario's terrain and force.
fn hills() -> Scenario {
let mut sc = harness::big_smart();
sc.name = "hills".into();
sc.ticks = 20 * 60 * 6;
sc
}
/// Two waves with the defence changed between them: a radar moves unobserved, the EW stations
/// switch on, and a fresh battery appears. The second wave's picture must earn what it knows.
fn config_change() -> Scenario {
let mut sc = open();
sc.name = "config-change".into();
sc.raids.push(harness::RaidSpec {
kinds: vec![(DroneKind::Shahed, 8), (DroneKind::Geran3, 4), (DroneKind::Kh22, 2), (DroneKind::Iskander, 2)],
approach: Approach::TwoSectors,
aim: Aim::Smart,
dist: 600.0,
at: 4200,
});
sc.ticks = 20 * 60 * 10;
sc
}
/// A recon flight shot down before its report: the strike must fly on the picture it had, and
/// the bounded refresh must never hold the raid waiting for a report that will not come.
fn recon_lost() -> Scenario {
let mut sc = open();
sc.name = "recon-lost".into();
sc.ticks = 20 * 60 * 6;
sc
}
pub fn main() {
let seeds = [1u64, 7, 42];
let scenarios: [(&str, fn() -> Scenario); 4] = [("open", open), ("hills", hills), ("config-change", config_change), ("recon-lost", recon_lost)];
let modes = [Mode::Simple, Mode::Current, Mode::Candidate];
let mut rows = Vec::new();
for (name, make) in scenarios {
for mode in modes {
for &seed in &seeds {
let r = run(mode, name, make, seed);
rows.push(row(name, mode, &r));
eprintln!("{name} {} seed {seed}: useful {:.2} diversity {:.2} jitter {:.2} kills {} hits {} reasons {} bearing {} refresh {}", mode.name(), r.useful_share, r.diversity, r.jittery_share, r.kills, r.hits, r.intents, r.bearing_reason, r.refresh_applied);
}
}
}
println!("[{}]", rows.join(",\n"));
}
fn run(mode: Mode, name: &str, make: fn() -> Scenario, seed: u64) -> Report {
let mut sc = make();
sc.seed = seed;
mode.apply(&mut sc);
match name {
"config-change" => {
let mut changed = false;
harness::run_with_hook(&sc, &mut |now, sim: &mut Sim| {
if !changed && now >= 3600 && !sim.planning() {
changed = true;
if let Some(radar) = sim.sams.iter_mut().find(|s| s.kind == SamKind::Radar) {
radar.pos += DVec3::new(300.0, 0.0, -200.0);
}
let id = sim.id();
sim.sams.push(Sam::new(id, SamKind::Pantsir, DVec3::new(-200.0, 70.0, 250.0), 0.0));
sim.set_ew(true);
}
})
}
"recon-lost" => {
let mut killed = false;
harness::run_with_hook(&sc, &mut |now, sim: &mut Sim| {
if !killed && now >= 120 {
let recon: Vec<u32> = sim.drones.iter().filter(|d| sim.is_recon_drone(d.id)).map(|d| d.id).collect();
if !recon.is_empty() {
sim.drones.retain(|d| !recon.contains(&d.id));
killed = true;
}
}
})
}
_ => harness::run(&sc),
}
}
+38 -5
View File
@@ -46,6 +46,9 @@ dc55ec1579702d9d48c01e5268dfae7097d0ece87d85b1a469222134f962f4b1 assets/airdef/
f05bb84135b39bc469fadbc4f144e0f69d203b1887396a0b20adac59e549c1ed assets/airdef/blockstates/nasams_launcher_burnt.json
9fa63fdb0fe84521f00326dad6955af6adb3dea1093f42404e6e07770cd9bcf5 assets/airdef/blockstates/nasams_trailer.json
640b83fc5b43f6fce1d13106016e9b14c0150603035a6d9b19ad6f0598511959 assets/airdef/blockstates/nasams_trailer_burnt.json
c5a66987d06e5ed3e854d82e8763d91a1f623bb5e2f01ca2dfba8fa9c07f8b93 assets/airdef/blockstates/optical_head.json
43eb7af63a5f9af8661cdc9a2ec7975a39f3918246f34a528d6ac7a72ac05246 assets/airdef/blockstates/optical_post.json
e20e544e03280bcfa70f9c935f587c11e4435ffd59de29b10258403cab3c1fea assets/airdef/blockstates/optical_post_burnt.json
446bd55fb9bacd7828c6a7028595de64e26cc5cbe3ef4280713c3d9f1cdf850e assets/airdef/blockstates/p1sun.json
9e2e00e75afb10c38684b1994688ea11bcc2faace46ff551967e1e05ae08ec85 assets/airdef/blockstates/p1sun_launcher.json
02f9474f5f459e33096931887b71b515d957b7a1be14ccb81a0bba36af551ec9 assets/airdef/blockstates/p1sun_launcher_burnt.json
@@ -63,10 +66,14 @@ c3b0b6f1d9b7da434c95f2794b97b9e2c05c62ccbce9f0884df071e4ec28a468 assets/airdef/
3ecae997dc4fe1939848fc60347979c02075396a164b31dec3995a2e907a8447 assets/airdef/blockstates/patriot_trailer.json
31fecc6476129990a7d368f6d7cdb954b13e777b28d1396a68168770024112ce assets/airdef/blockstates/patriot_trailer_burnt.json
183d0b2ae9c24c94c3d83f2819e1167b5e2d134cc7889e0e3bda12aa784c7baa assets/airdef/blockstates/patriot_truck.json
3e7ce4d164ac8b2694bf4716b2b5222f555c2db3660f514d62213466b2266d8f assets/airdef/blockstates/radar_dish.json
bc6918e6d76436d10c64397c402a5c8283d2e7dff7653b329aa5155664b0b425 assets/airdef/blockstates/radar_height_head.json
421b5be0a4c80e892850f4a77d5ebb386e04153201be63241c7edc11659d03de assets/airdef/blockstates/radar_mast.json
fcc6bbe526baf5551923e2a69cdf09f506cdfd96669e1fffbea643401dd2a1de assets/airdef/blockstates/radar_mast_burnt.json
37714e19e555cc50a9f195e1a8845a28c9985c27ed38b577c0813f4629b66fcb assets/airdef/blockstates/radar_panel.json
a8f3af5c8996779eeab1e115079a4d7fc0dc128571235ece075018de2c94a53b assets/airdef/blockstates/radar_search_array.json
95fe14b9d3e30597f5505aa93f31c3357cebea6117596bd9f5a5bc840ab22415 assets/airdef/blockstates/radar_trailer.json
15bd34f426c401eb28eefa60aba5797b5edf62373f1505ac5b9d5aaa7cf6086b assets/airdef/blockstates/radar_trailer_burnt.json
a95a1b8731d6bedda7d8b352ff3c448ea8be691b0ead01f14acab39234590c45 assets/airdef/blockstates/radar_truck.json
332e6f39c40063ca690064e13a1a256ef215fc2bb96985b842d9dda58abee2eb assets/airdef/blockstates/radar_truck_burnt.json
67b93302bea867248b6fa0109a4b5af2065e5c857d4a5c7e088bc9849fe624de assets/airdef/blockstates/reentry.json
@@ -114,10 +121,14 @@ b50fe5804cbbe10df992ebbc7e095a32ce8b73fc35159fa19889640681e408e9 assets/airdef/
0c9c5ee3fc87e2dc6d716bdb0bb5f30d3b265268bfd5083462b4861a8da65f0f assets/airdef/items/deploy_irist.json
09e46a6c4b59f66c24060ac627e6a287bf6797c7b1e32a9ec6c9d9662fdc3de3 assets/airdef/items/deploy_light.json
6983561b3558aee16662aa83d2d9af760fb6236cc7dbe79ba20802f8a2ff15b9 assets/airdef/items/deploy_nasams.json
e39c555ff197ed6c7c8fdfab924b7a609b5d111a905ca599a75a7b1270448fcc assets/airdef/items/deploy_optical.json
d8ac6a9258e2fc2e0791bbce18a3a07a72e471fbc72b6be7b5ca545c53f8d633 assets/airdef/items/deploy_p1sun.json
e2353c70f6e5053864ab2fdf51df886d72c03e5c34db84fef8f3fff9c84a7ae4 assets/airdef/items/deploy_pantsir.json
68dd9b1382b2dd6ad23d0f507a8cfcdcfa18ef5c4203e69c61f6ade9cfbf238e assets/airdef/items/deploy_patriot.json
d93b6bf77de4aed1f1955e76353661729f06445788ad7a6654ed6af1a67fc48d assets/airdef/items/deploy_radar.json
84306c42dd25300f1cef69c83e3211ccc921fa606046157295a4ca3e3d568a0a assets/airdef/items/deploy_radar_height.json
28f6b71116bdc911e70d2382807c86edff40adae44acd256f798360dc60bd572 assets/airdef/items/deploy_radar_search.json
0e470cfa2a13383fadb74336c5333449f4079659d9d83596dcfcf2d592521a4c assets/airdef/items/deploy_radar_track.json
0b9445f3b54a9e958da0b9bd4243a41d85fc8f12b5c4e56bbc070edb8f1bf618 assets/airdef/items/deploy_s400.json
dd7478f447d87dcad42e1a7e6dcb5fae555c832e933a3722022d0e10e2de011e assets/airdef/items/deploy_s500.json
14e9a20dcddee5a6262ef624783900576dac2bd16e5079e731cf6115f13c76ec assets/airdef/items/deploy_tor.json
@@ -136,8 +147,8 @@ b4d98a938486d49db28c6c7a608ca3b6ab0c9c3eac266ecf12c7dd931cc28f93 assets/airdef/
489799dcb5b441e9d4be8bfb3d73a6ebd5fdf2b5ee614b62f38b85bb2fbfad75 assets/airdef/items/launch_zircon.json
6b6da5887aa8d9bc987b2c181c243bc2afdd5846a869818f699b59204e559929 assets/airdef/items/mover.json
177f7535e4c52ed975d6f737c2b2acb7741b7a928955c8899aced85211443bbf assets/airdef/items/remover.json
cede33ba58f61891a8afe42e1f4311cb293ca93f4d7eb3a57636caff17317a4d assets/airdef/lang/en_us.json
cede33ba58f61891a8afe42e1f4311cb293ca93f4d7eb3a57636caff17317a4d assets/airdef/lang/ru_ru.json
a73610d97f325b0e735d8bfcdea2e46e3ac1b2f8497fdb4c8cca0ed07e4a7375 assets/airdef/lang/en_us.json
a73610d97f325b0e735d8bfcdea2e46e3ac1b2f8497fdb4c8cca0ed07e4a7375 assets/airdef/lang/ru_ru.json
b9b5b5bec33a77e944552c225ee2f526ab9820fa8fca4b3ccf311f2a325925ee assets/airdef/models/block/amraam_missile.json
c54e6b24ab69e9d9a2dbbbc63fe2ac60fa37735bf644500ddd5c3de0b91908cf assets/airdef/models/block/barge.json
a4198ff647de5866919f9b82a3d53e6486fc56cc9f175f7907951d063a6f4526 assets/airdef/models/block/beam.json
@@ -173,10 +184,10 @@ e6cb3f578b875d3683d2a027f1ac34226b56c4db410fecc6479e2683485b8c3e assets/airdef/
449284669a58d71ae2de7e68cd7cf18ae21fec70ceb3124cd24fb4a09fc49909 assets/airdef/models/block/irist_tubes_burnt.json
be87037b84cd45b2c53d7fde6653f51769e782eea1b8586383afcfababf19ab6 assets/airdef/models/block/iskander.json
98d488ca797fb3d0193957b8a93a82f48376a89f8e091032e6365d1845016a90 assets/airdef/models/block/kalibr.json
be9eb1389e169a76732f16e604499260b147b524b4c929d2a4e77b580a032fb7 assets/airdef/models/block/kh101.json
20deb68dbba6eb64b7c51685497110ef7d1d3bf0aa7e7167c558e0a8e842e759 assets/airdef/models/block/kh101.json
ea7c9af888f1285502b2ca51114f226573311be6fb90b8d449b9f75cfbb6b885 assets/airdef/models/block/kh22.json
7b73015e33d85d4cef31660ef874ba8dcd6e07ae3a95416d0ead1d325bd0cb6c assets/airdef/models/block/kinzhal.json
911e55de28058e1723a61d15de80676789e57ab15bfc09fd75757cc85095fbcb assets/airdef/models/block/lancet.json
69135e90a1a7fb21d9f47b1854c5a3648e296136c2375acd9db5a48b0ad40887 assets/airdef/models/block/lancet.json
15c9884ce51311cf4b9b9d106e142e33d72c5ba18dc9236c5b51da01232f8e44 assets/airdef/models/block/launch_ramp.json
159fa5e3b6a096a1872dec2a550bfa30575d57519654a860607e20dab8f35f53 assets/airdef/models/block/launcher_truck.json
2069198ba24a932816f504fb52f53dc4bc740cacaf45637698a17d9175da851c assets/airdef/models/block/m48n6.json
@@ -186,6 +197,9 @@ ea7c9af888f1285502b2ca51114f226573311be6fb90b8d449b9f75cfbb6b885 assets/airdef/
94c8beaf3226c86d5ad018a31846286b451eaa96073e07be4465c9de3583ef61 assets/airdef/models/block/nasams_launcher_burnt.json
99d3a530ca47536443db0e2c8a8f9236d68f67b6c78a5313c44dd80fb6edbde0 assets/airdef/models/block/nasams_trailer.json
ab0d875ad069ccd241f3c75fd32ecbe3507cfe740aa072a3a75955c489629ec6 assets/airdef/models/block/nasams_trailer_burnt.json
83382b0ebd95ca2d00befd51ebec70793d34121638adfe3814f9d1e971564b05 assets/airdef/models/block/optical_head.json
204d6b6e21955fc5405953fb657633fd12f09e59deb810b70a4cfa97cb147367 assets/airdef/models/block/optical_post.json
d78a5308097ac94f77ae4d5fbbd15601c1a08dc8f0b3fb8a119d325c331d1a0d assets/airdef/models/block/optical_post_burnt.json
ce9f0dc61bd07cfcb3be5cadf12df0d2ef1b3167aa2260bc4b42414dc3825b58 assets/airdef/models/block/p1sun.json
b5346ab109ffb8c259592574b091a47bd396de34b0fe96e684b672316cee6b86 assets/airdef/models/block/p1sun_launcher.json
4457a527977ad5c7d381991ca1c9d304cac0b7074f632a04328e836bfd83f784 assets/airdef/models/block/p1sun_launcher_burnt.json
@@ -203,10 +217,14 @@ d01efdcfafa92243e745aea7870269c07a0224c9010010e2dbed720ced1662c5 assets/airdef/
548bc63e46d96e5110598e39269851c48f750164981a433f75971b0229c268df assets/airdef/models/block/patriot_trailer.json
190726b64bef4baadb0bc2a00147069685ef148100c8935402e09c3bef66e65b assets/airdef/models/block/patriot_trailer_burnt.json
6f027b020e4066f673c376e289cc627846a084e5733d62744fe78ab23013fb08 assets/airdef/models/block/patriot_truck.json
540c2b501f7fe0979ef87ceb826e899a69423cf1f7ba3c0d5542761a4064810c assets/airdef/models/block/radar_dish.json
132bfe2b948d5503a43a236535fe1f28f76dc1463a257a64174922f5aabbd84b assets/airdef/models/block/radar_height_head.json
8070d24b511ac733d73f5961762e6f5995379814f33f54c56c1a45d1dd7ff28a assets/airdef/models/block/radar_mast.json
7343f6085138f974d581706cc135e582040a46069c215e95ba14ad31dc1a8d63 assets/airdef/models/block/radar_mast_burnt.json
e5733ece9b976998c9c6a6c968b17cada868b62d9e2a7bc67e1272e333e35399 assets/airdef/models/block/radar_panel.json
f17bf8fb0680532a69e2b7faa83a96901c4525010823c16ad99b5ab0cdbd2c2e assets/airdef/models/block/radar_search_array.json
b0ae344fbad3b982e7821cd1b26f9922e2a5713b38107521ddc5a5b2abd9e39c assets/airdef/models/block/radar_trailer.json
a2005780753e8e8a51180abee788b4e46f9aab07a9dbab8acc3bfa1bc79160e7 assets/airdef/models/block/radar_trailer_burnt.json
5545094620c27fae6b3d97a71f3d68ee8e0b49804a1dcd61b79ca847277e3b61 assets/airdef/models/block/radar_truck.json
5c756abfb412b31076cd84d8735ad4e41ca26c8d5896e3795aaddb976aefbd1c assets/airdef/models/block/radar_truck_burnt.json
f102765390762d45954b26405b6acdde845df7f0a319bac53d25508e768957b5 assets/airdef/models/block/reentry.json
@@ -254,10 +272,14 @@ a5d0450da8d6757b9b45f86e6b36977894dd9e3e1278c3668b99a8acab36f399 assets/airdef/
e80ee81085241b9712e024bbef73ef744ef5493eebb88770f4912d8aae138fe6 assets/airdef/models/item/deploy_irist.json
637b9bfe426ee50045f8fcbfd4f25dfbc1d819ce36dedbd60abdac63c274f088 assets/airdef/models/item/deploy_light.json
3398844e90203f97ee73e35619684c775d1856c8ca3399b5ed682786170d9327 assets/airdef/models/item/deploy_nasams.json
332f9de8c88658a562748fc7a6de7ec37847273ac0cd0733e23c0dff4b44418c assets/airdef/models/item/deploy_optical.json
76019c05d070cf1141cdf95b744b3d6198ab99469dba1f88a6903de1de303bde assets/airdef/models/item/deploy_p1sun.json
8b1af688bc83be5a8065673bca7054deee86ca425f0bfd1fb4ffb491844e90bf assets/airdef/models/item/deploy_pantsir.json
d0091d809816350c648e532a90ae59a3c5c9b94f837b2a46b5695e7f985a00f9 assets/airdef/models/item/deploy_patriot.json
332f9de8c88658a562748fc7a6de7ec37847273ac0cd0733e23c0dff4b44418c assets/airdef/models/item/deploy_radar.json
332f9de8c88658a562748fc7a6de7ec37847273ac0cd0733e23c0dff4b44418c assets/airdef/models/item/deploy_radar_height.json
332f9de8c88658a562748fc7a6de7ec37847273ac0cd0733e23c0dff4b44418c assets/airdef/models/item/deploy_radar_search.json
332f9de8c88658a562748fc7a6de7ec37847273ac0cd0733e23c0dff4b44418c assets/airdef/models/item/deploy_radar_track.json
9ee1dfa7d2c2587c85a8f73554962a02a06f1969a9a56c56110162dd93db7301 assets/airdef/models/item/deploy_s400.json
55f1dae5cd7f0126533825c9da3ed3ee316e74d4be8f9bb217a3ebc6f827d24d assets/airdef/models/item/deploy_s500.json
aca5ea765ca0d84ed12444bf433c024b57d6ea9b9b7cf06449dfbd6892a66ae6 assets/airdef/models/item/deploy_tor.json
@@ -499,6 +521,9 @@ cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/ho
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/nasams_launcher_burnt.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/nasams_trailer.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/nasams_trailer_burnt.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/optical_head.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/optical_post.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/optical_post_burnt.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/p1sun.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/p1sun_launcher.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/p1sun_launcher_burnt.json
@@ -516,10 +541,14 @@ cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/ho
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/patriot_trailer.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/patriot_trailer_burnt.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/patriot_truck.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/radar_dish.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/radar_height_head.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/radar_mast.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/radar_mast_burnt.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/radar_panel.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/radar_search_array.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/radar_trailer.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/radar_trailer_burnt.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/radar_truck.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/radar_truck_burnt.json
cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/horizon/block/reentry.json
@@ -567,10 +596,14 @@ cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/ho
2a3912a7c9d5bb8025b1ac16a1a1d6b5eff0360bb3184e810d319e498255bf97 data/airdef/horizon/item/deploy_irist.json
2a3912a7c9d5bb8025b1ac16a1a1d6b5eff0360bb3184e810d319e498255bf97 data/airdef/horizon/item/deploy_light.json
2a3912a7c9d5bb8025b1ac16a1a1d6b5eff0360bb3184e810d319e498255bf97 data/airdef/horizon/item/deploy_nasams.json
2a3912a7c9d5bb8025b1ac16a1a1d6b5eff0360bb3184e810d319e498255bf97 data/airdef/horizon/item/deploy_optical.json
2a3912a7c9d5bb8025b1ac16a1a1d6b5eff0360bb3184e810d319e498255bf97 data/airdef/horizon/item/deploy_p1sun.json
2a3912a7c9d5bb8025b1ac16a1a1d6b5eff0360bb3184e810d319e498255bf97 data/airdef/horizon/item/deploy_pantsir.json
2a3912a7c9d5bb8025b1ac16a1a1d6b5eff0360bb3184e810d319e498255bf97 data/airdef/horizon/item/deploy_patriot.json
2a3912a7c9d5bb8025b1ac16a1a1d6b5eff0360bb3184e810d319e498255bf97 data/airdef/horizon/item/deploy_radar.json
2a3912a7c9d5bb8025b1ac16a1a1d6b5eff0360bb3184e810d319e498255bf97 data/airdef/horizon/item/deploy_radar_height.json
2a3912a7c9d5bb8025b1ac16a1a1d6b5eff0360bb3184e810d319e498255bf97 data/airdef/horizon/item/deploy_radar_search.json
2a3912a7c9d5bb8025b1ac16a1a1d6b5eff0360bb3184e810d319e498255bf97 data/airdef/horizon/item/deploy_radar_track.json
2a3912a7c9d5bb8025b1ac16a1a1d6b5eff0360bb3184e810d319e498255bf97 data/airdef/horizon/item/deploy_s400.json
2a3912a7c9d5bb8025b1ac16a1a1d6b5eff0360bb3184e810d319e498255bf97 data/airdef/horizon/item/deploy_s500.json
2a3912a7c9d5bb8025b1ac16a1a1d6b5eff0360bb3184e810d319e498255bf97 data/airdef/horizon/item/deploy_tor.json
@@ -589,4 +622,4 @@ cc0877f40434365b45b03429222926aa0cf135e504017311be53263fd27c5f8f data/airdef/ho
2a3912a7c9d5bb8025b1ac16a1a1d6b5eff0360bb3184e810d319e498255bf97 data/airdef/horizon/item/launch_zircon.json
2a3912a7c9d5bb8025b1ac16a1a1d6b5eff0360bb3184e810d319e498255bf97 data/airdef/horizon/item/mover.json
2a3912a7c9d5bb8025b1ac16a1a1d6b5eff0360bb3184e810d319e498255bf97 data/airdef/horizon/item/remover.json
5e0c0090b5aaded5b86b245cb30bcd0cbaa82f632a362d490d79bcf2794e25fd src/sim/generated_bounds.rs
0ca03bd3e7d8c5ffe89c01c9637d672ebe4706ec993e59c373fed2e09ad540a2 src/sim/generated_bounds.rs
+26 -19
View File
@@ -209,26 +209,33 @@ fn post(uv: vec2<f32>, pixel: vec2<f32>) -> vec4<f32> {
let on_screen = radius / max(length(centre), 1.0);
let steps = i32(clamp(on_screen * 40.0, 6.0, 14.0));
let ds = (t1 - t0) / f32(steps);
for (var s = 0; s < steps; s++) {
if trans < 0.02 { break; }
let p = dir * (t0 + (f32(s) + 0.5) * ds);
let local = (p - centre) / radius;
let r = length(local);
let n = fbm(local * 2.4 + seed + vec3<f32>(0.0, -age * 0.06, age * 0.02));
let shape = smoothstep(1.0, 0.25, r + (n - 0.5) * 1.1);
if shape <= 0.0 { continue; }
let density = shape * (1.2 + n * 2.0) * fade;
let absorb = 1.0 - exp(-density * ds * 1.4 / max(radius * 0.25, 0.5));
// Hot inside, soot outside; smoke lit from above by the sky.
let core = heat * (1.0 - r) * (0.6 + n);
let smoke = vec3<f32>(0.10, 0.095, 0.09) * (0.5 + 0.8 * sun * (0.5 + local.y * 0.5));
let c = mix(smoke, fire(core * 1.6), clamp(core * 2.2, 0.0, 1.0));
lit += trans * absorb * c;
trans *= 1.0 - absorb;
// At zero fade every step's density is zero: absorb is 0, so the march adds no light and
// leaves the transmittance alone. Skip it (the HD smoke path fades out by k = 0.28) instead
// of sampling the noise and shading a volume that cannot be seen.
if fade > 0.0 {
for (var s = 0; s < steps; s++) {
if trans < 0.02 { break; }
let p = dir * (t0 + (f32(s) + 0.5) * ds);
let local = (p - centre) / radius;
let r = length(local);
let n = fbm(local * 2.4 + seed + vec3<f32>(0.0, -age * 0.06, age * 0.02));
let shape = smoothstep(1.0, 0.25, r + (n - 0.5) * 1.1);
if shape <= 0.0 { continue; }
let density = shape * (1.2 + n * 2.0) * fade;
let absorb = 1.0 - exp(-density * ds * 1.4 / max(radius * 0.25, 0.5));
// Hot inside, soot outside; smoke lit from above by the sky.
let core = heat * (1.0 - r) * (0.6 + n);
let smoke = vec3<f32>(0.10, 0.095, 0.09) * (0.5 + 0.8 * sun * (0.5 + local.y * 0.5));
let c = mix(smoke, fire(core * 1.6), clamp(core * 2.2, 0.0, 1.0));
lit += trans * absorb * c;
trans *= 1.0 - absorb;
}
}
// Light thrown round by the fire (zero once its heat is spent).
if heat > 0.0 {
let d = length(centre);
glow += vec3<f32>(1.0, 0.5, 0.15) * heat * heat * size * 0.05 / (1.0 + d * 0.03);
}
// Light thrown round by the fire.
let d = length(centre);
glow += vec3<f32>(1.0, 0.5, 0.15) * heat * heat * size * 0.05 / (1.0 + d * 0.03);
}
color = color * trans + lit;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+312
View File
@@ -0,0 +1,312 @@
//! Player-facing labels for battery configuration and status.
use crate::sim::battery::{BatteryStatus, RadarProfile, SamMode};
use crate::sim::{AmmoKind, Sam, SamKind, SupplyStatus, SupplySummary};
/// One profile's functions in a line the player can read.
pub fn radar_profile_line(profile: RadarProfile) -> String {
let channels = if profile.channels == 0 { "без каналов уточнения".to_string() } else { format!("каналы {}", profile.channels) };
format!(
"{} [{}]: {}, оборот {:.1} с, {}, локальный поиск {}; развёртывание: {}",
profile.name,
profile.id,
profile.products_text(),
profile.cycle as f64 / 20.0,
channels,
if profile.local >= 1.0 { "во всей дальности".to_string() } else { format!("{:.0}% дальности", profile.local * 100.0) },
profile.deployment,
)
}
pub fn status(status: BatteryStatus) -> String {
match status {
BatteryStatus::Radar { index, role, emitting, operational } => {
let profile = role.profile();
format!(
"№{} РЛС: {}; излучение {}, {}",
index + 1,
radar_profile_line(profile),
if emitting { "вкл" } else { "выкл" },
if operational { "работает" } else { "нет связи или РЛС не работает" }
)
}
BatteryStatus::Launcher { index, kind, mode, linked } => format!(
"№{} {}: {}{}", index + 1, kind.name(), mode.key(),
if mode == SamMode::LauncherOnly {
if linked { ", РЛС связана" } else { ", нет связанной РЛС сопровождения" }
} else { "" }
),
}
}
/// One system's line in the summary panel and on the map.
pub fn sam_status(sam: &Sam, now: u64) -> String {
let spec = sam.kind.spec();
let mut text = spec.name.to_string();
if !sam.alive() {
return text + " УНИЧТОЖЕН";
}
if sam.moving() {
return text + " " + &sam.state.name().to_lowercase();
}
match sam.kind {
SamKind::Depot => {
let kinds = sam.ammo_stock.non_zero().count();
return format!("{text}: {} БК ({} видов), RM48U {}, снятых ПВО {}", sam.ammo_stock.total(), kinds, sam.ground_stock, sam.air_48n6_stock);
}
SamKind::Tzm => {
let carried: Vec<_> = sam.ammo_stock.non_zero().map(|(k, n)| format!("{}×{n}", k.short_name())).collect();
let cargo_detail = if carried.is_empty() { String::new() } else { format!(" ({})", carried.join(", ")) };
return format!(
"{text}: на борту {}/{}{cargo_detail}, RM48U {}, снятых ПВО {}{}",
sam.ammo_stock.total(),
crate::sim::TRUCK_CAPACITY,
sam.ground_stock,
sam.air_48n6_stock,
if sam.return_cargo { ", везёт RM48U на склад" } else if sam.job().is_some() { ", в пути" } else { "" }
);
}
SamKind::Ew => {
let state = if sam.ew_on { "ГЛУШИТ" } else if sam.ew_lock { "остывает" } else { "готова" };
return format!("{text}: {state}, нагрев {:.0}%", sam.heat * 100.0);
}
SamKind::Radar => {
let broken = if sam.comps.whole() { String::new() } else { format!(" [{}]", crate::why_view::worst(&sam.comps, sam.kind)) };
let profile = sam.radar_profile();
let channels = if profile.channels == 0 {
"без уточнения".to_string()
} else {
format!("каналы {}/{}", sam.own_channels_used(now), profile.channels)
};
return format!("{text} «{}»: {}; целей {}{broken}, {channels}", profile.name, profile.products_text(), sam.own.len());
}
SamKind::Light => return format!("{text}{}", if sam.target.is_some() { ": в луче цель" } else { "" }),
SamKind::Optical => {
let mut t = format!("{text}: {}", sam.optical.status_text());
if sam.health < 1.0 {
t += &format!(" ({:.0}%)", sam.health * 100.0);
}
if !sam.comps.whole() {
t += &format!(" [{}]", crate::why_view::worst(&sam.comps, sam.kind));
}
return t;
}
_ => {}
}
if let Some(cell) = sam.preparing_cell() {
text += &format!(" · открытие ТПК №{}", cell + 1);
}
if sam.empty && sam.missiles == 0 {
text += " ЖДЁТ БК";
}
if sam.health < 1.0 {
text += &format!(" ({:.0}%)", sam.health * 100.0);
}
if !sam.comps.whole() {
text += &format!(" [{}]", crate::why_view::worst(&sam.comps, sam.kind));
}
if sam.reloading > 0 {
text += &format!(" перезарядка {}с", sam.reloading.div_ceil(20));
} else {
if let Some(magazine) = sam.kind.missile_magazine() {
if sam.kind.supports_rm48u() {
text += &format!(" ПВО {} · RM48U {} / {} ячеек", sam.missiles, sam.ground_rounds, sam.cells());
if sam.ground_return { text += " · ожидает вывоза RM48U"; }
} else {
text += &format!(" ракеты {}/{}", sam.missiles, magazine);
}
}
if sam.kind.has_gun() {
text += &format!(" очереди {}", sam.bursts);
}
}
text
}
/// Human-readable resupply / reload reason for one unit card or status command.
pub fn supply_line(status: &SupplyStatus) -> String {
match status {
SupplyStatus::Reloading { ticks_left } => format!("Перезарядка: {} с", ticks_left.div_ceil(20)),
SupplyStatus::TruckEnRoute { truck_num, eta_ticks, rm48u: true, returning: true, .. } => {
format!("ТЗМ №{truck_num} едет забрать RM48U (~{} с)", eta_ticks.div_ceil(20))
}
SupplyStatus::TruckEnRoute { truck_num, eta_ticks, rm48u: true, returning: false, .. } => {
format!("ТЗМ №{truck_num} везёт RM48U (~{} с)", eta_ticks.div_ceil(20))
}
SupplyStatus::TruckEnRoute { truck_num, eta_ticks, rm48u: false, .. } => {
format!("ТЗМ №{truck_num} везёт БК (~{} с)", eta_ticks.div_ceil(20))
}
SupplyStatus::TruckFetching { truck_num, depot_num, eta_ticks, rm48u: true, .. } => {
format!("ТЗМ №{truck_num} едет на склад №{depot_num} за RM48U (~{} с)", eta_ticks.div_ceil(20))
}
SupplyStatus::TruckFetching { truck_num, depot_num, eta_ticks, rm48u: false, .. } => {
format!("ТЗМ №{truck_num} едет на склад №{depot_num} за БК (~{} с)", eta_ticks.div_ceil(20))
}
SupplyStatus::NoRm48uStock => "Ждёт RM48U: на складах и в ТЗМ нет ударных ракет".to_string(),
SupplyStatus::OutOfStock { missing } => {
let names: Vec<_> = missing.into_iter().flatten().map(|k| k.short_name()).collect();
format!("Ждёт БК ({}): нет на складах и в ТЗМ", names.join(", "))
}
SupplyStatus::NoTruck { rm48u } => {
format!("Ждёт {}: нет исправной ТЗМ", if *rm48u { "RM48U" } else { "БК" })
}
SupplyStatus::RouteBlocked { rm48u } => {
format!("Ждёт {}: ТЗМ не может проехать", if *rm48u { "RM48U" } else { "БК" })
}
SupplyStatus::WaitingForTruck { rm48u: true, returning: true } => "Ожидает свободную ТЗМ для вывоза RM48U".to_string(),
SupplyStatus::WaitingForTruck { rm48u: true, returning: false } => "Ожидает свободную ТЗМ для доставки RM48U".to_string(),
SupplyStatus::WaitingForTruck { rm48u: false, .. } => "Ожидает свободную ТЗМ".to_string(),
}
}
/// Multi-line aggregate summary of depot & truck stocks for `/airdef stocks`.
pub fn stock_summary_lines(summary: &SupplySummary) -> Vec<String> {
let mut lines = vec![
format!(
"Склады: {} · ТЗМ: {} (занято {}) · ждут БК: {}, RM48U: {}, перезарядка: {}",
summary.depots_alive, summary.trucks_alive, summary.trucks_busy, summary.waiting_ammo, summary.waiting_rm48u, summary.reloading
),
format!(
"RM48U: на складах {}, в ТЗМ {}, в ПУ {}",
summary.rm48u_depot, summary.rm48u_truck, summary.rm48u_loaded
),
];
let entries: Vec<String> = AmmoKind::ALL
.into_iter()
.filter_map(|k| {
let d = summary.depot_ammo[k.index()];
let t = summary.truck_ammo[k.index()];
(d + t > 0).then(|| format!("{} {} ({}+{})", k.short_name(), d + t, d, t))
})
.collect();
if entries.is_empty() {
lines.push("БК ПВО на складах и в ТЗМ исчерпан".to_string());
} else {
for chunk in entries.chunks(3) {
lines.push(chunk.join(" · "));
}
}
lines
}
#[cfg(test)]
mod tests {
use super::*;
use crate::sim::battery::RadarRole;
use crate::sim::{Part, Sam, SamKind, SamState};
use glam::DVec3;
#[test]
fn renders_system_status_in_existing_format() {
let mut s400 = Sam::new(1, SamKind::S400, DVec3::ZERO, 0.0);
s400.missiles = 1;
s400.ground_rounds = 2;
assert_eq!(sam_status(&s400, 0), "С-400 ПВО 1 · RM48U 2 / 4 ячеек");
s400.ground_return = true;
assert_eq!(sam_status(&s400, 0), "С-400 ПВО 1 · RM48U 2 / 4 ячеек · ожидает вывоза RM48U");
let mut pantsir = Sam::new(2, SamKind::Pantsir, DVec3::ZERO, 0.0);
pantsir.missiles = 7;
pantsir.bursts = 100;
assert_eq!(sam_status(&pantsir, 0), "Панцирь-С1 ракеты 7/12 очереди 100");
let mut worn = Sam::new(3, SamKind::Patriot, DVec3::ZERO, 0.0);
worn.health = 0.5;
worn.comps.0[Part::Sensor as usize] = 0.4;
worn.reloading = 21;
assert_eq!(sam_status(&worn, 0), "Patriot (50%) [РЛС 40%] перезарядка 2с");
}
#[test]
fn renders_special_system_lines_in_existing_format() {
let mut radar = Sam::new(4, SamKind::Radar, DVec3::ZERO, 0.0);
radar.own.push(7);
radar.comps.0[Part::Sensor as usize] = 0.0;
assert_eq!(sam_status(&radar, 0), "РЛС дальнего обнаружения «многофункциональная»: обзор, уточнение, пуск; целей 1 [РЛС отказ], каналы 0/3");
let mut depot = Sam::new(5, SamKind::Depot, DVec3::ZERO, 0.0);
depot.clear_ammo();
depot.set_ammo(crate::sim::AmmoKind::S400Missile, 2);
depot.ground_stock = 3;
depot.air_48n6_stock = 1;
assert_eq!(sam_status(&depot, 0), "Склад боеприпасов: 2 БК (1 видов), RM48U 3, снятых ПВО 1");
let mut tzm = Sam::new(6, SamKind::Tzm, DVec3::ZERO, 0.0);
tzm.set_ammo(crate::sim::AmmoKind::TorMissile, 1);
tzm.return_cargo = true;
assert_eq!(sam_status(&tzm, 0), "ТЗМ: на борту 1/2 (Тор×1), RM48U 0, снятых ПВО 0, везёт RM48U на склад");
let mut ew = Sam::new(7, SamKind::Ew, DVec3::ZERO, 0.0);
ew.ew_on = true;
ew.heat = 0.5;
assert_eq!(sam_status(&ew, 0), "Станция РЭБ: ГЛУШИТ, нагрев 50%");
let mut light = Sam::new(8, SamKind::Light, DVec3::ZERO, 0.0);
light.target = Some(1);
assert_eq!(sam_status(&light, 0), "Прожектор: в луче цель");
let optical = Sam::new(9, SamKind::Optical, DVec3::ZERO, 0.0);
assert_eq!(sam_status(&optical, 0), "Оптический пост: ищет");
}
#[test]
fn renders_moving_and_destroyed_systems_in_existing_format() {
let mut moving = Sam::new(9, SamKind::S400, DVec3::ZERO, 0.0);
moving.state = SamState::Moving;
assert_eq!(sam_status(&moving, 0), "С-400 на марше");
let mut dead = Sam::new(10, SamKind::S400, DVec3::ZERO, 0.0);
dead.health = 0.0;
assert_eq!(sam_status(&dead, 0), "С-400 УНИЧТОЖЕН");
}
#[test]
fn profiles_explain_their_different_functions() {
for role in [RadarRole::Search, RadarRole::Height, RadarRole::Engagement, RadarRole::Multifunction] {
let text = radar_profile_line(role.profile());
assert!(text.contains(role.profile().id));
assert!(text.contains(&format!("оборот {:.1} с", role.profile().cycle as f64 / 20.0)));
}
assert!(radar_profile_line(RadarRole::Search.profile()).contains("без каналов"));
assert!(radar_profile_line(RadarRole::Engagement.profile()).contains("каналы 2"));
assert!(radar_profile_line(RadarRole::Height.profile()).contains("уточнение"));
}
#[test]
fn renders_battery_status_in_existing_format() {
assert_eq!(
status(BatteryStatus::Radar { index: 0, role: RadarRole::Search, emitting: false, operational: false }),
"№1 РЛС: дальнего обзора [radar_search]: обзор, оборот 8.5 с, без каналов уточнения, локальный поиск во всей дальности; развёртывание: крупная стационарная антенна; излучение выкл, нет связи или РЛС не работает"
);
assert_eq!(
status(BatteryStatus::Radar { index: 1, role: RadarRole::Engagement, emitting: true, operational: true }),
"№2 РЛС: сопровождения [radar_track]: обзор, уточнение, пуск, оборот 3.5 с, каналы 2, локальный поиск 12% дальности; развёртывание: мобильная панель; излучение вкл, работает"
);
assert_eq!(status(BatteryStatus::Launcher { index: 2, kind: SamKind::S400, mode: SamMode::LauncherOnly, linked: true }), "№3 С-400: launcher, РЛС связана");
assert_eq!(status(BatteryStatus::Launcher { index: 3, kind: SamKind::S500, mode: SamMode::LauncherOnly, linked: false }), "№4 С-500: launcher, нет связанной РЛС сопровождения");
assert_eq!(status(BatteryStatus::Launcher { index: 4, kind: SamKind::S400, mode: SamMode::Integrated, linked: false }), "№5 С-400: integrated");
}
#[test]
fn formats_supply_status_and_stock_summary() {
assert_eq!(supply_line(&SupplyStatus::Reloading { ticks_left: 41 }), "Перезарядка: 3 с");
assert_eq!(
supply_line(&SupplyStatus::TruckEnRoute { truck_num: 2, truck_id: 9, eta_ticks: 100, rm48u: false, returning: false }),
"ТЗМ №2 везёт БК (~5 с)"
);
assert_eq!(
supply_line(&SupplyStatus::TruckFetching { truck_num: 1, truck_id: 8, depot_num: 3, eta_ticks: 240, rm48u: true }),
"ТЗМ №1 едет на склад №3 за RM48U (~12 с)"
);
assert_eq!(
supply_line(&SupplyStatus::OutOfStock { missing: [Some(AmmoKind::PantsirMissile), Some(AmmoKind::PantsirGun)] }),
"Ждёт БК (Панцирь рак, Панцирь пуш): нет на складах и в ТЗМ"
);
let mut sum = SupplySummary { depots_alive: 1, trucks_alive: 1, trucks_busy: 1, waiting_ammo: 1, waiting_rm48u: 0, reloading: 0, rm48u_depot: 2, rm48u_truck: 1, rm48u_loaded: 1, ..Default::default() };
sum.depot_ammo[AmmoKind::S400Missile.index()] = 4;
sum.truck_ammo[AmmoKind::S400Missile.index()] = 1;
let lines = stock_summary_lines(&sum);
assert!(lines[0].contains("Склады: 1 · ТЗМ: 1 (занято 1)"));
assert!(lines[1].contains("RM48U: на складах 2, в ТЗМ 1, в ПУ 1"));
assert!(lines[2].contains("С-400 5 (4+1)"));
}
}
+245
View File
@@ -0,0 +1,245 @@
//! Host milestones, not promises of audible output or completed GPU/file work.
use horizon_mod_sdk::render::{self, CapabilityReason, CapabilityState};
pub fn ready(s: &CapabilityState) -> bool {
s.generation != 0
&& s.available
&& s.enabled
&& s.request_accepted
&& s.prepared
&& s.reason == CapabilityReason::Ready
}
pub fn capture_problem(s: &CapabilityState) -> Option<&'static str> {
if !s.available {
Some("Движок не поддерживает подтверждение захвата")
} else if !s.enabled || s.generation == 0 {
Some("Захват недоступен без текущего мира")
} else if !s.request_accepted {
Some("Захват больше не принадлежит этой сессии мода")
} else if s.reason == CapabilityReason::Failed {
Some("Ошибка пути захвата движка")
} else {
None
}
}
/// Adopt the existing global preference once in this world, without switching it.
/// A configured request and actual backend preparation are still separate milestones.
pub fn acoustics() -> CapabilityState {
let s = render::acoustics_status();
if s.available && s.generation != 0 && !s.request_accepted {
render::set_acoustics(s.enabled);
render::acoustics_status()
} else {
s
}
}
fn reason(r: CapabilityReason) -> &'static str {
match r {
CapabilityReason::AwaitingWorld => "awaiting-world",
CapabilityReason::Disabled => "disabled",
CapabilityReason::NotRequested => "not-requested",
CapabilityReason::AwaitingBackend => "awaiting-backend",
CapabilityReason::Failed => "failed",
CapabilityReason::Ready => "ready",
}
}
fn line(
name: &str,
generation: u64,
available: bool,
enabled: bool,
accepted: bool,
prepared: bool,
why: &str,
) -> String {
format!("{name}: API={available}, включено={enabled}, запрос={accepted}, подготовлено={prepared}, поколение={generation}, {why}")
}
fn camera_line(s: &render::CameraState) -> String {
let cameras: Vec<String> = s
.cameras
.iter()
.map(|c| {
let why = match c.reason {
render::CameraReason::AwaitingFrame => "awaiting-frame",
render::CameraReason::Ready => "ready",
};
format!("{}:{}", c.id, why)
})
.collect();
let main = match s.main_view {
Some(id) => id.to_string(),
None => "нет".into(),
};
format!(
"Камеры: API={}, включено={}, запрос={}, подготовлено={}, поколение={}, {}, main={}, [{}]",
s.available,
s.enabled,
s.request_accepted,
s.prepared,
s.generation,
reason(s.reason),
main,
cameras.join("; ")
)
}
pub fn diagnostics() -> String {
let smoke = render::smoke_status();
let acoustic = acoustics();
let capture = render::capture_owner_status();
let lights = render::point_lights_status();
let sources = render::sound_sources_status();
let cameras = render::camera_status();
let dlss = render::dlss_status();
let smoke_reason = match smoke.reason {
render::SmokeReason::AwaitingFrame => "awaiting-frame",
render::SmokeReason::Disabled => "disabled",
render::SmokeReason::PathUnavailable => "path-unavailable",
render::SmokeReason::Ready => "ready",
};
[
"Возможности движка (API 33; подготовка не означает готовый GPU-кадр, слышимый звук или файл):".into(),
line(
"Дым",
smoke.generation,
smoke.available,
smoke.enabled,
smoke.request_accepted,
smoke.backend_ready,
smoke_reason,
),
line(
"Акустика",
acoustic.generation,
acoustic.available,
acoustic.enabled,
acoustic.request_accepted,
acoustic.prepared,
reason(acoustic.reason),
),
line(
"Точечный свет",
lights.generation,
lights.available,
lights.enabled,
lights.request_accepted,
lights.prepared,
reason(lights.reason),
),
line(
"Постоянные звуки",
sources.generation,
sources.available,
sources.enabled,
sources.request_accepted,
sources.prepared,
reason(sources.reason),
),
camera_line(&cameras),
line(
"Захват этого мода",
capture.generation,
capture.available,
capture.enabled,
capture.request_accepted,
capture.prepared,
reason(capture.reason),
),
format!(
"DLSS: устройство={}, включено={} (выкл — родной TAAU; вкл без устройства — при следующем запуске)",
dlss.available, dlss.enabled
),
]
.join("\n")
}
#[cfg(test)]
mod tests {
use super::*;
fn state() -> CapabilityState {
CapabilityState {
generation: 5,
available: true,
enabled: true,
request_accepted: true,
prepared: true,
reason: CapabilityReason::Ready,
}
}
#[test]
fn acceptance_alone_never_disables_the_working_fallback() {
assert!(ready(&state()));
for missing in 0..6 {
let mut s = state();
match missing {
0 => s.generation = 0,
1 => s.available = false,
2 => s.enabled = false,
3 => s.request_accepted = false,
4 => s.prepared = false,
_ => s.reason = CapabilityReason::AwaitingBackend,
}
assert!(!ready(&s));
}
}
#[test]
fn a_foreign_capture_is_not_success_and_preparing_is_not_failure() {
let mut s = state();
s.request_accepted = false;
assert!(capture_problem(&s).is_some());
s = state();
s.prepared = false;
s.reason = CapabilityReason::AwaitingBackend;
assert!(capture_problem(&s).is_none());
assert!(!ready(&s));
s.reason = CapabilityReason::Failed;
assert!(capture_problem(&s).is_some());
}
fn camera(id: u32, prepared: bool) -> render::CameraReadiness {
render::CameraReadiness {
id,
request_accepted: true,
prepared,
reason: if prepared {
render::CameraReason::Ready
} else {
render::CameraReason::AwaitingFrame
},
}
}
#[test]
fn the_camera_line_separates_readiness_from_the_screens_selection() {
let line = camera_line(&render::CameraState {
generation: 5,
available: true,
enabled: true,
request_accepted: true,
prepared: true,
reason: CapabilityReason::Ready,
cameras: vec![camera(7, true), camera(8, false)],
main_view: Some(7),
});
assert_eq!(
line,
"Камеры: API=true, включено=true, запрос=true, подготовлено=true, поколение=5, \
ready, main=7, [7:ready; 8:awaiting-frame]"
);
// No accepted submission: no cameras, no main view, and the reason says so.
let line = camera_line(&render::CameraState {
generation: 5,
available: true,
enabled: false,
request_accepted: false,
prepared: false,
reason: CapabilityReason::NotRequested,
cameras: Vec::new(),
main_view: None,
});
assert!(line.ends_with("not-requested, main=нет, []"), "{line}");
}
}
+14 -12
View File
@@ -2,15 +2,17 @@
//! tail; from afar the muffled report and a late boom), and the camera's reaction (a brief
//! exposure and bloom punch). Everything is a function of the blast, its distance and its age, so
//! a replay hears and sees the same as the live raid did, from the replay's camera.
use crate::sim::catalog::sound;
/// The power (0 air burst .. 4 ballistic) of a blast sound event, if it is one.
pub fn blast_power(event: &str) -> Option<usize> {
Some(match event {
"airdef:blast.air" => 0,
"airdef:blast.medium" => 1,
"airdef:blast.big" => 2,
"airdef:blast.heavy" => 3,
"airdef:blast.huge" => 4,
sound::BLAST_AIR => 0,
sound::BLAST_MEDIUM => 1,
sound::BLAST_BIG => 2,
sound::BLAST_HEAVY => 3,
sound::BLAST_HUGE => 4,
_ => return None,
})
}
@@ -34,7 +36,7 @@ pub const FULL: usize = 3;
/// nearest of its tick.
pub fn layers(power: usize, dist: f64, far: f64, gain: f32, pitch: f32, rank: usize) -> Vec<Layer> {
let g = gain.clamp(0.3, 2.0);
let own = ["airdef:blast.air", "airdef:blast.medium", "airdef:blast.big", "airdef:blast.heavy", "airdef:blast.huge"][power.min(4)];
let own = [sound::BLAST_AIR, sound::BLAST_MEDIUM, sound::BLAST_BIG, sound::BLAST_HEAVY, sound::BLAST_HUGE][power.min(4)];
let layer = |name: &str, volume: f32, pitch: f32, delay: u64| Layer { name: name.to_string(), volume, pitch, delay };
let far_away = dist > far;
let suffix = if far_away { "_far" } else { "" };
@@ -45,22 +47,22 @@ pub fn layers(power: usize, dist: f64, far: f64, gain: f32, pitch: f32, rank: us
// The muffled report, then a deep boom that arrives late.
return vec![
layer(&format!("{own}_far"), g, pitch, 0),
layer("airdef:blast.big_far", 0.7 * g, pitch * 0.6, 10 + 2 * power as u64),
layer(sound::BLAST_BIG_FAR, 0.7 * g, pitch * 0.6, 10 + 2 * power as u64),
];
}
let tail = (0.45 + 0.08 * power as f32) * g;
if power == 0 {
// An air burst has no body of its own: the crack, the thump, the roll.
vec![
layer("airdef:blast.air", g, pitch * 1.12, 0),
layer("airdef:blast.big", 0.85 * g, pitch * 0.66, 2),
layer("airdef:blast.huge", tail, pitch * 0.5, 7),
layer(sound::BLAST_AIR, g, pitch * 1.12, 0),
layer(sound::BLAST_BIG, 0.85 * g, pitch * 0.66, 2),
layer(sound::BLAST_HUGE, tail, pitch * 0.5, 7),
]
} else {
vec![
layer(own, g, pitch, 0),
layer("airdef:blast.air", 0.7 * g, pitch * 1.15, 0),
layer("airdef:blast.huge", tail, pitch * 0.5, 7),
layer(sound::BLAST_AIR, 0.7 * g, pitch * 1.15, 0),
layer(sound::BLAST_HUGE, tail, pitch * 0.5, 7),
]
}
}
+51 -11
View File
@@ -14,11 +14,12 @@ fn on_off() -> Value {
/// `/airdef ...` as `lib.rs` accepts it.
pub fn tree() -> Tree {
let wave_kinds: Vec<&str> = DroneKind::ALL.iter().map(|k| k.spec().key).chain(["mix"]).collect();
let deploy_kinds: Vec<&str> = SamKind::ALL.iter().map(|k| k.key()).chain(["s400_launcher", "s500_launcher", "radar_search", "radar_track", "radar_height"]).collect();
let deploy_kinds: Vec<&str> = SamKind::ALL.iter().map(|k| k.key()).chain(crate::sim::catalog::VARIANTS.iter().map(|v| v.id)).collect();
let armed: Vec<&str> = SamKind::ARMED.iter().map(|k| k.key()).chain(["all"]).collect();
let toggle = |word: &str| Node::lit(word).then(Node::arg("on/off", on_off()).runs());
Tree::new("airdef").runs().with([
Node::lit("menu").runs(),
Node::lit("capabilities").runs(),
Node::lit("monitor").runs(),
Node::lit("grid").runs(),
Node::lit("replay").runs().with([
@@ -55,11 +56,20 @@ pub fn tree() -> Tree {
),
Node::lit("list").runs(),
Node::lit("delete").then(Node::arg("имя", Value::names(SCENARIOS)).runs()),
Node::lit("village").runs().then(
Node::arg("режим", Value::choice(["easy", "normal", "hard", "start", "status", "prices", "stop"])).runs(),
),
]),
Node::lit("why").runs().then(Node::arg("номер", Value::int_from(1)).runs()),
Node::lit("breaches").runs().then(Node::arg("страница", Value::int_from(1)).runs()),
Node::lit("why").runs().then(
Node::arg("номер", Value::int_from(1)).runs().then(Node::lit("source").runs()),
),
Node::lit("chains").runs().then(Node::arg("батарея", Value::int_from(1)).runs()),
Node::lit("raid").runs(),
Node::lit("sites").runs(),
Node::lit("stocks").runs(),
Node::lit("ground-stock").then(Node::arg("склад", Value::int_from(1)).then(Node::arg("количество", Value::int_from(0)).runs())),
Node::lit("ground-cancel").then(Node::arg("комплекс", Value::int_from(1)).runs()),
Node::lit("ground-unload").then(Node::arg("комплекс", Value::int_from(1)).runs()),
Node::lit("ground-load").then(Node::arg("комплекс", Value::int_from(1)).runs()),
Node::lit("strike").then(Node::arg("номер", Value::int_from(1)).runs()),
@@ -71,7 +81,7 @@ pub fn tree() -> Tree {
Node::lit("target").then(Node::lit("here").runs()),
Node::lit("give").runs(),
Node::lit("battery").runs().then(Node::arg("номер", Value::int_from(1)).then(Node::arg("режим", Value::choice(["integrated", "launcher"])).runs())),
Node::lit("radar").then(Node::arg("номер", Value::int_from(1)).then(Node::arg("роль", Value::choice(["multi", "search", "engagement", "height"])).runs())),
Node::lit("radar").then(Node::arg("номер", Value::int_from(1)).then(Node::arg("режим", Value::Word(vec!["on".into(), "off".into()])).runs())),
Node::lit("deploy").then(Node::arg("комплекс", Value::choice(deploy_kinds)).runs()),
Node::lit("wave").then(
Node::arg("тип", Value::choice(wave_kinds)).runs().then(
@@ -85,6 +95,7 @@ pub fn tree() -> Tree {
Node::lit("shader").then(Node::arg("режим", Value::choice(["on", "off", "hd"])).runs()),
toggle("hold"),
toggle("lastchance"),
toggle("autostrike"),
Node::lit("roles").runs().then(
Node::arg("комплекс", Value::choice(armed)).then(
Node::arg(
@@ -104,6 +115,21 @@ pub fn tree() -> Tree {
Node::lit("guard").with([Node::lit("off").runs(), Node::arg("объекты", Value::word()).runs()]),
Node::lit("reset").runs(),
])),
Node::lit("recon").runs(),
Node::lit("post").runs().then(Node::arg("поиск", Value::word()).runs()),
Node::lit("panel").with([
Node::lit("snapshot").then(Node::arg("запрос", Value::word()).then(
Node::arg("ракурс", Value::choice(["public", "debug"])).then(Node::arg("позиция", Value::word()).runs())
)),
Node::lit("launch").then(Node::arg("запрос", Value::word()).then(
Node::arg("сессия", Value::word()).then(Node::arg("сценарий", Value::word()).runs())
)),
Node::lit("action").then(Node::arg("запрос", Value::word()).then(
Node::arg("сессия", Value::word()).then(Node::arg("действие", Value::choice(["autostrike", "strike"])).then(
Node::arg("значение", Value::word()).runs()
))
)),
]),
Node::lit("stats").runs(),
])
}
@@ -160,14 +186,15 @@ mod tests {
#[test]
fn every_branch_of_the_handler_parses() {
for line in [
"", "menu", "monitor", "grid", "give", "raid", "repair", "import", "flare", "clear", "stats", "roles",
"", "menu", "capabilities", "monitor", "grid", "post", "post Панцирь", "post 82", "give", "raid", "repair", "import", "flare", "clear", "stats", "recon", "roles",
"replay", "replay map", "replay full", "replay reel", "replay film", "replay film best", "replay film all",
"replay film 3", "replay export", "replay export mine", "replay export best", "replay export all", "replay export 3",
"replay export mine all fps=30 size=1280x720 crf=18 sec=12.5 noaudio", "replay export fps=60", "replay stop",
"scenario save a", "scenario save a fresh", "scenario load a", "scenario load a force", "scenario list",
"scenario delete a", "why", "why 2", "ew on", "ew off", "move 4", "target here", "targets clear",
"sites", "strike 3", "battery", "battery 1 launcher", "battery 1 integrated", "radar 2 engagement", "radar 2 search", "deploy s400_launcher", "deploy s500_launcher", "deploy radar_search", "deploy radar_track", "deploy radar_height", "deploy patriot", "deploy light", "deploy s400", "wave mix", "wave shahed", "wave shahed 20", "wave kh101 80 800", "wave shahed 20 4000",
"wave oreshnik 1 60", "damage on", "damage off", "truth on", "shader hd", "shader off", "shader on", "hold on", "lastchance on", "lastchance off",
"scenario delete a", "scenario village", "scenario village hard", "scenario village start",
"breaches", "breaches 2", "why", "why 2", "why 2 source", "chains", "chains 2", "ew on", "ew off", "move 4", "target here", "targets clear",
"sites", "strike 3", "battery", "battery 1 launcher", "battery 1 integrated", "radar 2 on", "radar 2 off", "radar 2 engagement", "radar 2 search", "deploy radar_search", "deploy radar_track", "deploy radar_height", "deploy patriot", "deploy light", "deploy s400", "wave mix", "wave shahed", "wave shahed 20", "wave kh101 80 800", "wave shahed 20 4000",
"wave oreshnik 1 60", "damage on", "damage off", "truth on", "shader hd", "shader off", "shader on", "hold on", "lastchance on", "lastchance off", "autostrike on", "autostrike off",
"roles all default", "doctrine", "doctrine 1 reserve 4", "doctrine all salvo eco", "doctrine 2 sector 90 45", "doctrine 2 sector off", "doctrine 1 guard 1,2", "doctrine 1 reset", "roles patriot drone,jet", "roles pantsir all", "roles tor ballistic",
] {
ok(line);
@@ -239,14 +266,15 @@ mod tests {
fn completion_offers_the_next_word_only() {
let top = complete("", &[]);
for w in ["menu", "monitor", "grid", "replay", "scenario", "why", "raid", "repair", "import", "ew", "flare", "move",
"target", "give", "deploy", "wave", "clear", "targets", "damage", "truth", "shader", "hold", "lastchance", "roles", "doctrine", "stats", "sites", "strike", "ground-stock", "ground-load", "ground-unload"] {
"target", "give", "deploy", "wave", "clear", "targets", "damage", "truth", "shader", "hold", "lastchance", "autostrike", "roles", "doctrine", "stats", "recon", "sites", "stocks", "strike", "ground-stock", "ground-load", "ground-unload", "ground-cancel", "chains"] {
assert!(top.contains(&w.to_string()), "{w} in {top:?}");
}
assert_eq!(top.len(), 33);
assert!(top.contains(&"post".to_string()));
assert_eq!(top.len(), 42);
assert_eq!(complete("rep", &[]), ["repair", "replay"]);
assert_eq!(complete("replay ", &[]), ["export", "film", "full", "map", "reel", "stop"]);
assert_eq!(complete("replay film ", &[]), ["all", "best"]);
assert_eq!(complete("scenario ", &[]), ["delete", "list", "load", "save"]);
assert_eq!(complete("scenario ", &[]), ["delete", "list", "load", "save", "village"]);
assert_eq!(complete("wave ", &[]).len(), 14);
assert!(complete("wave s", &[]).contains(&"shahed".to_string()));
assert_eq!(complete("shader ", &[]), ["hd", "off", "on"]);
@@ -256,6 +284,18 @@ mod tests {
assert!(complete("wave nothing ", &[]).is_empty());
}
/// A station's profile is fixed at deployment: completion offers only emission, while an
/// old role word still reaches the handler's explanation instead of a bare parse error.
#[test]
fn radar_completion_offers_emission_only() {
let words = complete("radar 1 ", &[]);
assert_eq!(words.len(), 2, "{words:?}");
assert!(words.contains(&"on".to_string()) && words.contains(&"off".to_string()));
for old in ["multi", "search", "engagement", "height"] {
assert!(tree().parse(&format!("radar 1 {old}")).is_ok(), "`{old}` should reach the handler");
}
}
/// The names follow the data: after a save the new name is offered, after a delete it is gone.
#[test]
fn scenario_names_follow_a_save_and_a_delete() {
@@ -278,7 +318,7 @@ mod tests {
#[test]
fn the_help_line_is_the_trees() {
let help = help();
assert!(help.starts_with("/airdef menu | monitor | grid | replay "), "{help}");
assert!(help.starts_with("/airdef menu | capabilities | monitor | grid | replay "), "{help}");
assert!(help.contains("scenario save <имя> [fresh]"), "{help}");
assert!(help.contains("wave <тип> [<кол-во> [<дальность>]]"), "{help}");
assert!(help.ends_with("| stats"), "{help}");
+23 -6
View File
@@ -9,6 +9,8 @@
//! for a tick or two (a step the simulation skipped) does not stop the sound; a *cut* (a replay
//! seek, a new shot) stops every engine and starts them again under new ids, so nothing glides
//! across the jump.
use crate::sim::catalog::sound;
use glam::DVec3;
use std::collections::{BTreeMap, BTreeSet};
@@ -52,12 +54,12 @@ pub enum Op {
/// engine_sounds_has_no_hole` finds them (after the fade-in, before the sound begins to die).
pub fn steady_part(event: &str) -> (f32, f32) {
match event {
"airdef:drone.shahed" => (0.2, 2.2),
"airdef:drone.geran3" => (0.2, 2.0),
"airdef:drone.lancet" => (0.2, 1.4),
"airdef:drone.cruise" => (0.2, 2.6),
"airdef:drone.rocket" => (0.2, 2.6),
"airdef:missile.flight" => (0.2, 2.2),
sound::DRONE_SHAHED => (0.2, 2.2),
sound::DRONE_GERAN3 => (0.2, 2.0),
sound::DRONE_LANCET => (0.2, 1.4),
sound::DRONE_CRUISE => (0.2, 2.6),
sound::DRONE_ROCKET => (0.2, 2.6),
sound::MISSILE_FLIGHT => (0.2, 2.2),
_ => (0.0, 0.0),
}
}
@@ -82,6 +84,12 @@ impl Engines {
self.live.is_empty()
}
/// An explicitly unpowered entity releases its source without waiting for the missing-frame grace.
pub fn stop(&mut self, key: u32) -> Option<Op> {
self.dead.remove(&key);
self.live.remove(&key).map(|live| Op::Stop(live.id))
}
/// The game released every source: forget them (nothing to stop).
pub fn reset(&mut self) {
self.live.clear();
@@ -197,6 +205,15 @@ mod tests {
damaged: false,
}
}
#[test]
fn explicit_burnout_releases_the_source_immediately() {
let mut engines = Engines::default();
let ops = engines.step(vec![d(42, 0.0)], false, DVec3::ZERO);
assert!(matches!(ops.as_slice(), [Op::Start(_, _)]));
assert!(matches!(engines.stop(42), Some(Op::Stop(_))));
assert!(engines.is_empty());
assert!(engines.stop(42).is_none());
}
fn starts(ops: &[Op]) -> usize {
ops.iter().filter(|o| matches!(o, Op::Start(..))).count()
}
+229
View File
@@ -0,0 +1,229 @@
//! Picking nearby AirDef models against the same block ray the client uses for its crosshair.
use crate::sim::Model;
use glam::{DVec3, Vec3};
use horizon_mod_sdk::render::{FillShape, Point, Rect, Shape, TextShape};
pub const REACH: f32 = 24.0;
const FACE_BYTES: usize = 4 * 3 * size_of::<f32>();
const FACES: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/inspect-faces.bin"));
const MESHES: &[(&str, Mesh)] = include!(concat!(env!("OUT_DIR"), "/inspect-meshes.rs"));
struct Mesh {
min: [f32; 3],
max: [f32; 3],
radius: f32,
start: usize,
end: usize,
}
pub struct Ray {
origin: DVec3,
direction: DVec3,
limit: f64,
}
impl Ray {
pub fn from_view(eye: DVec3, direction: DVec3, terrain: Option<DVec3>) -> Self {
let mut origin = eye;
let mut limit = f64::from(REACH);
if let Some(point) = terrain {
let horizontal = DVec3::new(direction.x, 0.0, direction.z);
let distance = if horizontal.length_squared() > 1e-8 {
// Feet and eye share X/Z. Recover the actual eye height from the host
// ray when it hit a block (the eye lowers while crouching or swimming).
let t = (point - eye).dot(horizontal) / horizontal.length_squared();
origin.y = point.y - direction.y * t;
t
} else {
(point - eye).dot(direction)
};
limit = distance.clamp(0.0, limit);
}
Self {
origin,
direction,
limit,
}
}
fn hits_bounds(&self, min: DVec3, max: DVec3) -> bool {
let (mut near, mut far) = (0.0f64, self.limit);
for i in 0..3 {
if self.direction[i].abs() < 1e-10 {
if self.origin[i] < min[i] || self.origin[i] > max[i] {
return false;
}
} else {
let a = (min[i] - self.origin[i]) / self.direction[i];
let b = (max[i] - self.origin[i]) / self.direction[i];
near = near.max(a.min(b));
far = far.min(a.max(b));
if near > far {
return false;
}
}
}
near < self.limit
}
fn triangle(&self, a: DVec3, b: DVec3, c: DVec3) -> Option<f64> {
let ab = b - a;
let ac = c - a;
let p = self.direction.cross(ac);
let determinant = ab.dot(p);
if determinant.abs() < 1e-10 {
return None;
}
let t = self.origin - a;
let u = t.dot(p) / determinant;
let q = t.cross(ab);
let v = self.direction.dot(q) / determinant;
let distance = ac.dot(q) / determinant;
(u >= 0.0 && v >= 0.0 && u + v <= 1.0 && distance >= 0.0 && distance < self.limit)
.then_some(distance)
}
}
/// Return the object that owns the closest visible face, including its rotated moving parts.
pub fn pick(
mut ray: Ray,
models: &[Model],
mut is_unit_model: impl FnMut(&Model) -> bool,
) -> Option<u32> {
let mut picked = None;
for model in models {
if model.glow || model.scale <= 0.0 {
continue;
}
let Ok(i) = MESHES.binary_search_by_key(&model.name, |(name, _)| *name) else {
continue;
};
let mesh = &MESHES[i].1;
let scale = f64::from(model.scale);
let reach = ray.limit + scale * f64::from(mesh.radius);
if model.at.distance_squared(ray.origin) > reach * reach || !is_unit_model(model) {
continue;
}
let unrotate = model.rotation.conjugate();
let mut local = Ray {
origin: unrotate * (ray.origin - model.at) / scale,
direction: unrotate * ray.direction / scale,
limit: ray.limit,
};
if !local.hits_bounds(
Vec3::from_array(mesh.min).as_dvec3(),
Vec3::from_array(mesh.max).as_dvec3(),
) {
continue;
}
for face in FACES[mesh.start..mesh.end].chunks_exact(FACE_BYTES) {
let [a, b, c, d] = std::array::from_fn(|vertex| {
DVec3::from_array(std::array::from_fn(|axis| {
let start = (vertex * 3 + axis) * size_of::<f32>();
let value = f32::from_le_bytes(
face[start..start + size_of::<f32>()].try_into().unwrap(),
);
f64::from(value)
}))
});
if let Some(hit) = local.triangle(a, b, c).or_else(|| local.triangle(a, c, d)) {
local.limit = hit;
picked = Some(model.object_id());
}
}
ray.limit = local.limit;
}
picked
}
pub fn hint(size: (f32, f32), text_width: f32, label: String) -> [Shape; 2] {
let (x, y) = (size.0 / 2.0, size.1 / 2.0 + 14.0);
[
Shape::Fill(FillShape {
rect: Rect {
x: x - text_width / 2.0 - 4.0,
y: y - 2.0,
w: text_width + 8.0,
h: 12.0,
},
color: 0xA0101518,
}),
Shape::Text(TextShape {
text: label,
at: Point { x, y },
color: 0xFFF0F4FA,
centered: true,
shadow: true,
}),
]
}
#[cfg(test)]
mod tests {
use super::*;
use glam::DQuat;
fn radar(id: u32, at: DVec3) -> Model {
Model {
id,
name: "airdef:radar_truck",
at,
rotation: DQuat::from_rotation_y(0.4),
scale: 1.0,
glow: false,
}
}
#[test]
fn takes_the_closest_model_face_only_in_front_of_the_terrain() {
let eye = DVec3::new(0.0, 0.25, 0.0);
let models = [radar(16, 10.0 * DVec3::Z), radar(33, 6.0 * DVec3::Z)];
assert_eq!(
pick(Ray::from_view(eye, DVec3::Z, None), &models, |_| true),
Some(32)
);
let wall = Some(DVec3::new(0.0, 0.25, 3.0));
assert_eq!(
pick(Ray::from_view(eye, DVec3::Z, wall), &models, |_| true),
None
);
let wall_between_units = Some(DVec3::new(0.0, 0.25, 8.0));
assert_eq!(
pick(
Ray::from_view(eye, DVec3::Z, wall_between_units),
&models,
|_| true
),
Some(32)
);
assert_eq!(
pick(Ray::from_view(eye, DVec3::Z, None), &models, |m| m.id == 16),
Some(16)
);
}
#[test]
fn a_higher_visible_part_is_pickable_above_a_wall() {
let body = radar(16, 8.0 * DVec3::Z);
let antenna = Model {
name: "airdef:radar_panel",
..radar(18, DVec3::new(0.0, 1.8, 8.0))
};
let low_eye = DVec3::new(0.0, 0.25, 0.0);
let wall = Some(DVec3::new(0.0, 0.25, 3.0));
let high_eye = DVec3::new(0.0, 1.8, 0.0);
assert_eq!(
pick(Ray::from_view(high_eye, DVec3::Z, None), &[body], |_| true),
None
);
let models = [radar(16, 8.0 * DVec3::Z), antenna];
assert_eq!(
pick(Ray::from_view(low_eye, DVec3::Z, wall), &models, |_| true),
None
);
assert_eq!(
pick(Ray::from_view(high_eye, DVec3::Z, None), &models, |_| true),
Some(16)
);
}
}
+146 -8
View File
@@ -24,11 +24,18 @@ pub struct SamRec {
/// The parts, from the sensor on; older saves have fewer or none.
pub comps: Vec<f64>,
pub ground_rounds: u32,
pub ground_request: bool,
pub ground_return: bool,
pub return_cargo: bool,
pub ground_stock: u32,
pub air_48n6_stock: u32,
pub mode: sim::battery::SamMode,
pub radar_role: sim::battery::RadarRole,
/// The stable profile ID when the file names one (new saves); old files
/// have only the role key, which migrates to the matching profile.
pub radar_profile: Option<sim::battery::RadarProfile>,
pub spent_cells: u8,
pub radar_on: bool,
}
#[derive(Default)]
@@ -37,14 +44,20 @@ pub struct Layout {
pub targets: Vec<(DVec3, f64)>,
pub damage: Option<bool>,
pub last_chance: Option<bool>,
pub auto_strike: Option<bool>,
pub seed: Option<u64>,
pub wave: Option<Vec<String>>,
pub far: Option<bool>,
pub acoustics: Option<bool>,
/// The player's DLSS request; absent in older saves (the engine's own
/// default applies: on where supported).
pub dlss: Option<bool>,
pub effects: Option<(bool, bool)>,
pub roles: Vec<(SamKind, u8)>,
/// Fire doctrines by the system's place in the file (#47).
pub doctrines: Vec<(usize, sim::doctrine::Doctrine)>,
/// Typed depot/TZM ammunition stocks by the unit's place in the file.
pub stocks: Vec<(usize, sim::AmmoStock)>,
/// Strike missiles in stock and ticks towards the next (#101).
pub strikes: Option<(u32, u32)>,
}
@@ -123,7 +136,9 @@ impl Layout {
None => break,
}
}
let ground_rounds = l.num(22, "заряжено RM48U", 0.0, 4.0)?.unwrap_or(0.0) as u32;
let supports_ground = kind.supports_rm48u();
let shared_cells = if supports_ground { kind.missile_magazine().unwrap_or(0) } else { 0 };
let ground_rounds = l.num(22, "заряжено RM48U", 0.0, COUNT)?.unwrap_or(0.0) as u32;
let ground_stock = l.num(23, "запас RM48U", 0.0, COUNT)?.unwrap_or(0.0) as u32;
let air_48n6_stock = l.num(24, "снятый боезапас ПВО", 0.0, COUNT)?.unwrap_or(0.0) as u32;
let mode = match l.w.get(25) {
@@ -138,19 +153,37 @@ impl Layout {
None => 0,
Some(v) => v.parse::<u8>().map_err(|_| l.bad("пустые контейнеры", "нужно целое число 0..255"))?,
};
let ground_request = l.num(28, "заявка RM48U", 0.0, 1.0)?.unwrap_or(0.0) == 1.0;
if ground_request && !supports_ground { return Err(l.bad("заявка RM48U", "нужен совместимый профиль")); }
let radar_on = l.flag(29, "излучение РЛС")?.unwrap_or(true);
let ground_return = l.flag(30, "заявка на вывоз RM48U")?.unwrap_or(false);
let return_cargo = l.flag(31, "возвращаемый груз RM48U")?.unwrap_or(false);
let radar_profile = match l.w.get(32) {
None => None,
Some(v) => Some(sim::battery::RadarProfile::from_id(v).ok_or_else(|| l.bad("профиль РЛС", "radar_multi, radar_search, radar_track или radar_height"))?),
};
if (ground_return && (!supports_ground || ground_request || ground_rounds == 0)) || (return_cargo && (kind != SamKind::Tzm || ground_stock == 0)) { return Err(l.bad("возврат RM48U", "несовместимое состояние")); }
if radar_role != sim::battery::RadarRole::Multifunction && kind != SamKind::Radar {
return Err(l.bad("роль РЛС", "роль поддерживается только отдельной РЛС"));
}
if mode == sim::battery::SamMode::LauncherOnly && !matches!(kind, SamKind::S400 | SamKind::S500) {
return Err(l.bad("режим", "пусковая поддерживается только С-400 и С-500"));
if let Some(profile) = radar_profile {
if kind != SamKind::Radar { return Err(l.bad("профиль РЛС", "профиль поддерживается только отдельной РЛС")); }
if profile.role() != radar_role { return Err(l.bad("профиль РЛС", "профиль и роль не совпадают")); }
}
if (kind != SamKind::S400 && ground_rounds != 0) || (kind != SamKind::Depot && (ground_stock != 0 || air_48n6_stock != 0)) {
// An old line has only the role: it migrates to the matching profile.
let radar_profile = radar_profile.or((kind == SamKind::Radar).then(|| sim::battery::RadarProfile::of(radar_role)));
// The С-400 and С-500 are separate launchers only now: a system saved with its own radar keeps its place as one.
let mode = if sim::catalog::has_separate_launcher(kind) { sim::battery::SamMode::LauncherOnly } else { mode };
if mode == sim::battery::SamMode::LauncherOnly && !sim::catalog::has_separate_launcher(kind) {
return Err(l.bad("режим", "отдельная пусковая для этого типа недоступна"));
}
if (!supports_ground && ground_rounds != 0) || (!matches!(kind, SamKind::Depot | SamKind::Tzm) && (ground_stock != 0 || air_48n6_stock != 0)) {
return Err(l.bad("боезапас", "несовместимый тип техники"));
}
if let Some((m, _, _, _)) = ammo && m + ground_rounds > 4 && kind == SamKind::S400 {
return Err(l.bad("боезапас", "больше четырёх ячеек"));
if supports_ground && ammo.map_or(0, |(missiles, ..)| missiles) + ground_rounds > shared_cells {
return Err(l.bad("боезапас", &format!("больше {shared_cells} ячеек")));
}
out.sams.push(SamRec { kind, pos, heading, roles, health, cargo, ammo, dest, comps, ground_rounds, ground_stock, air_48n6_stock, mode, radar_role, spent_cells });
out.sams.push(SamRec { kind, pos, heading, roles, health, cargo, ammo, dest, comps, ground_rounds, ground_stock, air_48n6_stock, mode, radar_role, radar_profile, spent_cells, ground_request, radar_on, ground_return, return_cargo });
}
"target" => {
if out.targets.len() >= MAX_UNITS {
@@ -162,9 +195,11 @@ impl Layout {
}
"damage" => out.damage = l.flag(1, "значение")?,
"lastchance" => out.last_chance = l.flag(1, "значение")?,
"autostrike" => out.auto_strike = l.flag(1, "значение")?,
"strikes" => out.strikes = Some((l.need(1, "запас", 0.0, COUNT)? as u32, l.num(2, "до следующей", 0.0, COUNT)?.map_or(0, |v| v as u32))),
"far" => out.far = l.flag(1, "значение")?,
"acoustics" => out.acoustics = l.flag(1, "значение")?,
"dlss" => out.dlss = l.flag(1, "значение")?,
"effects" => out.effects = Some((l.flag(1, "шейдер")?.unwrap_or(true), l.flag(2, "HD")?.unwrap_or(false))),
"seed" => {
let v = l.w.get(1).ok_or_else(|| l.bad("значение", "строка оборвана"))?;
@@ -184,6 +219,37 @@ impl Layout {
let guards = (0..n).map(|k| l.xyz(7 + 3 * k, "охраняемый объект")).collect::<Result<Vec<_>, _>>()?;
out.doctrines.push((at, sim::doctrine::Doctrine { guards, sector, reserve, salvo }));
}
"stock" => {
let at = l.need(1, "склад или ТЗМ", 0.0, MAX_UNITS as f64)? as usize;
let target = out.sams.get(at).ok_or_else(|| l.bad("склад или ТЗМ", "нет такой строки техники"))?;
if !matches!(target.kind, SamKind::Depot | SamKind::Tzm) {
return Err(l.bad("склад или ТЗМ", "боезапас склада поддерживается только для склада и ТЗМ"));
}
let mut stock = sim::AmmoStock::default();
let mut seen = [false; sim::AmmoKind::COUNT];
if l.w.get(2).is_none() {
return Err(l.bad("состав", "строка оборвана"));
}
if l.w.get(2) != Some(&"-") {
for item in &l.w[2..] {
let (k, v) = item.split_once('=').ok_or_else(|| l.bad("состав", &format!("«{item}»: нужен вид=число")))?;
let kind = sim::AmmoKind::from_key(k).ok_or_else(|| l.bad("состав", &format!("неизвестный вид БК «{k}»")))?;
if seen[kind.index()] {
return Err(l.bad("состав", &format!("повтор вида БК «{k}»")));
}
seen[kind.index()] = true;
let count: f64 = v.parse().map_err(|_| l.bad("состав", &format!("«{v}» не число")))?;
if !count.is_finite() || count < 0.0 || count > COUNT || count.fract() != 0.0 {
return Err(l.bad("состав", &format!("недопустимое количество «{v}»")));
}
stock.set(kind, count as u32);
}
}
if target.kind == SamKind::Tzm && stock.total() > sim::TRUCK_CAPACITY {
return Err(l.bad("состав", &format!("груз ТЗМ больше {}", sim::TRUCK_CAPACITY)));
}
out.stocks.push((at, stock));
}
"roles" => {
let kind = l.kind(1)?;
out.roles.push((kind, l.need(2, "роли", 0.0, 255.0)? as u8));
@@ -202,13 +268,20 @@ mod tests {
#[test]
fn battery_modes_load_and_old_layouts_default() {
let old = Layout::parse("sam s400 0 70 0 0").unwrap();
assert_eq!(old.sams[0].mode, sim::battery::SamMode::Integrated);
// The С-400 is a separate launcher now: a system saved with its own radar keeps its place as one.
assert_eq!(old.sams[0].mode, sim::battery::SamMode::LauncherOnly);
let patriot = Layout::parse("sam patriot 0 70 0 0").unwrap();
assert_eq!(patriot.sams[0].mode, sim::battery::SamMode::Integrated);
assert!(old.sams[0].radar_on);
assert_eq!(old.sams[0].radar_role, sim::battery::RadarRole::Multifunction);
let data = "sam s400 0 70 0 0 30 1 0 4 0 0 0 - - - 1 1 1 1 1 1 0 0 0 launcher multi 5\nsam radar 1 70 0 0 0 1 0 0 0 0 0 - - - 1 1 1 1 1 1 0 0 0 integrated engagement";
let l = Layout::parse(data).unwrap();
assert_eq!(l.sams[0].mode, sim::battery::SamMode::LauncherOnly);
assert_eq!(l.sams[0].spent_cells, 5);
assert_eq!(l.sams[1].radar_role, sim::battery::RadarRole::Engagement);
assert_eq!(l.sams[1].radar_profile, Some(sim::battery::RadarProfile::ENGAGEMENT), "an old role-only line migrates");
assert!(!Layout::parse(&data.replace("launcher multi 5", "launcher multi 5 0 false")).unwrap().sams[0].radar_on);
assert!(Layout::parse(&data.replace("launcher multi 5", "launcher multi 5 0 nope")).is_err());
assert!(Layout::parse(&data.replace("engagement", "invalid")).is_err());
assert!(Layout::parse(&data.replace("launcher multi 5", "launcher multi 256")).is_err());
}
@@ -217,6 +290,13 @@ mod tests {
SamKind::Patriot.key()
}
#[test]
fn an_optical_post_loads_by_its_catalog_key() {
let l = Layout::parse("sam optical 10 70 20 0.5\n").unwrap();
assert_eq!(l.sams[0].kind, SamKind::Optical);
assert_eq!(l.sams[0].mode, sim::battery::SamMode::Integrated);
}
// #86: the issue's file, and the other ways a saved state can be wrong: refused whole, with the line
#[test]
fn a_damaged_state_is_refused_as_a_whole_with_its_line_and_field() {
@@ -245,6 +325,36 @@ mod tests {
assert!(Layout::parse(&many).is_err(), "no limit on the number of objects");
}
#[test]
fn the_dlss_request_round_trips_and_old_saves_keep_the_engine_default() {
assert_eq!(Layout::parse("dlss false\n").unwrap().dlss, Some(false));
assert_eq!(Layout::parse("dlss true\n").unwrap().dlss, Some(true));
assert!(Layout::parse("dlss maybe\n").is_err());
// Older saves have no line: the engine's own default (on) applies.
assert_eq!(Layout::parse("damage true\n").unwrap().dlss, None);
}
#[test]
fn radar_profile_ids_round_trip_and_old_roles_map_to_them() {
let old = "sam radar 1 70 0 0 0 1 0 0 0 0 0 - - - 1 1 1 1 1 1 0 0 0 integrated search";
let l = Layout::parse(old).unwrap();
assert_eq!(l.sams[0].radar_role, sim::battery::RadarRole::Search);
assert_eq!(l.sams[0].radar_profile, Some(sim::battery::RadarProfile::SEARCH));
let new = "sam radar 1 70 0 0 0 1 0 0 0 0 0 - - - 1 1 1 1 1 1 0 0 0 integrated engagement 0 0 true false false radar_track";
let l = Layout::parse(new).unwrap();
assert_eq!(l.sams[0].radar_profile, Some(sim::battery::RadarProfile::ENGAGEMENT));
assert_eq!(l.sams[0].radar_role, sim::battery::RadarRole::Engagement);
assert_eq!(
Layout::parse("sam radar 1 70 0 0 0 1 0 0 0 0 0 - - - 1 1 1 1 1 1 0 0 0 integrated multi 0 0 true false false radar_multi").unwrap().sams[0].radar_profile,
Some(sim::battery::RadarProfile::MULTI)
);
// A profile and the legacy role must agree; a profile on a non-radar is refused.
assert!(Layout::parse(&new.replace("engagement 0", "search 0")).is_err());
assert!(Layout::parse(&new.replace("sam radar", "sam s400").replace("engagement", "multi")).is_err());
assert!(Layout::parse(&new.replace("radar_track", "radar_unknown")).is_err());
assert_eq!(sim::battery::RadarProfile::from_id("multi"), Some(sim::battery::RadarProfile::MULTI));
}
// #86: files made by older builds (no ammunition, no parts, no destination marks) and unknown lines still load
#[test]
fn older_valid_saves_still_load() {
@@ -278,6 +388,15 @@ mod tests {
assert!(Layout::parse(&text.replace("0 2 0 0 0 -", "0 4 0 0 0 -")).is_err());
}
#[test]
fn typed_truck_cargo_and_delivery_request_load_from_save() {
let text = "sam s400 200 70 0 0 30 1 0 4 0 0 0 - - - 1 1 1 1 1 1 0 0 0 integrated multi 0 1\nsam tzm 0 70 0 0 0 1 0 0 0 0 0 - - - 1 1 1 1 1 1 0 1 0 integrated multi 0 0\n";
let l = Layout::parse(text).unwrap();
assert!(l.sams[0].ground_request);
assert_eq!(l.sams[1].ground_stock, 1);
assert!(Layout::parse(&text.replace("sam s400", "sam patriot")).is_err());
}
#[test]
fn the_save_line_is_what_the_layout_reads() {
let mut d = crate::sim::doctrine::Doctrine { salvo: crate::sim::doctrine::Salvo::Economy, reserve: 3, ..Default::default() };
@@ -290,5 +409,24 @@ mod tests {
assert!(crate::layout::Layout::parse("doctrine 0 eco 1 - - 2 1 2 3\n").is_err(), "guards cut short");
}
#[test]
fn autostrike_and_typed_stocks_parse_and_validate() {
let text = "sam depot 0 70 0 0\nsam tzm 10 70 0 0\nautostrike true\nstock 0 s400=3 pantsir_gun=4\nstock 1 tor=1\n";
let l = Layout::parse(text).unwrap();
assert_eq!(l.auto_strike, Some(true));
assert_eq!(l.stocks.len(), 2);
assert_eq!(l.stocks[0].1.get(sim::AmmoKind::S400Missile), 3);
assert_eq!(l.stocks[0].1.get(sim::AmmoKind::PantsirGun), 4);
assert_eq!(l.stocks[1].1.get(sim::AmmoKind::TorMissile), 1);
let empty = Layout::parse("sam depot 0 70 0 0\nstock 0 -\nautostrike false\n").unwrap();
assert_eq!(empty.auto_strike, Some(false));
assert!(empty.stocks[0].1.is_empty());
assert!(Layout::parse("sam s400 0 70 0 0\nstock 0 s400=1\n").is_err());
assert!(Layout::parse("sam depot 0 70 0 0\nstock 0 unknown=1\n").is_err());
assert!(Layout::parse("sam depot 0 70 0 0\nstock 0 s400=1 s400=2\n").is_err());
assert!(Layout::parse("sam tzm 0 70 0 0\nstock 0 s400=3\n").is_err());
assert!(Layout::parse("autostrike maybe\n").is_err());
}
}
+1090 -512
View File
File diff suppressed because it is too large Load Diff
+763 -86
View File
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More