diff --git a/benchmark_results.json b/benchmark_results.json index 7206d18..40a972c 100644 --- a/benchmark_results.json +++ b/benchmark_results.json @@ -1,17 +1,17 @@ { "mode": "graphics", "ticks": 600, - "total_time_ms": 3483.9, - "avg_fps": 172.2, - "avg_frame_time_ms": 5.78, - "p99_frame_time_ms": 14.20, - "min_frame_time_ms": 4.20, + "total_time_ms": 3437.1, + "avg_fps": 174.6, + "avg_frame_time_ms": 5.70, + "p99_frame_time_ms": 13.96, + "min_frame_time_ms": 4.45, "subsystems": { - "ca_step_avg_us": 1397, - "ca_step_p99_us": 10172, - "ca_step_min_us": 303, - "render_avg_us": 3668, - "render_p99_us": 5514, - "render_min_us": 3259 + "ca_step_avg_us": 1259, + "ca_step_p99_us": 8885, + "ca_step_min_us": 670, + "render_avg_us": 3737, + "render_p99_us": 5483, + "render_min_us": 3221 } } \ No newline at end of file diff --git a/src/physics/projectile.rs b/src/physics/projectile.rs index 4d8764d..07a5bf7 100644 --- a/src/physics/projectile.rs +++ b/src/physics/projectile.rs @@ -136,13 +136,16 @@ impl Projectile { } let cell = grid.get(x, y); if cell.is_empty() { - grid.set(x, y, Cell::new(MaterialId::Fire)); + let mut fire = Cell::new(MaterialId::Fire); + fire.updated_this_tick = true; + grid.set(x, y, fire); } else if cell.material == MaterialId::Wood || cell.material == MaterialId::Grass || cell.material == MaterialId::Flesh { let mut ignited = cell; ignited.material = MaterialId::Fire; + ignited.updated_this_tick = true; grid.set(x, y, ignited); grid.set_temp(x, y, 400.0); } diff --git a/src/world/cellular.rs b/src/world/cellular.rs index f5cef0f..d403db6 100644 --- a/src/world/cellular.rs +++ b/src/world/cellular.rs @@ -243,6 +243,7 @@ impl CellularAutomaton { if temp > 100.0 { let mut new = grid.get(x, y); new.material = MaterialId::Steam; + new.updated_this_tick = true; grid.set(x, y, new); grid.set_temp(x, y, 110.0); } @@ -301,7 +302,10 @@ impl CellularAutomaton { grid.set_temp(x, y, lava_temp - 50.0); } MaterialId::Wood | MaterialId::Grass | MaterialId::Flesh if n_temp < 300.0 => { - grid.set(nx, ny, Cell::new(MaterialId::Fire)); + let mut new_n = neighbor; + new_n.material = MaterialId::Fire; + new_n.updated_this_tick = true; + grid.set(nx, ny, new_n); grid.set_temp(nx, ny, 400.0); } MaterialId::Sand if n_temp > 1700.0 => { @@ -377,6 +381,7 @@ impl CellularAutomaton { if mat.flammable && n_temp < mat.ignition_temp { let mut new_n = neighbor; new_n.material = MaterialId::Fire; + new_n.updated_this_tick = true; grid.set(nx, ny, new_n); grid.set_temp(nx, ny, 400.0); } @@ -473,6 +478,7 @@ impl CellularAutomaton { if temp > 200.0 { let mut new = grid.get(x, y); new.material = MaterialId::Fire; + new.updated_this_tick = true; grid.set(x, y, new); grid.set_temp(x, y, 400.0); } @@ -481,7 +487,10 @@ impl CellularAutomaton { fn update_grass(&mut self, grid: &mut ChunkedGrid, x: i32, y: i32) { let temp = grid.get_temp(x, y); if temp > 250.0 { - grid.set(x, y, Cell::new(MaterialId::Fire)); + let mut new = grid.get(x, y); + new.material = MaterialId::Fire; + new.updated_this_tick = true; + grid.set(x, y, new); grid.set_temp(x, y, 400.0); } }