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?

Best Answers

  • JohnTube
    JohnTube mod
    Accepted Answer
    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.
  • JohnTube
    JohnTube mod
    Accepted Answer
    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.
  • Francesco_QGaming
    Accepted Answer
    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.

Answers

  • JohnTube
    JohnTube mod
    Accepted Answer
    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.
  • FrancescoQGaming
    edited May 5
    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?
  • JohnTube
    JohnTube mod
    Accepted Answer
    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.
  • 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?
  • I saw the TargetActor in the RaiseEvent, I will try to use this!
  • Ok, I tried to change the RPCs with the RaiseEvents, but now I have more resent :D
  • Francesco_QGaming
    Accepted Answer
    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.