Networking
Networking
Authoritative multiplayer server with WebRTC and tick-based state sync.
MavonEngine uses an authoritative server architecture for multiplayer. The server is the single source of truth — clients send commands, the server processes them, and broadcasts state back to clients.
Reference: The architecture is inspired by Gaffer On Games and Source Engine Multiplayer Networking.
Transport
Real-time data is sent over UDP via WebRTC using geckos.io. This gives low-latency unreliable messaging suitable for game state synchronization.
Architecture overview
Client Server
│ │
│── command (input) ──────────► │
│ │ 1) process command
│ │ 2) step physics
│ │ 3) update state
│◄── state sync (tick) ──────── │
│ │
- Client captures input and sends commands to the server
- Server queues commands in a command buffer
- On each tick, the server processes commands, steps physics, and broadcasts world state
- State is only sent to clients within the visibility radius of each entity