Increasing send rate makes game become more laggy

If I increase the send rate with PhotonNetwork.sendRate and PhotonNetwork.sendRateOnSerialize the game becomes even more laggy. The higher the send rate the higher the lag. Where is my mistake?

using UnityEngine;
using System.Collections;

public class NetworkCharacter : Photon.MonoBehaviour
{
private void Awake()
{
PhotonNetwork.sendRate = 30;
PhotonNetwork.sendRateOnSerialize = 30;
}

public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
{
if (stream.isWriting)
{
stream.SendNext(transform.position);
stream.SendNext(transform.rotation);
}
else
{
this.transform.position = (Vector3)stream.ReceiveNext();
this.transform.rotation = (Quaternion)stream.ReceiveNext();
}
}
}

Comments

  • Yes that's normal, sending too much packet per second will overload the receiver. Usually you don't want to go higher than 10-12 and this is when it is action realtime game like FPS or something similar. What you need todo is to lerp from an update to another, not too send that much packet.