Sunsets, volumetric clouds and fog in HD (fork patch 23, #53); missiles and drones collide with the world through new world queries (patch 24, API level 12; #42, #43); a direct hit destroys a system, strikes scatter by kind with a small miss chance (#49, #59)
build / mod (push) Successful in 3m24s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 21:44:59 +03:00
parent a8551b5c28
commit 8065f2225c
33 changed files with 4010 additions and 37 deletions
+18 -1
View File
@@ -18,6 +18,13 @@ pub enum Terrain {
Hills { base: i32, amp: f64, period: f64 },
}
/// The land as blocks: solid at and below the column's height (what the game would answer `render.sections` with).
impl airdef::sim::world::WorldSource for Terrain {
fn solid(&self, x: i32, y: i32, z: i32) -> Option<bool> {
Some(y < self.height(x, z))
}
}
impl Terrain {
pub fn height(self, x: i32, z: i32) -> i32 {
match self {
@@ -98,6 +105,9 @@ pub struct Report {
/// Missiles fired by air defence (sum of the systems' `fired`).
pub fired: u32,
pub ground_queries: u64,
/// The block cache's counters (issue #43) and the drones that struck the land (issue #42).
pub world: String,
pub crashes: u32,
pub ground_batches: u64,
pub tick_p50: Duration,
pub tick_p95: Duration,
@@ -163,6 +173,8 @@ pub fn run(sc: &Scenario) -> Report {
let t = Instant::now();
sim.step(&mut ground, None, &mut out);
let wanted = ground.take_wanted();
let sections = ground.world.take_wanted(now);
ground.world.serve(&sc.terrain, sections, now);
let dt = t.elapsed();
times.push(dt);
if planning {
@@ -212,6 +224,8 @@ pub fn run(sc: &Scenario) -> Report {
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.crashes = sim.crashes;
r.raids_ended = ended.iter().filter(|o| **o).count();
r.all_ended = r.raids_ended == sc.raids.len();
r.tick_total = times.iter().sum();
@@ -253,7 +267,8 @@ impl Report {
planning: {pl:.1} ms over {pt} ticks\n\
ground queries: {gq} in {gb} batches\n\
non-finite positions: {nan}\n\
stuck trucks: {stuck:?} (busy truck-ticks {busy})\n",
stuck trucks: {stuck:?} (busy truck-ticks {busy})\n\
crashes into the land: {crashes}; {world}\n",
name = self.name,
seed = self.seed,
units = self.units,
@@ -276,6 +291,8 @@ impl Report {
nan = self.nan_positions,
stuck = self.stuck_trucks,
busy = self.truck_busy_ticks,
crashes = self.crashes,
world = self.world,
)
}
pub fn json(&self) -> String {