Photon, FishNet and Mirror are good libraries. They let a team put players in the same match within days, and for many games that is all the networking they will ever need.
They are also general-purpose by design. To work for every genre, they carry code paths, message formats and bookkeeping that a specific game never uses. At small player counts nobody notices. At the scale we build for, every one of those extra bytes and microseconds is multiplied by every player, every tick, and that is where purpose-built netcode pulls ahead.
Where general-purpose netcode spends its budget
The overhead sits at the micro level, inside every message and every update. None of it is a flaw in any one library. It is the price of being general.
- Generic serialization. A library cannot know that your health value never exceeds 1,000 or that a position only needs centimetre precision, so it sends full-width types with type and field information attached.
- Per-object synchronization. State is tracked and sent object by object and component by component, with dirty flags and headers for each, even when one compact message per player would carry the same information.
- Indirection on every call. Remote calls pass through lookup tables, attributes or generated wrappers built to handle any method signature, instead of a direct call the game could make.
- Features you pay for but don't use. Lobbies, ownership transfer, multiple prediction modes and general lag compensation all add checks and memory to the hot path, used or not.
- One-size interest management. Deciding which player needs which update is the most expensive question at scale. A general solution answers it by distance or grid; the game itself usually knows a much cheaper answer.
Each item costs little on its own. Multiplied by thousands of players and dozens of updates per second, it decides how many players a server can hold and what the hosting bill looks like.
What purpose-built netcode does instead
When the netcode is written for one game, every decision can use what that game knows about itself.
- Messages shaped to the game. Each message carries exactly the fields it needs, packed to the bits they need. A value that fits in 10 bits takes 10 bits.
- Deltas on the game's own state. Only what changed since the last acknowledged update goes over the wire, compared at the level the game cares about rather than per object.
- Interest management built on the game's rules. If players only ever see their own zone of the map, the server only ever considers that zone. The cheapest update is the one never sent.
- A server loop that does only this game's work. No general-purpose layers between receiving input and simulating the world, so each tick costs less and more players fit on one machine.
- Server authority where it matters. The server owns the game state and decides what is true, so the protocol is designed around that from the first message instead of added later.
The trade-off is real: someone has to design, build and test all of this. That is the work we take on.
What it made possible on a browser MMO
One of our recent projects is a browser MMO. The client runs on Unity WebGL and the server on Node.js, so players join from a link with nothing to install. The goal was one match, not many small ones.
We wrote the netcode ourselves, with no third-party networking library, and load-tested the backend with 50,000 players together in a single match. The server owns the game state, so what every player sees is what the server agreed.
A general-purpose library would have given us a working prototype sooner. It would not have let us decide, message by message, what crosses the wire, and at 50,000 players that control is what the match depends on.
When a library is still the right call
We use Photon Fusion, FishNet and Netcode for GameObjects on client projects when they fit, and often they do.
| Your game | Our usual recommendation |
|---|---|
| Prototype or vertical slice to pitch | A library: speed matters more than efficiency |
| Co-op or small sessions, up to a few dozen players | A library, tuned to the game |
| Competitive play where every millisecond is felt | Purpose-built, or a library with its hot paths replaced |
| Hundreds or thousands of players in one world or match | Purpose-built |
| Browser or low-end mobile clients with tight bandwidth | Purpose-built message formats at least |
| Hosting costs that grow with every player | Purpose-built: fewer servers per player |
There is also a middle path. Many games start on a library and move only the expensive parts, such as movement sync or interest management, to custom code once the player count shows where the cost is.
How we decide
On every multiplayer project we start with three numbers: how many players share one match, how often the game state changes, and what the hosting should cost per player. Those numbers, more than taste, decide between a library, purpose-built netcode, or a mix.
If your game is already on Photon, FishNet or Mirror and running out of headroom, we can profile it and tell you which parts to replace first. If you are starting a large multiplayer game, we can build the netcode with you from the first design document. Start a project and tell us your player counts.
Originally published on IFU Studios.
Top comments (0)