High-Fidelity Coherence-Rupture-Rebirth Dynamics • 60 FPS
Spatial Hash Grid: O(n²) → O(n) for neighbor queries. Each entity stored in grid cell for constant-time lookup.
Object Pooling: Reuse plankton objects instead of GC thrashing. ~90% reduction in allocations.
Staggered Updates: Environmental fields update 1/3 per frame. Not all entities update simultaneously.
LOD System: Distant/small entities use simplified rendering. Detail scales with coherence.
Typed Arrays: Float32Array for fields provides ~2x faster access than standard arrays.
Cached Calculations: Pre-compute expensive operations (sin/cos, sqrt) and reuse.
Non-Markovian dynamics with full memory integration:
where C(t) = ∫₀ᵗ L(x,τ) dτ accumulates over entire history.
All agents couple through shared environmental fields:
Φⱼ: nutrient field, current field, temperature field, oxygen field
• Spatial hash: 60×60 cells, O(1) insertion/lookup
• Object pool: 500 pre-allocated plankton, zero GC during runtime
• Field updates: 33% per frame (20ms budget), full refresh every 3 frames
• LOD thresholds: coherence < 20 = low detail, > 80 = high detail
• Cache lifetime: 5 frames for expensive trig operations