In this lesson, you will learn how to architect a holistic networking layer that dynamically throttles replication intensity based on real-time bandwidth availability to maintain simulation integrity.
Balancing Fidelity and Throughput
When your game enters a high-intensity state—such as a large-scale battle with physics-based interactions—sending every property update at maximum NetUpdateFrequency will lead to packet loss and buffer bloat. A bandwidth-aware system acts as a "traffic controller," adjusting the granularity of data sent to clients based on the current NetDriver congestion levels.
Rather than relying on fixed replication settings, you should implement a controller that monitors the UNetConnection::GetAverageOutRate() and adjusts your gameplay systems accordingly.
Dynamic Replication Logic
The core strategy is to implement a tiered replication priority system. You can define a "Replication Governor" that iterates through your actors and scales their NetUpdateFrequency based on their importance and the total network load.
void AGameNetGovernor::UpdateReplicationPriorities()
{
float CurrentBandwidth = GetNetDriver()->GetAverageOutRate();
float LoadFactor = FMath::Clamp(CurrentBandwidth / MaxAllowedBandwidth, 0.f, 1.f);
for (AActor* Actor : TrackedActors)
{
// Reduce update frequency as bandwidth threshold is reached
float AdjustedFrequency = BaseFrequency * (1.f - (LoadFactor * 0.5f));
Actor->SetNetUpdateFrequency(AdjustedFrequency);
}
}
Implementing Adaptive Detail
Beyond just frequency, your system should prioritize "essential" state data over "cosmetic" data. Use Custom Network Relevancy Predicates to prevent cosmetic actors (like ambient debris) from replicating at all when bandwidth is constrained, while keeping player character movement data high-priority. By combining Delta Compression for heavy structs and aggressive throttling for non-critical visual actors, you ensure that the server remains authoritative and stable even during spikes in activity.
This approach transforms your network code from a static configuration into a responsive, self-regulating ecosystem that degrades gracefully rather than collapsing under pressure.
Key Takeaway: A bandwidth-aware system dynamically scales actor update frequencies and replication relevance based on real-time network throughput, prioritizing critical game state over cosmetic detail during periods of congestion.