Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Third Party Photon Networking Guide

Discussion in 'Multiplayer' started by bertelmonster2k, Mar 21, 2012.

  1. Chintan-Kansagara

    Chintan-Kansagara

    Joined:
    Jul 16, 2016
    Posts:
    19
    PhotonView with ID 1001 has no method "RemovePlayer" marked with the [PunRPC](C#) or @PunRPC(JS) property! Args: String
    UnityEngine.Debug:LogError(Object)
    NetworkingPeer:ExecuteRpc(Hashtable, PhotonPlayer) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:2949)
    NetworkingPeer:RPC(PhotonView, String, PhotonTargets, PhotonPlayer, Boolean, Object[]) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:3711)
    PhotonNetwork:RPC(PhotonView, String, PhotonTargets, Boolean, Object[]) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:2914)
    PhotonView:RPC(String, PhotonTargets, Object[]) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonView.cs:597)
    SnakeMovement2D:Update() (at Assets/Scripts/SnakeMovement2D.cs:119)

    [PunRPC ]
    not Working in my project
    plz help me.


    player.cs
    PhotonView pv = GameObject.Find("UI").gameObject.GetComponent<PhotonView>();
    if(pv == null)
    {
    Debug.Log("Freak out!");
    }
    else
    {
    NetworkManager.Inst.MyPlayer.GetComponent<PhotonView>().RPC("RemovePlayer", PhotonTargets.All, "hello" );
    }

    UI.cs
    [PunRPC]
    void RemovePlayerList()
    {
    Debug.Log("123");
    }
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
  3. Spiffy_bub

    Spiffy_bub

    Joined:
    Jan 19, 2018
    Posts:
    1
    Hi I'm pretty new to game dev with Unity and was wondering how many players a PUN server could comfortably handle, for example in the case of a battle royale game with around 100 players simultaneously on a server.
     
  4. forcepusher

    forcepusher

    Joined:
    Jun 25, 2012
    Posts:
    227
    Not sure if I should answer to a necro thread, but I wouldn't try going over 32 players.
    Check out this post, they have implemented this tool directly inside Photon Unity Networking asset.
    https://www.m2h.nl/network-traffic-culling/
     
  5. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    To sync a game with 100 players, you need to somehow manage which movement updates each client receives. Getting all positions frequently from all 99 other players causes higher than needed network traffic, costs and instability.
    PUN is not built for this amount of players in one room and neither is the "simple" room-based logic we use as default in the Photon Cloud. But a Photon Server can handle way more connections on simple hardware, so it's feasible to implement this type of game with the Photon Server SDK and a client (skipping the simplicity PUN).