Multiplayer Tank Battle
Real-Time Multiplayer • Android • iOS • WebGL • Windows • 1–4 Players
Unity
Photon PUN
Multiplayer
Clean Architecture
State Machines
Real-Time Sync
Project Overview
Multiplayer Tank Battle is a real-time, Battle City–inspired
multiplayer tank game supporting 1–4 players per match.
The game is designed to run consistently across
Android, iOS, WebGL, and Windows.
This project was built to deeply understand multiplayer fundamentals such as
state synchronization, player authority, latency tolerance, and scalable room-based architecture.
My Role & Responsibilities
- Designed and implemented complete multiplayer architecture using Photon PUN
- Built lobby, room creation, and dynamic player count system (1–4 players)
- Implemented player-ready synchronization before gameplay start
- Designed clean MVP-based UI architecture for multiplayer screens
- Implemented synchronized spawning and gameplay initialization
- Built modular enemy AI using State and Strategy patterns
- Optimized network traffic to maintain smooth real-time gameplay
Engineering & System Design
Multiplayer Architecture (Photon PUN)
Multiplayer engineering focuses on maintaining
state consistency, handling network latency,
and ensuring fair gameplay.
- Room-based architecture with dynamic player capacity (1–4)
- Master-client authority for deterministic game flow
- Player-ready state synchronization before scene load
- Scene synchronization using AutomaticallySyncScene
I preferred using Custom Room Properties and
RaiseEvent for deterministic synchronization,
avoiding excessive RPC usage to reduce network overhead.
Gameplay State Management
Implemented clean gameplay flow using state machines for both
players and AI-controlled enemy tanks.
- Idle, Move, Attack, and Dead states
- Strategy-based enemy behavior (target base, chase players, patrol)
- Clear separation of gameplay logic and networking logic
Challenges & Solutions
Challenge: Synchronizing game start across multiple players
Players often joined rooms at different times, causing desync issues
during gameplay initialization.
Solution: Implemented a player-ready system using Photon player properties.
The master client triggered scene synchronization only after all players confirmed readiness.
Challenge: Keeping gameplay responsive under network latency
Solution: Minimized network messages, used event-based sync,
and allowed local prediction for non-critical visuals.
Impact & Results
- Stable real-time multiplayer gameplay for up to 4 players
- Clean, scalable multiplayer architecture
- Consistent gameplay experience across platforms
- Strong foundation for extending game modes and features