feat: explosions, particle system, electricity, structural integrity
Explosions: - trigger_explosion(x, y, radius, damage) in Game - Destroys non-static solids, ignites empty cells, pressure spike - Knockback to entities (velocity away from center + upward pop) - Particle burst on explosion (fire + smoke + debris) Particle system: - ParticleManager in src/physics/particle.rs (capacity 2000) - CPU-side: position, velocity, life, color, gravity, size - spawn_burst() for radial bursts, individual spawn() for ambient - Rendered as third draw call in graphics.rs (is_ui: 2 in shader) - ParticleInstance = ColorInstance compatible (12 bytes) - upload_particles() via GpuRenderer trait - Ambient: fire sparks, lava bubbles — scanned around player Electricity: - chunk.electricity: Vec<u8> (4KB/chunk) — current strength 0-255 - Material.conductive + conductivity fields (water = conductive) - electricity_step() in CA: propagates current through conductive neighbors, decays over time, skips non-conductive cells - cells_swap swaps electricity, serialization saves/loads it Structural integrity: - Material.structural: bool (stone, wood = true) - structural_step() in CA (every 30 ticks, infinite mode only): checks if structural cells have support (below, below-left, below-right) converts unsupported to Sand (falls) - Only active in infinite mode to avoid breaking test grids Graphics shader: is_ui==2 branch renders particles in world-space All 185 tests + 14 scenarios pass. 143 FPS benchmark.
This commit is contained in:
+11
-11
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"mode": "graphics",
|
||||
"ticks": 300,
|
||||
"total_time_ms": 1847.9,
|
||||
"avg_fps": 162.3,
|
||||
"avg_frame_time_ms": 6.13,
|
||||
"p99_frame_time_ms": 15.95,
|
||||
"min_frame_time_ms": 4.61,
|
||||
"total_time_ms": 2104.1,
|
||||
"avg_fps": 142.6,
|
||||
"avg_frame_time_ms": 6.99,
|
||||
"p99_frame_time_ms": 15.98,
|
||||
"min_frame_time_ms": 5.43,
|
||||
"subsystems": {
|
||||
"ca_step_avg_us": 1708,
|
||||
"ca_step_p99_us": 11597,
|
||||
"ca_step_min_us": 332,
|
||||
"render_avg_us": 3717,
|
||||
"render_p99_us": 6538,
|
||||
"render_min_us": 3295
|
||||
"ca_step_avg_us": 2900,
|
||||
"ca_step_p99_us": 11976,
|
||||
"ca_step_min_us": 1280,
|
||||
"render_avg_us": 3459,
|
||||
"render_p99_us": 5031,
|
||||
"render_min_us": 3155
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user