Which are the causes of the resent and how they can be reduced?
I am working on the multiplayer for a project, and I saw that there are some resent when I debug using the Photon Stats GUI tool. Which are the causes of the resent? How they can be reduced?
0
Best Answers
-
Hi @FrancescoQGaming,
Thank you for choosing Photon!
Resends happen when you send something UDP reliable.
The causes are loss or delay.
Loss: the message (client to server) or ack (server to client) is lost.
Delay: the ack is received but delayed, after timeout. so we resend before it arrives.1 -
hi @FrancescoQGaming,
RPCs are reliable by design.
Also they are not meant to be called in a high frequency.
So either switch to RaiseEvent or ViewSerialization for high frequency updates.
Otherwise, send fewer RPCs less often.1 -
I managed to fix the problem in the end. I converted all my frequent events in ViewSerialization. Now I don't have any resend or very low resend.2
Answers
-
Hi @FrancescoQGaming,
Thank you for choosing Photon!
Resends happen when you send something UDP reliable.
The causes are loss or delay.
Loss: the message (client to server) or ack (server to client) is lost.
Delay: the ack is received but delayed, after timeout. so we resend before it arrives.1 -
Thank you for the answer @JohnTube !
I use the PhotonRPCs in my project, and I send, to the other players, my player information quite often, so I think this is my problem.
Is it better to add more delay between the updates of the information? Or, is there another way to solve that?0 -
hi @FrancescoQGaming,
RPCs are reliable by design.
Also they are not meant to be called in a high frequency.
So either switch to RaiseEvent or ViewSerialization for high frequency updates.
Otherwise, send fewer RPCs less often.1 -
Thank you @JohnTube !
I use the RPCs because I need to send to the single remote player my information, but the update frequency changes based on the distance between the local player and the remote one.
How can I replicate this function with the RaiseEvent/ViewSerialization?
I saw the interestGroups, but when you create a interestGroup, isn't something set up for everyone?0 -
I saw the TargetActor in the RaiseEvent, I will try to use this!0
-
Ok, I tried to change the RPCs with the RaiseEvents, but now I have more resent0
-
I managed to fix the problem in the end. I converted all my frequent events in ViewSerialization. Now I don't have any resend or very low resend.2