Defense Simulation
A multithreaded engine that tracks hostile missiles, assigns interceptors, and guides them in with Proportional Navigation, then streams every frame to a separate 3D command-and-control display built on a real 1:1 map of Midtown Manhattan.
I wanted to try the kind of work defense engineers actually do, and most of it was past what I knew. I'd never heard of IPC or ProNav, and I'd never used a test framework or a profiler beyond an FPS counter. It began as two separate projects: a missile tracker built on an octree, and two programs sharing memory. Combining them worked, but the tracker had nothing to do with what it tracked. Interceptors gave it a purpose, and learning how they're really guided led me to Proportional Navigation.



- Proportional Navigation with real airframe limits.The command a = N·(Vr × Ω) is capped at the interceptor's G-limit and thrust, so rounds arc through turns instead of pivoting. Convergence is tested against crossing, inbound, and weaving targets for N = 3, 4, and 5.
- An octree that rebuilds 60 times a second without touching the allocator.Nodes live in one contiguous pool and reset instead of freeing. Profiling on a Pi 4 showed allocator churn was the real cost; pooling cut frame time from 12.3 ms to 6.0 ms and L1 cache misses by 44%.
- A swept proximity fuze.At Mach 3 closing speeds a round moves about 30 m per frame, so a point check tunnels straight through the target. The fuze tests closest approach across the whole step.
- Two telemetry transports behind one interface.Locally, a lock-free seqlock ring in shared memory with zero allocation on publish. Remotely, UDP with a zig-zag + VLQ codec that shrinks a 30 B record to about 12 to 15 B, so the entire scene fits in one datagram.
- My first real test suite and profiler.CMake presets for MSVC and Linux, a data-driven YAML scenario, 61 GoogleTest cases, and a clean Valgrind report: 0 bytes in use at exit.
- Frame time, 10,000 entities
- 0.44ms
- Frame time, 50,000 entities
- 1.6ms
- Octree rebuild, pooled vs. linked (Pi 4)
- 2.05× faster
- Building instances at 60 FPS
- 484,564
- Bytes per track on the wire
- 12 to 15B
- Unit tests / leaked bytes
- 61 / 0