Question about traffic overflow

Options
value = (PhotonNetwork.time - info.timestamp)
this value does not change around 1 ~ 500 messages per second? ....1~800 too ? :o

...This means that the limit of 500 messages is simply the load of the processor from the processing of more expensive operations PhotonNetwork.Instantiate(this operation is more costly than https://docs.unity3d.com/ScriptReference/Object.Instantiate.html), PhotonNetwork.Destroy(this operation is more costly than https://docs.unity3d.com/ScriptReference/Object.Destroy.html), etc.

From this it follows that In PUN there is only one concept of traffic overflow.
This is only when the photon server manually ejects one player from the room (when there are 800~1000 messages per second in the room)

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Kurtav,

    I did not get your question. Could you rephrase?
    The 500 msg/room/second is a recommended soft limit.
  • Kurtav
    Kurtav ✭✭
    edited May 2018
    Options
    Hi @JohnTube,
    Example - players transmit the movement of a set of objects.
    each movement of the object - script
    void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
    {
    	if (stream.isWriting)
    	{
    
    		stream.SendNext(transform.position);
    		stream.SendNext(transform.rotation);
    		stream.SendNext(vel.velocity);
    	}
    	else
    	{
    		float lag = Mathf.Abs((float)(PhotonNetwork.time - info.timestamp));
    
    		correctPlayerPos = (Vector3)stream.ReceiveNext();
    		correctPlayerRot = (Quaternion)stream.ReceiveNext();
    		vel.velocity = (Vector2)stream.ReceiveNext();
    	}
    }
    The first example - two players transfer each other 10 objects(~35 messages per second in the room)



    The second example - two players transfer each other 50 objects(~110 messages per second in the room)



    Between the first and second example, the values of the lag variable will strongly differ or not?
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited May 2018
    Options
    Hi @Kurtav,

    Well according to your tests it does not, right?! :smile:

    This is only when the photon server manually ejects one player from the room (when there are 800~1000 messages per second in the room)
    This is not accurate. Actually, the peer is disconnected in case of peer buffer overflow which is the result of the excessive messages rate.
    For Photon Cloud the peer buffer is set to 500000 bytes.