mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-14 13:42:09 +00:00
perf(hud): stop flight instruments redrawing when values have settled
hud_gauge, hud_attitude_indicator, and hud_heading_tape now skip queue_redraw() when the newly-lerped value hasn't moved past a small epsilon, instead of redrawing every frame forever. Angle-wrapping values (heading, attitude roll) use a new shared angle_delta_deg helper on HudInstrument so the wrap boundary doesn't read as a false jump. HUD.tscn's Instruments node now sets process_mode = 1 (PAUSABLE), overriding the inherited ALWAYS mode from the HUD root so instruments stop processing during the post-match pause freeze, while sibling ResultOverlay keeps running its win-screen tween.
This commit is contained in:
@@ -25,8 +25,6 @@ Bugs found in an adversarial review. None are gameplay- or physics-affecting, so
|
||||
|
||||
## Performance
|
||||
|
||||
- [x] Gate `Ship._emit_telemetry_data()` — it runs `get_euler()` + trig per ship per physics tick for every ship, including AI ships nobody displays and `--headless` training where no HUD exists. Gate on having signal connections, and `set_physics_process(false)` when headless (`arena_boundary.gd` already does this correctly for its `_process`).
|
||||
- [ ] Stop the HUD instruments redrawing once settled: all five `queue_redraw()` every frame forever, re-recording canvas items with `draw_string` glyph work, and `HUD.tscn` sets `process_mode = 3` so it continues while paused.
|
||||
- [ ] Shared per-team materials instead of `Ship._apply_team_color()` allocating a fresh `StandardMaterial3D` and assigning it as `material_override` (and running at least twice per ship — once from `_ready`, once from the `team` setter). Removes the allocation and lets same-team ships batch.
|
||||
- [ ] Merge each goal's visuals into one `ArrayMesh` with a hull surface and a net surface — currently 11 `MeshInstance3D`s and 4 materials per goal, ~22 draw calls for a static prop. `arena_boundary.gd:333` already demonstrates the `SurfaceTool` technique in this codebase.
|
||||
- [ ] Merge the four non-tinted ship meshes (Hull/Canopy/EngineGlowL/R) into one — 6 draw calls per ship down to 3. Irrelevant at 1v1; 36 calls before VFX at 3v3.
|
||||
|
||||
Reference in New Issue
Block a user