Multiplayer, replication getting past the limit of AI bots

Despite this thread being active from 2016-2020, I think this is a timeless issue, and it might be helpful to have a reply here for people struggling with it.

There are two typical issues that one runs into trying to increase the number of replicated actors (whether AI or player controlled).

  1. The first is that, by default, Actors are replicated in really general and simple ways that are not network optimized. Just beacuse you made an AI “just wander around” does not mean it is taking less replication bandwidth. There are ways to optimize networking to control the priority of different Actors, making actors far away or less important receive less frequent updates. This article is a pretty clear overview of the concepts:

How Epic Games optimized Unreal Engine for Fortnite Battle Royale ? | by Sagar | Medium

This type of optimization uses plugins like the Significance Manager and Replication Graph, which you must customize for your project with C++ code.

The Significance Manager | Unreal Engine 4.27 Documentation

Networking in 4.20: The Replication Graph | Feature Highlight | Unreal Engine Livestream - YouTube

Replication Graph | Unreal Engine 4.27 Documentation

  1. The second is related to custom movement and movement prediction. The built-in hardcoded Unreal movement component handles network replication and movement prediction for you, but only for the built-in actions. However, as soon as you start writing custom movement actions in blueprints and animations, your blueprint code does not have movement prediction logic in it. You won’t notice this problem when you test locally, because there is near zero latency between game instances running on your local machine. However, in the “real world” games will always have 10-70ms minimum latency, and without movement prediction logic, server authorative movement will have rubberbanding. Here is a video overview of the issue:

You NEED this if you want to make a multiplayer game in unreal - YouTube

There are a few strategies to fix this, depending on the game requirements. One method is to use client-authoratitive movement, which doesn’t create the rubberbanding of client->server->client prediction conflicts. However, doing this makes it possible for clients to “cheat” movement.

Some users have had success with an (expensive) marketplace compoenent called GMC which claims to make it easy (or easier) to handle movement prediction for blueprint authored custom actions. (disclaimer: I have no experience with this component, and no ties to it’s author)

GMCv2 - Advanced Locomotion & Network Prediction Framework in Code Plugins - UE Marketplace


Whenever this topic of large enemy AI count is discussed, the idea of deterministic simulation tends to come up. This is a strategy where one sends initial positions for actors, with a psudorandom seed, and all clients, because they are running the same code, can simulate all actors deterministically without network traffic. Only action commands are sent. Starcraft 2 is an example of a game using this strategy, which is more formally called Deterministic State Simulation, or Lockstep Detemrinistic State Simulation.

Unreal Engine does not support deterministic simulation. For most of it’s life, Unreal Engine did not support fixed-timestep, a necessary element to providing determinism. (There is a forum discussion about why UE4 didn’t support fixed physics timesteps that may be helpful.) We’ve been told that one of the goals of UE5 Chaos physics is to support networked physics and rollback, and there have been some dribbles of progress on this, but I’m not sure the current state.

The game Stormgate uses UE for rendering, and deterministic networking, but they did it by implementing their own completely custom physics and networking engine that replaces UE physics and networking.

Using the default UE physics and networking, for larger networked actor count, one is shooting for a hybrid of Significance weighted server->client update rates, and some client-side prediction/simulation to fill in the gaps.

For anyone who got this far, these videos may also be helpful and/or entertaining, and are related to the topic of larger actor counts in Unreal rendering and networking:

Simulating Large Crowds In Niagara | Unreal Engine - YouTube

Optimizing UE4 for Fortnite: Battle Royale - Part 1 | GDC 2018 | Unreal Engine - YouTube

Large Numbers of Entities with Mass in UE5 | Feature Highlight | State of Unreal 2022 - YouTube

Also interesting is this Epic Mega Grants backed Masters Thesis investigating what “next generation multiplayer games” might look like. It covers the networking topics here and more.

Next Gen Networked Games - Games as a medium (Episode 1) - YouTube

Next Gen Networked Games - Networking Physics / Lockstep VS State sync (Episode 2) - YouTube

1 Like