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>
This commit is contained in:
2026-11-20 22:30:10 +03:00
parent ac7521936d
commit 858735a4c6
25 changed files with 1074 additions and 122 deletions
+4 -2
View File
@@ -37,8 +37,8 @@ def load():
taken = set(referenced) | unit_kinds | set(ids)
for variant in data["variants"]:
where = f"variants[{variant['id']}]"
if set(variant) != {"id", "kind", "mode", "role", "label"}:
raise ValueError(f"{where}: expected keys id, kind, mode, role, label, got {sorted(variant)}")
if set(variant) != {"id", "kind", "mode", "role", "label", "description"}:
raise ValueError(f"{where}: expected keys id, kind, mode, role, label, description, got {sorted(variant)}")
if not re.fullmatch(r"[a-z0-9_]+", variant["id"]):
raise ValueError(f"{where}: invalid variant id {variant['id']!r}")
if variant["kind"] not in unit_kinds:
@@ -47,6 +47,8 @@ def load():
raise ValueError(f"{where}: unknown configuration {variant['mode']}/{variant['role']}")
if not isinstance(variant["label"], str) or not variant["label"]:
raise ValueError(f"{where}: expected a menu label")
if not isinstance(variant["description"], str) or not variant["description"]:
raise ValueError(f"{where}: expected a description")
if variant["id"] in taken:
raise ValueError(f"{where}: variant id collides with an existing identity or kind")
if len({v["id"] for v in data["variants"]}) != len(data["variants"]):
+2 -1
View File
@@ -316,7 +316,8 @@ def generate_variants(data):
mode = MODES[entry["mode"]]
role = ROLES[entry["role"]]
lines.append(f" UnitVariant {{ id: {text(entry['id'])}, kind: SamKind::{entry['kind']}, "
f"mode: SamMode::{mode}, role: RadarRole::{role}, label: {text(entry['label'])} }},")
f"mode: SamMode::{mode}, role: RadarRole::{role}, label: {text(entry['label'])}, "
f"description: {text(entry['description'])} }},")
return "\n".join(lines + ["];", ""])