Phoenix.Engine 3D
A modular engine for real-time multiplayer 3D games: rooms, Rapier physics, per-socket replication, a typed binary protocol, three.js rendering, input, audio and assets. A game installs it and builds its own client and server on top.
- sent by a room at rest
- 0 B
- rotation error in 32 bits
- 0.25°
Overview
The server simulates and clients mirror. Each room owns a Rapier physics world that steps once per tick; clients send intentions and draw. Nothing goes on the wire that did not change: every entity is encoded once per tick into a shared buffer, and each socket’s frame copies only the entities it can see.
Everything is typed end to end. Entity kinds, event names, payloads, input actions and spawn options are checked at compile time, from the BinarySchema definitions down to send and onMessage.
An open-source template shows a complete game built on the engine: matchmaking and private rooms, several regional servers, mobile controls, settings, platform SDKs, and a headless test harness with load-testing bots.
What I built
- 01 Per-socket interest management with a spatial grid: spawns, despawns and delta updates per client.
- 02 Delta-encoded transforms: per-axis dirty flags, and quaternions packed “smallest three” into 32 bits.
- 03 Sleeping physics bodies cost nothing on the wire, so a still room sends nothing at all.
- 04 No allocation in a tick: hot paths reuse scratch vectors.
- 05 Per-event rate and size limits enforced on the server, derived from the payload schemas.
- 06 Client: three.js with WebGL or WebGPU, SDF text, touch and mouse orbit cameras, and a Svelte 5 UI kit.