Photon Multiplayer Integration for Mobile Game

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Photon Multiplayer Integration for Mobile Game
Medium
~1-2 weeks
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1054
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Photon Multiplayer Integration for Mobile Games

Photon is the de-facto standard for Unity multiplayer on mobile. Photon Realtime SDK handles transport layer, matchmaking, and room management. But with incorrect integration: connection breaks on network switch, object sync fails, and traffic bill is 3× expected.

PhotonView and Object Sync

PhotonView—core sync component. Each networked object gets ViewID. Position and rotation sync via PhotonTransformView by default—works but broadcasts updates on every FixedUpdate, even if object didn't move.

Correct approach: IPunObservable.OnPhotonSerializeView with manual control:

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 client, received _networkPosition isn't applied directly—interpolate via Vector3.MoveTowards or Lerp by packet time from PhotonMessageInfo.SentServerTime.

RPC and Reliable Events

photonView.RPC—for events that must reliably arrive: damage, death, item pickup. RpcTarget.All broadcasts to room including sender. RpcTarget.Others—everyone except.

Typical mistake: using RPC for position updates. RPC is reliable (TCP-like), adds acknowledgment overhead. For positions—PhotonNetwork.SendRate + OnPhotonSerializeView. For critical events—RPC.

PhotonNetwork.SendRate default 20, SerializationRate—10. For mobile balance: 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 lobby for filtering. Don't pass everything: only fields used for filtering (region, game mode, map).

Mobile Issues

Network switch. Photon supports PhotonNetwork.ReconnectAndRejoin()—but only if room has playerTtl > 0. Default playerTtl = 0, player considered disconnected immediately. For mobile: playerTtl = 10000 (10 seconds for reconnect).

iOS Background. iOS aggressively kills network connections on background. Photon breaks in 5-10 seconds. For critical games—UIBackgroundModes: voip (with caution, Apple may reject) or graceful disconnect.

Traffic. Photon Realtime bills by CCU (concurrent users). 20 CCU free. On integration, add Photon Dashboard to monitoring—see message count, bytes, peaks.

Timeline

Basic Photon Realtime integration with rooms, position sync, and RPC: 3-7 days. Full system with matchmaking, custom properties, and mobile optimization: 2-3 weeks. Cost calculated individually.