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

Profiling Network Traffic with Unreal Insights

Utilize the Network Profiler and Unreal Insights to identify bandwidth-heavy actors and optimize property replication frequency for better performance.

In this lesson, you will learn how to leverage Unreal Insights to pinpoint bandwidth-heavy actors and optimize property replication frequency to keep your network traffic within budget.

Identifying Bottlenecks with Network Insights

While NetDriver configuration sets the limits, Unreal Insights provides the granular visibility needed to see exactly which actors are consuming your bandwidth. After capturing a trace during a multiplayer session, open the Network Insights window. This view visualizes packets over time, allowing you to filter by specific NetGUIDs or actor classes.

Look for spikes in the "Packet Size" timeline. By clicking on a peak, you can drill down into the Actor/Property breakdown. If a specific ACharacter or AActor appears repeatedly as a high-consumer, you have identified a candidate for optimization.

Optimizing Replication Frequency

Once an actor is identified as a bottleneck, you don't necessarily need to stop it from replicating; you just need to replicate it smarter. If an actor’s properties don't change every frame, ensure you are not forcing constant updates.

For actors with high-frequency but non-critical updates, utilize NetUpdateFrequency in your actor’s constructor or defaults:

// Within your Actor's constructor
NetUpdateFrequency = 10.0f; // Reduces updates from default (usually 100) to 10 times per second
MinNetUpdateFrequency = 2.0f;

Additionally, review your GetLifetimeReplicatedProps. If you have large structs or frequently changing properties, verify that you are using DOREPLIFETIME_CONDITION to restrict updates based on ownership or relevance:

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

    // Only replicate this property if the owner is the client, saving bandwidth for others
    DOREPLIFETIME_CONDITION(AMyActor, HighBandwidthData, COND_OwnerOnly);
}

By cross-referencing your Insights trace with these conditions, you can verify that the data spikes disappear from the timeline, confirming your optimization was successful. Always aim to balance the "freshness" of the client's state with the physical constraints of the network connection.

Key Takeaway: Use Unreal Insights to identify "noisy" actors contributing to bandwidth spikes, then utilize NetUpdateFrequency and DOREPLIFETIME_CONDITION to strictly gate data flow to only what is necessary and relevant.