Hi,
I am making a Multiplayer Shooter game. For now, to the extent of my knowledge, data can be sent in two ways - Stream and RPCs…For now, I use stream to sync the movement across the network. Now, I have an idea to use RPC to move the player… like get input and call an RPC function to move. Now how accurate are RPCs? Will they cause more problems? Which is better?
Thanks
RPC always reliable. It’s slowly than unreliable. For sync movement use stream with “unreliable on change” option.
data can be sent in two ways - Stream
and RPCs
They all use one queue. See PhotonHandler class.
protected void Update()
{
currentMsSinceStart = (int)(Time.realtimeSinceStartup * 1000);
if (currentMsSinceStart > this.nextSendTickCount)
{
bool doSend = true;
while (PhotonNetwork.isMessageQueueRunning && doSend)
{
// send RPC and Stream data
doSend = PhotonNetwork.networkingPeer.SendOutgoingCommands();
}
// PhotonNetwork.sendRate
this.nextSendTickCount = currentMsSinceStart + this.updateInterval;
}
}