Course contentsShow
← Unreal Engine Game Development
Lesson 708 of 88010. Networking and ReplicationFree lesson

Debugging Replicated Variables With Network Profiler

You will use the Network Profiler tool to identify and fix issues with variable synchronization and excessive bandwidth usage.

In this lesson, you will learn how to leverage the Network Profiler to pinpoint bandwidth bottlenecks and identify "noisy" variables that are flooding your network traffic.

Identifying the Traffic Source

When you suspect your replicated variables are causing lag or excessive bandwidth usage, the Network Profiler is your most powerful diagnostic tool. While p.NetShowPropertyDump gives you a snapshot, the Profiler records session data over time, allowing you to visualize exactly which properties are sending updates and how much data each contributes to your packet size.

To get started, enable the profiler by launching your game with the -networkprofiler=true command-line argument. Once your session finishes, you will find a .nprof file in your project’s Saved/Profiling/ folder. Open this file in the standalone Network Profiler application included with the engine.

Analyzing the Data

Inside the tool, you will see a graph showing the total bandwidth usage. To debug replicated variables:

  1. Sort by "Total Bytes": Locate the Actor causing the biggest spike.
  2. Inspect Property Breakdown: Click on the Actor to see the individual properties being replicated.
  3. Look for High Frequency: If you see a variable—like a high-precision float—updating every single frame, you’ve found a prime candidate for optimization.

For instance, if you are replicating a float for PlayerHealth every frame, but the value only changes when the player takes damage, the Network Profiler will show that constant synchronization is wasted bandwidth. You should move this to a RepNotify or a more controlled replication condition:

// Instead of constant replication, use a condition to limit updates
void AMyCharacter::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const {
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);
    
    // Only replicate if the value changes significantly (Cond_OwnerOnly or similar)
    DOREPLIFETIME_CONDITION(AMyCharacter, Health, COND_None);
}

The Profiler will then confirm if your fix worked; if the bandwidth for that property drops in the next capture, you have successfully optimized your synchronization strategy.

Key Takeaway: The Network Profiler allows you to move from guessing about network performance to data-driven optimization by identifying exactly which properties are consuming your bandwidth budget.