u/dechichiin r/C_Programming • Recommends
On “Just finished my multiplayer system in C and turns out we can support 50k players in a single server at 60hz simulation tick”
I've been writing this engine in C since 2024, yes, before AI.
The netcode architecture is ECS based, inspired by this 2017 GDC talk. The server is authoritative, and replicated state is just regular ECS components tagged for the network, with each field quantized (e.g. position at 1 mm). Codegen writes the serializers. Clients send inputs (each packet repeats the last 4 ticks so a lost packet costs nothing), each client predicts its own character and rolls back and re-simulates on corrections, and everyone else is interpolated. The transport layer is QUIC over UDP, but we'll support swapping out for different layers.
Every client receives every player, in three tiers of relevancy:
* ne…