Introduction
During Actor replication, two properties need attention: Role and RemoteRole.
With these two properties, you can clearly determine:
- Who has authority over the Actor
- Whether the Actor is replicated
- The replication mode
The first thing to determine is who has authority over a specific actor. To determine whether the currently running engine instance has authority, check whether the Role property is
ROLE_Authority. If so, it indicates that this running Unreal Engine instance is responsible for managing this actor (determining whether it is replicated).If Role is
ROLE_Authorityand RemoteRole isROLE_SimulatedProxyorROLE_AutonomousProxy, it means this engine instance is responsible for replicating this actor to remote connections.
Simply put:
For standalone mode, the Actor’s Role and RemoteRole are obviously both ROLE_Authority.
For the networked model, Role represents the local role for the Actor, and RemoteRole represents the remote side’s role for the Actor.
The following focuses on the relevant mechanisms in multiplayer games.
Property Types
ROLE_Authority
Represents the highest authority, usually the state held by the server.
If a client locally spawns a non-replicated Actor, its Role may also be ROLE_Authority, because in this case the client has absolute authority over this Actor.
ROLE_SimulatedProxy
A passively simulated role, controlled by the server; the client only receives replicated data.
For example, from client A’s perspective, another character’s Role may be ROLE_SimulatedProxy.
ROLE_AutonomousProxy
An autonomous proxy role, usually representing a character directly controlled by the client; the server receives control input to synchronize its state.
For example, from client A’s perspective, its own character’s Role may be ROLE_AutonomousProxy; after receiving input, it is sent to the server to update its state.
Difference Between RemoteRole and Role
RemoteRole corresponds to Role and represents the remote side’s role definition for the Actor; it is another perspective on Role.
When an Actor is ROLE_Authority on the server, its RemoteRole on the server is ROLE_SimulatedProxy, and the corresponding client’s Role is ROLE_SimulatedProxy, with RemoteRole being ROLE_Authority.
For different value observers, their Role and RemoteRole values may be swapped.
Note the word “may”
For example, for a character whose client Role is ROLE_AutonomousProxy and RemoteRole is ROLE_Authority (the one the player controls), its Role on the server is ROLE_Authority, but RemoteRole may be ROLE_SimulatedProxy.
Role Combinations
Common Combinations of Role and RemoteRole
| Local Role | Remote RemoteRole | Scenario description |
|---|---|---|
| ROLE_Authority | ROLE_SimulatedProxy | Server perspective; controls the Actor; clients only receive replicated data (e.g., NPCs). |
| ROLE_SimulatedProxy | ROLE_Authority | Client perspective; the client receives the Actor replicated from the server (e.g., static scene objects). |
| ROLE_AutonomousProxy | ROLE_SimulatedProxy | Client perspective; the client controls the Actor; the server synchronizes its state (e.g., player characters). |
Distinguishing SimulatedProxy and AutonomousProxy
Referring to the official documentation, because Actor synchronization has intervals, clients use two strategies during simulation to compensate for this limitation:
ROLE_SimulatedProxy usually simulates directly based on information replicated from the server.
ROLE_AutonomousProxy usually takes the client’s own input into account and uses that input to supplement information, rather than only extrapolating from server information.