Case study 01
Multiplayer Networking
1. Overview
Networking work across three projects: dedicated-server multiplayer in Ktrl Smash (Unity, Photon Fusion, AWS), a server-authoritative combat simulation in Merge Tactics (Unreal Engine 5.8), and a backend-agnostic session layer in The Cursed Hour (Unreal Engine 5, Epic Online Services and Steam).
2. Problem
- Ktrl Smash: ping climbed during a session, from 20 to 60 ms on Windows and from 40 to 100 ms on WebGL.
- Merge Tactics: a paid framework needs match results that players cannot tamper with.
- The Cursed Hour: ship on Steam while planning a cross-platform rollout through Epic Online Services.
3. Technical challenges
- WebGL runs on a single main thread, so per-frame work accumulates there.
- Frequent network updates and redundant replicated state made the load worse.
- Deciding where authority lives, so that clients render outcomes but never compute them.
- Two online backends with different APIs behind one lobby and session experience.
4. My responsibilities
- Ktrl Smash: the multiplayer layer on Photon Fusion; deploying dedicated servers on AWS together with the devops team; diagnosing and fixing the ping drift.
- Merge Tactics: the whole architecture and implementation, as a solo project.
- The Cursed Hour: the lobby and session layer, text and voice chat, and the EOS and Steam SDK integration.
5. Approach and debugging
- Measure over the whole session. The problem only showed as drift, so ping had to be watched for the length of a match, on both builds.
- Compare platforms. WebGL drifted further than Windows. WebGL runs on a single main thread, so per-frame work was the first suspect.
- Audit every instance, not one. I audited coroutine usage across the codebase, then the update rate, the payload size and each replicated variable.
- Re-measure on both builds after the change.
- Make the server the only place combat is decided, and send clients a compact record of what happened.
- Keep the session layer independent of any one backend so a second one can be added.
6. Implementation
- Ktrl Smash: reduced update frequency and payload size, and removed replicated variables that were not needed.
- Merge Tactics: at the end of the prep phase the server locks board snapshots, simulates combat, and replicates one compact event log. Clients replay that log for animation. The round loop (prep, combat and results phases, recency-weighted pairing, ghost boards for odd lobbies, PvE rounds, spectating and late join) runs on standard Unreal replication.
- The Cursed Hour: EOS and the Steam SDK are integrated in parallel behind the same session layer.
7. Results
| Ktrl Smash ping over a session | Before the fix | After the fix |
|---|---|---|
| Windows | 20 to 60 ms | Stays flat |
| WebGL | 40 to 100 ms | Stays flat |
- Merge Tactics: clients never compute outcomes, which closes the cheat surface on match results.
- The Cursed Hour: released on Steam in November 2024. The cross-platform rollout through EOS was planned, and the session layer was built to support it.
8. Technologies used
Photon Fusion, AWS, Unity (C#), WebGL, Unreal Engine 5 replication, C++, Epic Online Services, Steam SDK




