In unreal’s example of a replication graph in the Shooter Project, player states are handled in a seperate node on the graph that limits the amount of Player States that return to the replication driver each frame. Here is the relevant code:
for (TActorIterator<APlayerState> It(GetWorld()); It; ++It)
{
APlayerState* PS = *It;
if (IsActorValidForReplicationGather(PS) == false)
{
continue;
}
if (CurrentList->Num() >= TargetActorsPerFrame)
{
ReplicationActorLists.AddDefaulted();
CurrentList = &ReplicationActorLists.Last();
CurrentList->PrepareForWrite();
}
CurrentList->Add(PS);
}
*TargetActorsPerFrame *is set to 2 player states per frame in the shooter project and my question is why 2?
2 states per frame seems like quite a small number for a game with let’s say 200 connections then again I feel that increasing the number will lower network performance.