Ordering question about RPC and replication


I have a few questions about execution order on RPC and replication,
1, Will RPC receiving order keep the same as sending? example like below
Server send RPC1, RPC2 to client ActorA, RPC3, RPC4 to client ActorB, what will be the possible order on the client side? can RPC3 come back earlier than RPC1?

2, With the same set of the replication settings, the fieldA and fieldB on single Actor are ordering update, can fieldB update faster than fieldA?

Many thanks.

Hi GollumCN,

As I know the RPCs sent to the same client are guaranteed by order, but not guaranteed for different clients. And replication is not guaranteed either.

I have some interesting found on RPC part, it looks like can not guarantee with multi Actors cross two network machine, this does not happen if you try to run two instance on single machine.

ONLY Reliable RPC’s will garauntee order, and ONLY for the same actor. Connections do not matter. Note that they do not neccesarily arrive in order, but they will be processed in order.

  • Calling ReliableRPC_1 and ReliableRPC_2 on Actor_A, will always execute in the same order they were called.
  • Calling ReliableRPC_1 on Actor_A and ReliableRPC_2 on Actor B, they may execute in any order, regardless of how they were called.

Unreliable RPC’s do not garauntee order, even on the same actor. Reliable RPC’s cannot be dropped, as if they are dropped the client will be kicked anyway.

Property replication does not garauntee any order, even on the same actor. This is because property replication is lossy, you will not receive every change made to a property, only it’s final state.

Quote from an old document of UDK (UE3):

Within an actor, multiple reliable functions are guaranteed to be called on the remote machine in the same order that they were called on the local machine.

Just FYI. (UDK | FunctionReplication)

@TheJamsh , Thank you, what you saying is exactly the things I learn from my test cases, even the UE source code looks like the RPC message will go to the network layer kind of straightforward, but the result cross two network machine for two Actors are unordered, I didn’t check the network part, I think there is possible more logic in it.
@TIANMIN Thank you, do you have the case for multi Actors?

RPC calls between different actors do not garauntee any order on the receiving end, reliable or not. No exceptions to that rule.

Totally agree, thank you very much for the helps.