home / skills / a5c-ai / babysitter / unreal-networking

This skill helps you implement Unreal Engine multiplayer networking including replication, RPCs, relevancy, and dedicated server architecture across projects.

npx playbooks add skill a5c-ai/babysitter --skill unreal-networking

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
2.0 KB
---
name: unreal-networking
description: Unreal Engine networking skill for replication, RPCs, relevancy, and dedicated server architecture.
allowed-tools: Read, Grep, Write, Bash, Edit, Glob, WebFetch
---

# Unreal Networking Skill

Multiplayer networking for Unreal Engine.

## Overview

This skill provides capabilities for implementing multiplayer games using Unreal's built-in networking system.

## Capabilities

### Replication
- Configure replicated properties
- Handle replication conditions
- Manage replication priorities
- Implement custom replication

### Remote Procedure Calls
- Implement Server RPCs
- Create Client RPCs
- Handle Multicast RPCs
- Manage RPC reliability

### Authority and Relevancy
- Handle server authority
- Configure network relevancy
- Manage actor ownership
- Implement client prediction

### Dedicated Servers
- Build dedicated server targets
- Handle headless mode
- Manage server performance
- Implement session management

## Prerequisites

- Unreal Engine 5.0+
- Network knowledge

## Usage Patterns

### Replicated Property

```cpp
UPROPERTY(ReplicatedUsing=OnRep_Health)
float Health;

UFUNCTION()
void OnRep_Health()
{
    // Called on clients when Health changes
    UpdateHealthUI();
}

void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
    DOREPLIFETIME(AMyCharacter, Health);
}
```

### RPC Implementation

```cpp
UFUNCTION(Server, Reliable, WithValidation)
void Server_Fire(FVector Location, FRotator Rotation);

bool Server_Fire_Validate(FVector Location, FRotator Rotation)
{
    return true; // Add validation
}

void Server_Fire_Implementation(FVector Location, FRotator Rotation)
{
    // Execute on server
}
```

## Best Practices

1. Validate all server RPCs
2. Minimize replicated properties
3. Use relevancy wisely
4. Test with simulated lag
5. Profile network bandwidth

## References

- [Networking Documentation](https://docs.unrealengine.com/5.0/en-US/networking-and-multiplayer-in-unreal-engine/)

Overview

This skill provides practical guidance and code patterns for implementing multiplayer features in Unreal Engine, focusing on replication, RPCs, relevancy, and dedicated server architecture. It targets Unreal Engine 5+ developers who need reliable, performant networking behavior in gameplay. The content emphasizes concrete examples, common pitfalls, and performance-aware defaults.

How this skill works

The skill inspects common multiplayer tasks and presents concrete implementations for replicated properties, server/client/multicast RPCs, authority management, and relevancy tuning. It explains how to register properties for replication, validate and implement RPCs on the server, and configure actor ownership and relevancy rules. It also covers building and operating headless dedicated servers and techniques for profiling and testing under simulated network conditions.

When to use it

  • Implementing player state, health, inventory, or replicated gameplay variables across server and clients.
  • Adding authoritative server RPCs for actions like firing weapons, applying damage, or committing game state changes.
  • Optimizing network traffic for large worlds by tuning relevancy and replication priorities.
  • Building a dedicated server target for persistent multiplayer sessions or competitive servers.
  • Testing and hardening network code under latency, packet loss, and bandwidth constraints.

Best practices

  • Always validate server RPC inputs to prevent client-side cheats or invalid state.
  • Minimize replicated properties; prefer RPCs or event-driven updates for infrequent changes.
  • Use relevancy and replication priorities to limit bandwidth to only nearby or relevant actors.
  • Profile with real-world scenarios and simulated lag; measure CPU and network bottlenecks.
  • Prefer reliable multicast only when necessary; use unreliable for high-frequency, replaceable updates.

Example use cases

  • Replicate player health with OnRep callbacks to update client UIs without polling.
  • Implement a Server_Fire RPC that validates input, spawns projectiles on the server, and multicasts effects.
  • Create a dedicated headless server build that manages sessions, matchmaking, and authoritative game ticks.
  • Apply actor relevancy rules for large open worlds so distant NPCs do not consume client bandwidth.
  • Use client prediction and server reconciliation for responsive movement while keeping the server authoritative.

FAQ

Do I need Unreal Engine 5 to use these patterns?

The patterns target UE5 and later, but many replication and RPC concepts apply to UE4 with minor API differences.

When should I use replicated properties versus RPCs?

Use replicated properties for authoritative state that changes infrequently and must be consistent; use RPCs for actions, validation, or transient events.