Skip to main content
Version: Next

Property Replication vs RPC: Choosing Under a Bandwidth Budget

Most networking problems are not "the API was called wrong" but "the wrong channel was chosen": state that should be replicated is sent as an RPC, and one-shot events are replicated every frame. This article puts both channels inside the same bandwidth budget — do the arithmetic first, then talk about style.

The property names and functions referenced here are stable interfaces of the UE5 networking layer. Default values and quantisation rules change between versions; check NetDriver.cpp and Engine/NetSerialization.h in the version you actually build.

The semantic difference​

DimensionProperty replicationRPC
What it carries"what it is now""what just happened"
Reliabilityunreliable, but the next update self-correctsoptional; reliable is not free
Cost of lossone frame of stale valuethe event is gone forever
Orderingper property, later write winsreliable RPCs are ordered, unreliable ones are not
Cost modelscales with change frequencyscales with call count
Typical misusereplicating a health number every framesynchronising position via RPC

The rule is one sentence: anything that converges on a final state belongs to replication; only instantaneous, non-reconstructable events belong to RPC. Position, health and state enums converge. Firing, one-shot effects and interaction requests do not.

Cost a single actor first​

Replication cost is not "how many bytes a property is", it is size × update frequency × relevant clients. Order-of-magnitude estimates:

TypeUnquantised sizeNote
bool1 bitmultiple bools pack into one update
uint8 / enum1 bytethe underlying width matters; do not use int32 for state
float4 bytesquantise to uint16 when precision allows
FVector12 bytesdefault precision is wasted on distant objects
FRotator12 bytesfacing often needs only yaw
structsum of members + overheadsplitting fields with individual conditions is often cheaper

Concrete example: 200 NPCs, 40 bytes each per update, NetUpdateFrequency at 2 Hz.

200 × 40 B × 2 /s = 16000 B/s ≈ 15.6 KB/s

That looks small, but it is one actor class only. Add the movement component, montage state and replicated gameplay abilities and the same crowd easily exceeds 100 KB/s downstream — while a 64-player server typically budgets tens of KB/s per client. The first optimisation is always lowering frequency and cutting fields, never a better compressor.

Relevancy: the cheapest optimisation available​

The networking layer already only replicates actors that matter to a connection. Every tightening here is an order-of-magnitude change:

ToolEffectPrice
NetCullDistanceSquaredstops replicating beyond a distancepop-in at the boundary
bOnlyRelevantToOwnersend to the owner onlynobody else sees it; fine for private items
bNetUseOwnerRelevancyinherit the owner's relevancythe usual choice for vehicles and pets
NetDormancystop updating while static; FlushNetDormancy() wakes itforget to flush and it never moves again

NetDormancy is the most overlooked item. NPCs idling in a queue are static; putting them in DORM_DormantAll and flushing only when they actually start moving beats any compression tweak. It is also the easiest to break: switch to dormant, forget the flush, and clients see an NPC frozen in place while the server believes everything is fine.

Conditional replication: declare what should not be sent​

Every replicated property is registered in GetLifetimeReplicatedProps, where conditions can be attached:

void AVMAvatarCharacter::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);

// sent once at channel open: data that never changes again
DOREPLIFETIME_CONDITION(AVMAvatarCharacter, MeshVariantId, COND_InitialOnly);

// owner only: exact health for me, a percentage for everyone else
DOREPLIFETIME_CONDITION(AVMAvatarCharacter, Health, COND_OwnerOnly);

// skip the owner: it is already predicted locally
DOREPLIFETIME_CONDITION(AVMAvatarCharacter, MoveState, COND_SkipOwner);

// use the NOTIFY variant when a callback is required
DOREPLIFETIME_CONDITION_NOTIFY(AVMAvatarCharacter, TeamId, COND_None, REPNOTIFY_Always);
}
ConditionMeaningCommon trap
COND_Nonedefault: every relevant connectioneasiest way to waste bandwidth on owner-only data
COND_InitialOnlyonce at channel openchange the value later and clients never learn
COND_OwnerOnlyowner onlyreconnecting owners must redo initialisation
COND_SkipOwnereveryone but the ownerthe owner must predict, or it sees nothing
COND_SimulatedOnlysimulated proxies onlyautonomous proxies rely on prediction
COND_Customdecided in PreReplicationa wrong decision silently stops replication

PreReplication is the place for "send only when in this state":

void AVMAvatarCharacter::PreReplication(IRepChangedPropertyTracker& ChangedPropertyTracker)
{
Super::PreReplication(ChangedPropertyTracker);

// lock-on details only matter in combat
DOREPLIFETIME_ACTIVE_OVERRIDE(AVMAvatarCharacter, LockOnTargetId, bInCombat);
}

Priority and update rate: queueing inside a fixed budget​

When there are more relevant actors than fit in one update, the layer sorts by NetPriority to decide who goes first. This decides who is deferred under congestion; it does not change total bandwidth.

ParameterTypical defaultGuidance
NetUpdateFrequency100 Hzplayers 20–30, NPCs 2–5, static props 1 or dormant
MinNetUpdateFrequency2 Hzthe floor under congestion; 0 means distant actors stop updating
NetPriority1.0players > engaged NPCs > queued NPCs
ForceNetUpdate()—push immediately on a state change instead of waiting a cycle

A practical combination: NPCs idle at NetPriority = 0.5, NetUpdateFrequency = 3; on entering an interaction with a player, raise to NetPriority = 2 and ForceNetUpdate(), then drop back. Bandwidth goes where the player is looking.

The price of RPC is the word "reliable"​

A reliable RPC enters the channel's reliable buffer and stays until acknowledged. Therefore:

  • call rate above the round-trip rate means the buffer only grows
  • an overflowing buffer drops the channel (the log shows a reliable buffer overflow style error); the player experiences a disconnect
  • sending reliable RPCs from Tick is the classic mistake: the higher the frame rate, the faster the connection dies
ScenarioRight choice
Position every framereplication (COND_SkipOwner) plus client prediction
Firing / hit eventsunreliable RPC with server validation; losing one is acceptable
Interaction requests (must arrive)reliable RPC, but rate-limited
Commands that must take effectreliable RPC with idempotent server handling
Many small eventsbatch into one RPC, or promote to replicated state

A reusable decision path​

  1. Does this data converge on a final value? Yes → replication, step 2. No → RPC, step 4.
  2. How often does it change? Below 1 Hz, drop NetUpdateFrequency to match.
  3. Does every client need it? No → add COND_OwnerOnly / COND_InitialOnly / distance culling.
  4. What if the event is lost? Only a missing effect → unreliable. Game logic broken → reliable, and check the call rate.
  5. Finally capture packets and confirm the per-client downstream fits the budget, instead of "it does not feel laggy".

Common mistakes​

PatternSymptomCorrect approach
RPC for positionjitter at high latency, teleport after packet lossreplication plus client prediction
Reliable RPC every framedisconnect after playing a whileunreliable, or batch and throttle
Replicating an FString nametens of constant bytes every updatea uint8 index into a data table
Forgetting FlushNetDormancyNPCs frozen on clientsflush explicitly on state change
int32 for a state enum3 extra bytes × rate × playersuint8 with UENUM(BlueprintType)
Testing on localhost onlyPIE has zero latency and hides everythingsimulate with Net PktLag=100 and similar

The last row matters most: on a LAN or in local PIE, replication problems barely surface. A scheme only counts as verified once it survives 100 ms latency with 5% packet loss.