Technical Note · June 29, 2026 · 5 min read

Synchronizing an online strategy game with Photon PUN 2

A practical breakdown of matchmaking, shared resources, construction, combat events, and a synchronized win condition in World War F.

World War F combines resource gathering, base construction, combat units, airstrikes, and an atomic-bomb victory condition inside a real-time multiplayer match.

Defining shared state

The central challenge was deciding which actions must be synchronized and which can remain local presentation. Match state, player spawning, resource changes, construction events, damage, and victory all need to agree across connected clients.

Separating the systems

I divided responsibilities between a lobby manager, network game manager, resource system, construction system, combat system, airstrike manager, and atomic bomb system. This kept networking decisions close to the gameplay domain they affected.

Networking became easier to reason about once each gameplay system had a clear owner and a narrow set of synchronized events.

The victory sequence

The atomic bomb is a multi-stage objective: resources must be collected, requirements validated, construction completed, and the launch event communicated to every player. The final sequence and winner state are then displayed consistently across clients.

What I learned

The project strengthened my understanding of RPC-driven events, synchronized variables, matchmaking flows, and the importance of designing multiplayer rules before adding presentation polish.

← Back to all articles