- Home /
PUN : RPCs or Stream? How reliable are RPCs?
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
Answer by rusildo · Oct 10, 2015 at 04:01 PM
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;
}
}
Your answer
Follow this Question
Related Questions
player facing lag issue or it is a sync problem ? 0 Answers
InvalidCastException: Specified cast is not valid 2 Answers
Photon Server Issue 0 Answers
In photon, how to enable Unity's Ui only for the player how triggered it 1 Answer
I am trying to hide my player from others using Photon Unity. 0 Answers