skills/ue-network-replication-review/SKILL.md
Review network replication code for correctness including DOREPLIFETIME, RPCs, relevancy, and bandwidth optimization. Use when implementing multiplayer features, debugging replication issues, or auditing network code. Note - Lower priority for offline games. Triggers on "replication", "multiplayer", "RPC", "network", "DOREPLIFETIME", "net relevancy", "bandwidth".
npx skillsauth add sipherxyz/universal-ue-skills ue-network-replication-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Review network replication implementation for correctness and efficiency.
Note: Lower priority for offline games like Huli, but useful if multiplayer/co-op is added later.
| Check | Severity | Description | |-------|----------|-------------| | UPROPERTY Replicated | Error | Properties marked but not registered | | DOREPLIFETIME | Error | Missing GetLifetimeReplicatedProps | | Rep Condition | Warning | Inappropriate condition selected | | Rep Notify | Info | OnRep callback correctness |
| Check | Severity | Description | |-------|----------|-------------| | Server/Client | Error | Wrong execution context | | Validation | Error | Missing input validation | | Reliability | Warning | Unreliable for critical data | | Bandwidth | Warning | Large/frequent RPCs |
| Check | Severity | Description | |-------|----------|-------------| | Net Relevancy | Warning | Relevancy not considered | | Cull Distance | Info | May need adjustment | | Dormancy | Info | Not using dormancy optimization |
## Property Replication Analysis: {ClassName}
### Replicated Properties
| Property | Type | Condition | Notify | Status |
|----------|------|-----------|--------|--------|
| Health | float | None | OnRep_Health | OK |
| bIsDead | bool | None | OnRep_IsDead | OK |
| Inventory | TArray | OwnerOnly | None | Warning |
| TargetLocation | FVector | None | None | Error |
### Issues Found
#### [ERROR] Missing DOREPLIFETIME
```cpp
// Property declaration
UPROPERTY(Replicated)
FVector TargetLocation;
// NOT registered in GetLifetimeReplicatedProps()
// FIX: Add to GetLifetimeReplicatedProps:
DOREPLIFETIME(AMyClass, TargetLocation);
### Step 2: Analyze RPCs
```markdown
## RPC Analysis: {ClassName}
### RPC Definitions
| Function | Type | Reliable | Validated | Status |
|----------|------|----------|-----------|--------|
| ServerAttack | Server | Yes | Yes | OK |
| ClientUpdateUI | Client | No | N/A | OK |
| ServerMoveRequest | Server | No | No | Error |
| MulticastDamage | NetMulticast | Yes | N/A | Warning |
### Issues Found
#### [ERROR] Missing Server Validation
```cpp
// Current
UFUNCTION(Server, Reliable)
void ServerMoveRequest(FVector TargetLocation);
// Problematic - No validation
void AMyCharacter::ServerMoveRequest_Implementation(FVector TargetLocation)
{
SetActorLocation(TargetLocation); // Trust client!
}
// FIX: Add validation
UFUNCTION(Server, Reliable, WithValidation)
void ServerMoveRequest(FVector TargetLocation);
bool AMyCharacter::ServerMoveRequest_Validate(FVector TargetLocation)
{
// Validate move is reasonable
float Distance = FVector::Dist(GetActorLocation(), TargetLocation);
return Distance < MaxMoveDistance;
}
### Step 3: Analyze Network Efficiency
```markdown
## Bandwidth Analysis
### Property Bandwidth
| Property | Size | Frequency | Est. Bandwidth |
|----------|------|-----------|----------------|
| Health | 4 bytes | On change | Low |
| Location | 12 bytes | Tick | High |
| Rotation | 12 bytes | Tick | High |
| Inventory | Variable | On change | Medium |
### Optimization Opportunities
#### [INFO] Consider Quantization
```cpp
// Current: Full precision
UPROPERTY(Replicated)
FVector Location;
// Optimized: Quantized
UPROPERTY(Replicated)
FVector_NetQuantize Location; // Rounds to 1/10 unit
// Enable dormancy for static actors
void AMyActor::BeginPlay()
{
SetNetDormancy(DORM_DormantAll);
}
// Wake up when needed
void AMyActor::OnInteraction()
{
SetNetDormancy(DORM_Awake);
// Do replicated action
SetNetDormancy(DORM_DormantAll);
}
## Common Patterns
### Correct Property Replication
```cpp
// Header
UPROPERTY(ReplicatedUsing = OnRep_Health)
float Health;
UFUNCTION()
void OnRep_Health();
// Implementation
void AMyCharacter::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(AMyCharacter, Health);
// Or with condition
DOREPLIFETIME_CONDITION(AMyCharacter, Health, COND_OwnerOnly);
}
void AMyCharacter::OnRep_Health()
{
// Update UI, play effects, etc.
UpdateHealthUI();
}
// Header
UFUNCTION(Server, Reliable, WithValidation)
void ServerUseAbility(int32 AbilityIndex);
// Implementation
bool AMyCharacter::ServerUseAbility_Validate(int32 AbilityIndex)
{
// Validate input
return AbilityIndex >= 0 && AbilityIndex < Abilities.Num();
}
void AMyCharacter::ServerUseAbility_Implementation(int32 AbilityIndex)
{
// Execute on server
if (CanUseAbility(AbilityIndex))
{
ExecuteAbility(AbilityIndex);
}
}
// For large arrays that change frequently
USTRUCT()
struct FInventoryArray : public FFastArraySerializer
{
GENERATED_BODY()
UPROPERTY()
TArray<FInventoryItem> Items;
bool NetDeltaSerialize(FNetDeltaSerializeInfo& DeltaParms)
{
return FFastArraySerializer::FastArrayDeltaSerialize<FInventoryItem>(Items, DeltaParms, *this);
}
};
| Condition | Use Case | |-----------|----------| | COND_None | Always replicate (default) | | COND_InitialOnly | Only on spawn | | COND_OwnerOnly | Only to owning client | | COND_SkipOwner | Everyone except owner | | COND_SimulatedOnly | Simulated proxies only | | COND_AutonomousOnly | Autonomous proxy only | | COND_SimulatedOrPhysics | Simulated or physics | | COND_InitialOrOwner | Initial or owner | | COND_Custom | Custom condition callback |
# Network Replication Review: {ClassName}
## Summary
- **Replicated Properties**: {N}
- **RPCs**: {N}
- **Issues**: {N} errors, {N} warnings
## Property Replication
{Table of properties with status}
## RPC Analysis
{Table of RPCs with status}
## Bandwidth Estimate
- **Per-frame**: ~{N} bytes/actor
- **Peak**: ~{N} bytes/actor
## Issues
### Errors (Must Fix)
1. {Error}
### Warnings (Should Fix)
1. {Warning}
## Recommendations
1. {Recommendation}
## Checklist
- [ ] All replicated props registered in DOREPLIFETIME
- [ ] Server RPCs have validation
- [ ] No reliable multicast for non-critical data
- [ ] Large arrays use Fast TArray
- [ ] Appropriate rep conditions used
| Command | Purpose |
|---------|---------|
| net.ListActorChannels | List replicated actors |
| net.TrackReplicationGraph | Track replication |
| stat Net | Network statistics |
| net.DormancyDraw | Visualize dormancy |
development
This skill should be used when implementing features in isolation using git worktrees. Triggers on "create worktree", "isolated workspace", "parallel development", or when starting implementation that should not affect main workspace.
testing
Manage VFX team issues on GitHub Projects - timeline scheduling, status updates, member commit checks, bulk assign. Use when managing VFX team project board, adding issues to timeline, checking member progress, or bulk-updating issue fields.
tools
Generate C++ validation rules from JSON definitions. Use when team updates ValidationRules.json or asks to add/modify validation rules.
development
Check codebase for Microsoft Xbox XR (Xbox Requirements) compliance issues. Scans for account picker, cloud saves, achievements, Quick Resume, and Xbox certification requirements. Use before console submission or when preparing for Microsoft certification. Triggers on "XR", "Xbox certification", "Microsoft compliance", "Xbox cert", "Xbox requirements", "GDK compliance".