Imagine: your mobile Unity game, you integrated Photon, but when switching from Wi-Fi to 4G the connection breaks and players are kicked out of the room. A familiar problem? We solve it at code level: configure playerTtl, reconnect, and manual synchronization so traffic doesn't go to waste. Many developers make the same mistake: relying on the default PhotonTransformView components, leading to excessive traffic and reconnection issues. We offer a proven approach that reduces traffic by 3–5 times and provides stable connections on mobile devices. In 5 years of working with Photon, we've completed 15+ projects for mobile games — from simple lobbies to complex quests with matchmaking. If you want to avoid typical problems and save on traffic, contact us for Photon integration into your game.
How to Properly Synchronize Objects in Photon?
PhotonView is the main synchronization component. Each networked object gets a ViewID. Synchronizing position and rotation via PhotonTransformView is the default — it works, but sends updates on every FixedUpdate, even if the object hasn't moved.
The correct approach: implement IPunObservable.OnPhotonSerializeView with manual control over data sending:
public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) { if (stream.IsWriting) { // Send only if significantly changed if (Vector3.Distance(_lastSentPosition, transform.position) > 0.01f) { stream.SendNext(transform.position); stream.SendNext(transform.rotation); _lastSentPosition = transform.position; } } else { _networkPosition = (Vector3)stream.ReceiveNext(); _networkRotation = (Quaternion)stream.ReceiveNext(); } } On the client, the received _networkPosition is not applied directly — we interpolate via Vector3.MoveTowards or Lerp using the packet time from PhotonMessageInfo.SentServerTime. As Photon documentation states, this approach minimizes network traffic without sacrificing smoothness.
Comparison of synchronization methods:
| Method | Traffic (packets/sec) | Latency | Simplicity |
|---|---|---|---|
| PhotonTransformView | 20 packets (default) | Low | High |
| IPunObservable (manual) | 1–2 packets (only on change) | Medium | Medium |
Manual synchronization reduces traffic by 3–5 times. For mobile games, this is critical because Photon is billed by CCU.
How Does RPC Work and When to Use It?
photonView.RPC — for events that must be guaranteed to arrive: damage, death, item pickup. RpcTarget.All sends to everyone in the room including sender. RpcTarget.Others sends to everyone except.
Common mistake: using RPC for positional updates. RPC is reliable (TCP-like behavior), adds acknowledgement overhead. For positions — PhotonNetwork.SendRate + OnPhotonSerializeView; for important events — RPC.
PhotonNetwork.SendRate defaults to 20, SerializationRate to 10. For mobile, a balance between traffic and smoothness: 15/10.
Connection and Rooms
PhotonNetwork.ConnectUsingSettings(); // uses PhotonServerSettings asset void OnConnectedToMaster() { PhotonNetwork.JoinRandomOrCreateRoom( expectedCustomRoomProperties: null, expectedMaxPlayers: 4, matchingType: MatchmakingMode.FillRoom, typedLobby: null, sqlLobbyFilter: null, createIfNotFound: true ); } RoomOptions.CustomRoomPropertiesForLobby — array of keys visible in the lobby for filtering. Don't pass everything to lobby properties: only what is filtered (region, game mode, map).
Why Do Players Disconnect on Network Change?
Network change. The Photon SDK supports PhotonNetwork.ReconnectAndRejoin() — but only if the room has playerTtl > 0. Default is playerTtl = 0, the player is considered disconnected instantly. For mobile: set playerTtl = 10000 (10 seconds for reconnect).
iOS Background. When going to background, iOS aggressively kills network connections. Photon will disconnect in 5–10 seconds. For games where this is critical — use UIBackgroundModes: voip (with caution, Apple may reject) or graceful disconnect.
Traffic. Photon Realtime is billed by CCU (concurrent users). 20 CCU are free. When integrating, it's worth adding Photon Dashboard for monitoring — you can see message count, bytes, peaks. We include Photon Dashboard setup and code optimization in our work to reduce traffic by 30–50%.
Typical Mistakes When Integrating Photon on Mobile Devices
- Missing playerTtl — players instantly leave the room on temporary disconnect.
- Using PhotonTransformView for all objects — unnecessarily high traffic.
- Frequent RPC calls for positions — increases latency and load.
- Ignoring SendRate and SerializationRate settings — can be lowered without quality loss.
These mistakes are easily fixed during development. Order an audit of your project to identify them before release.
What Our Photon Integration Work Includes?
- Audit of the current implementation (if any)
- Setup of Photon SDK and configuration (regions, rooms, TTL)
- Implementation of synchronization via IPunObservable (manual traffic management)
- Integration of matchmaking with custom properties
- Setup of RPC and reliable events
- Optimization for mobile devices (reconnect, traffic, background)
- Testing on 10+ real devices across different networks
- Provision of documentation and post-deployment support
Timeline and Cost
Basic integration of Photon Realtime with rooms, position synchronization, and RPC: from 3 to 7 days. Full system with matchmaking, custom properties, and mobile optimization: from 2 to 3 weeks. Cost is calculated individually — we will assess your project in 1 day.
Ready to discuss the details? Contact us for a consultation and accurate estimate. Reach out for reliable Photon integration in your mobile game.







