Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Unreal Replication?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tipoli5890-unreal-replication)
---
name: unreal-replication
description: >-
Unreal replication: Replicated and ReplicatedUsing properties, GetLifetimeReplicatedProps,
Server, Client and NetMulticast RPCs, ownership, relevancy, Iris.
---
# unreal-replication — what the server sends, and who may call what
Replication is declared in headers and registered in one function; most bugs are a property that was never registered or an RPC called from a connection that does not own the actor.
The server is the authority: it changes state and sends it to clients as replicated properties. Clients ask for changes with Server RPCs on actors their own connection owns. Every missing piece fails silently, so check the declarations before the run and test with two players after it.
## Load what the situation needs
| The situation | Read |
|---|---|
| "Should this be a property or an RPC?" | *Choose the mechanism* below |
| Adding a replicated property, a condition, a repnotify | *A replicated property* below, `reference/properties.md`, `templates/ParcelComponent.h` |
| "Clients see the default value", "the host sees no change" | `reference/properties.md` §6 |
| Adding an RPC; where a call runs; reliable or not; validation | *An RPC* below, `reference/rpcs.md`, `templates/ParcelPickup.h` |
| "The Server RPC never arrives", "the client was disconnected" | `reference/rpcs.md` §5 |
| `HasAuthority`, roles, net modes, the owner chain, relevancy, update rate | `reference/ownership-and-relevancy.md` §1 to §4 |
| "Does this class replicate at all?" | `reference/ownership-and-relevancy.md` §5 |
| Running two or more players in the editor or as processes | `reference/ownership-and-relevancy.md` §6 |
| Iris | `reference/iris.md` |
| Checking a project's declarations without the engine | `scripts/rep_lint.py` |
| Which framework class holds the state (game state, player state, pawn) | `unreal-gameplay-framework` |
| Attributes and abilities over the network | `unreal-gas` |
| Specifiers in general, `UFUNCTION` and `UPROPERTY` | `unreal-cpp-reflection` |
## Choose the mechanism
| What it is | Use | Courier example |
|---|---|---|
| State every client must see, late joiners included | a replicated property on a replicating actor | `CarriedParcels`, `bCollected` |
| A request from a player to the server | a `Server` RPC on an actor that player owns | `ServerDeliverParcel` on the pawn's component |
| A message from the server to one player | a `Client` RPC on that player's controller or pawn | "route complete" |
| A one-off cosmetic event for everyone watching now | a `NetMulticast, Unreliable` RPC called by the server | `MulticastCollectedBurst` |
| Data only the owner needs | a property with `COND_OwnerOnly` | a private route hint |
| Rules, or anything on the game mode, game instance or a subsystem | nothing replicates there: move the data | `reference/ownership-and-relevancy.md` §5 |
## A replicated property
1. **The owner replicates**: `bReplicates = true` in an actor's constructor;
`SetIsReplicatedByDefault(true)` in a component's, on an actor that replicates.
2. **The specifier**: `UPROPERTY(Replicated)`, or `UPROPERTY(ReplicatedUsing = OnRep_CarriedParcels)`
with a `UFUNCTION()` repnotify that may take the old value.
3. **The registration**: override `GetLifetimeReplicatedProps`, call `Super::` first, then
`DOREPLIFETIME(UParcelComponent, CarriedParcels)` (or `DOREPLIFETIME_CONDITION` with a
`COND_` value).
4. **The include**: `#include "Net/UnrealNetwork.h"` in the `.cpp`.
5. **Write on the server only** (`HasAuthority()`, or `GetOwnerRole() == ROLE_Authority` in a
component) and call the reaction there too: repnotifies run on clients, never on the server or
a listen-server host.
```cpp
void UParcelComponent::SetCarriedParcels(int32 NewCount)
{
const int32 OldCount = CarriedParcels;
CarriedParcels = NewCount;
OnCarriedParcelsChanged(OldCount, NewCount); // the server's reaction
}
void UParcelComponent::OnRep_CarriedParcels(int32 OldCarriedParcels)
{
OnCarriedParcelsChanged(OldCarriedParcels, CarriedParcels); // the clients' reaction
}
```
## An RPC
1. Declare it in the header with its kind and reliability:
`UFUNCTION(Server, Reliable, WithValidation) void ServerDeliverParcel(int32 Count);`
2. Define `ServerDeliverParcel_Implementation` in the `.cpp`, never `ServerDeliverParcel` itself
(the generated code defines that), and `ServerDeliverParcel_Validate` when `WithValidation` is
written. A false return from `_Validate` disconnects the caller: reject impossible input only.
3. Put it on an actor or component that replicates and that the caller's connection owns: the
player controller, its pawn, or a component on the pawn.
4. Choose `Reliable` for what must happen once (handing in parcels) and `Unreliable`, the default,
for anything frequent or cosmetic; never a reliable RPC per frame or per key press.
Where a call runs:
| Kind | Called on the server | Called on the owning client | Called on another client |
|---|---|---|---|
| `Server` | the server | the server | dropped |
| `Client` | the owning client (the server when nobody owns the actor) | that client | that client |
| `NetMulticast` | the server and every client the actor is relevant to | the caller only | the caller only |
## Failures by symptom
| Symptom | Cause |
|---|---|
| Clients keep the default value | not registered, no specifier, or the actor or component does not replicate |
| The listen-server host's display never updates | the reaction lives only in the repnotify |
| A client's change reverts or never spreads | the client wrote the property instead of asking the server |
| A Server RPC from a client does nothing | the client does not own the actor (a pickup, the game state, another courier) |
| A client is disconnected after a call | `_Validate` returned false |
| A multicast runs on one machine only | it was called on a client |
| A late joiner still sees a parcel that was already collected | the collection was sent as an RPC, not as state |
| A far-off actor vanishes on a client and comes back | relevancy, working as designed |
Causes and fixes in full: `reference/properties.md` §6, `reference/rpcs.md` §5,
`reference/ownership-and-relevancy.md` §5, `reference/iris.md` §4.
## Test with two players
Run at least two players with a listen server and with a dedicated server: in the editor's
multiplayer play options, or as separate `-server` and `-game` processes connected with
`open 127.0.0.1:<PORT>` (`reference/ownership-and-relevancy.md` §6). Check that each client sees
the other's changes, the host sees its own, and a late joiner sees current state.
## Check it without the engine
```bash
python3 scripts/rep_lint.py /path/to/CourierRun
python3 scripts/rep_lint.py /path/to/CourierRun --strict # warnings fail too
```
FAIL lines: a replicated property with no `DOREPLIFETIME*` registration, a registration for a
property without the specifier, replicated properties with no `GetLifetimeReplicatedProps`, a
`ReplicatedUsing` naming an undeclared function or one without `UFUNCTION()`, an RPC without its
`_Implementation` or (with `WithValidation`) its `_Validate`, and an RPC defined by hand. WARN
lines: no `Super::` call, the macros used without `Net/UnrealNetwork.h`, a scanned actor or
component chain that never sets itself to replicate, a reliable RPC called from `Tick`, and a
Server RPC on a game state. NOTE lines: RPC names without the prefix, RPCs that name no
reliability, and classes whose `.cpp` was not scanned. It reads no Blueprint; exit 3 means no
class that declares replication was found.
## Related skills
- Which framework class holds which state: `unreal-gameplay-framework`
- Ability-system replication and attributes: `unreal-gas`
- Input that triggers a Server RPC: `unreal-enhanced-input`
- Reflection specifiers in general: `unreal-cpp-reflection`
- Build.cs and Target.cs for Iris: `unreal-modules-build`
- The editor binary for multi-process runs: `unreal-editor-python`