| Home Page | Recent Changes | Preferences

Replication Block

The replication block specifies which of the variables and/or functions declared in a class are replicated. It is optional and only variables and functions mentioned in this block are actually replicated. Variables of a class that aren't mentined are initialized with their default values on clients.


   reliable/unreliable if ( replication condition )
     variables or functions;

The replication condition is a boolean expression which tells the engine when something should be replicated to a remote machine. You can call functions here, but it really isn't recommended because it will slow things down and can cause undesireable results.

The variables or functions are a comma-seperated list of variables or functions that must be declared in this class for the first time. You can't (re)define replication conditions for a superclass's variables or functions.

Reliable/unreliable tells how the replication behaves in case of packetloss. Reliable replication is guaranteed to reach the remote machine even with packetloss, while unreliable replication isn't.

Within the replication block there can be multiple lists of variables and functions, each with its own reliability and replication condition. However, each variable and function may appear in only one of the lists.


Let's have a look at a typical replication block:

  reliable if ( Role == ROLE_Authority )
    RemainingMinute, bStopCountDown, GameEndedComments,

  reliable if ( bNetInitial && (Role==ROLE_Authority) )
    GameName, GameClass, bTeamGame, ServerName, ShortName, AdminName,
    AdminEmail, Region, MOTDLine1, MOTDLine2, 
    MOTDLine3, MOTDLine4,RemainingTime, ElapsedTime;

This one defines two groups of replicated variables in the GameReplicationInfo (UT) class. Here you can already see the most important part of a replication condition, the actor's Role. Either the Role or the RemoteRole is always present in a replication condition.

Variables can only be replicated from the authorative version of an actor (i.e. from the server) to the clients. These replication conditions can become quite complex if it helps saving bandwidth, as this example from the Actor (UT2003) class shows:

  unreliable if ( (!bSkipActorPropertyReplication || bNetInitial) && bReplicateMovement
      && (((RemoteRole == ROLE_AutonomousProxy) && bNetInitial)
          || ((RemoteRole == ROLE_SimulatedProxy) && (bNetInitial || bUpdateSimulatedPosition)
              && ((Base == None) || Base.bWorldGeometry))
          || ((RemoteRole == ROLE_DumbProxy) && ((Base == None) || Base.bWorldGeometry))) )

So whether the location of an actor is replicated depends on the actor's RemoteRole and whether bReplicateMovement is True. The bSkipActorPropertyReplication can be used to cut down replication of actor class variables to only the initial replication.

Useful Replication Properties

Variables only valid during replication

True if we're client-side demo recording and this call originated from the remote.
This machine is currently recording a clientside demo.
This machine is currently recording a demo.
True during the first time all variables are replicated for this actor.
True when the replication target is this actor's Owner.

Only UT

Player collides with/feels it in network play.
Player hears it in network play.
Player sees it in network play.
True if this is a Pawn (UT) and simulated proxy.

Only UT2003

Demo recording driver owns this actor.
True when a property was changes since the last time it was replicated.
Actor is currently relevant. Only valid server side and only when replicating variables.
The remote machine is currently recording a demo.
during replication, set to the playercontroller to which actors are currently being replicated
during replication, set to the viewtarget to which actors are currently being replicated

Other Useful Variables


If True, AmbientSound and animations are replicated also to the owning client.

In UT2003

These properties are used in the Actor class replication block.

Don't replicate the Mesh.
Whether SimAnim should be replicated.
Whether the Instigator should be replicated.
Whether properties relevant for movement like Location, Rotation, Velocity, etc. should be replicated. Unlike bSkipActorPropertyReplication this also affects the initial replication.
Used by ReplicationInfo classes that don't need to know all the Actor class properties on the clients. When set to True only the initial replication replicates the Actor class properties.
Whether the actor's Location, Rotation and Velocity should be updated for Simulated Proxies.

Related Topics

Category Tutorial

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands


Mapping Topics

Mapping Lessons

UnrealEd Interface


Scripting Topics

Scripting Lessons

Making Mods

Class Tree


Modeling Topics


Log In