RPC vs Reliable Delta Compressed

Hey guys ;)

I'm working on a project using Photon Cloud. Was wondering about when do I need to use RPC/Reliable/Unreliable data.

With my understanding, I trigger one time events with RPCs (sound, health loss, etc.), send data subject to a lot of changes with unreliable (like position, etc), and use Reliable only when an object is subject to changes but only few times.

Am I right?

What I am trying to do right now is to send changes of a gameobject properties (a boolean to toggle the field of vision (enable/disable mesh), team assignation (enum), etc.). Those values are updated (and used to keep informations about the current state) whenever the masterclient makes a modification, then the corresponding methods are triggered to validate the changes.

What is the best way to send those changes please?

a) Observe using Reliable Delta Compressed and check in OnPhotonSerializeView if the values have changed, then trigger corresponding methods (is there a way to know which variables have been sent via the stream? since only changed values are sent, I would like to get which ones has in order to trigger the associated methods)

b) Use RPC to trigger those events (enable/disable sight field, switch team)

c) Use Reliable Delta Compressed to store new values, and in a Update function check if received ones are different than the current ones (doesn't sound proper)

The information that I miss is the Advantages/Drawbacks of RPCs and Reliable Delta Compressed. Which one is most likely to saturate the network, at what extends, frequency, and type/quantity of data?

Thank you in advance !



  • Tobias
    Actually, I never tested in-detail how much more data a RPC uses versus an OnSerialize call. Both should be relatively close to each other. At least since PUN 1.20 which abbreviates known RPC names to bytes.
    Delta Compression will skip any value in the stream that's not changed since last sent. If all values are identical, the whole update is dropped. There is no list of what has been skipped.
    This would be a little like sending an RPC only when something changed. The benefit here would be you could send the whole state. If someone joins the room late, OnSerialize will send a full update (ignoring deltas to previous updates which went to users in the room only).

    Using RPC could be fine, too. Even more if you send no other updates for an object.

    Unreliable is fine for any data you replace soon. Positions are just one example of data that's often updated. It depends on what you need to send.

    In general, your object might know best if they are updated or not and if they need to send an update. Constant updating is just the fast and lazy way to implement synchronization.
  • Dima
    Hey Tobias, thank you for your explanations!

    So, using Delta Compression or RPC is quite the same thing, but:
    - Delta compression send only what need to be sent and it knows when (it checks for eventual changes before sending it via the network)
    - RPC send the whole stuff but is more judicious if there won't be any update later that I would have to handle myself by checking values and re-triggering the RPC. Plus, with RPC I know exactly what I send and when

    Good to know, thank you again !