Hello,
We ran into an issue trying to apply delta compression to an actor in our level. When we spawn the actor at runtime when a player has already connected, this class/actor will have delta compression applied. If it was spawned or placed in the level before any connection exists, the delta compression does not get applied.
From debugging this issue I believe I tracked the issue down.
The function FDeltaCompressionBaselineManager::UpdateScope calls AllocPerObjectInfoForObject for objects that were not previously in scope, but are in scope now. Is uses NetRefHandleManager->GetPrevFrameScopableInternalIndices() for this, this is updated in OnPostSendUpdate, done every frame at the end of the frame. AllocPerObjectInfoForObject ends up setting ObjectIndexToObjectInfoIndex, which is required for FDeltaCompressionBaselineManager::CreateBaseline to create a baseline for those delta compressed objects.
But UpdateScope is called from FDeltaCompressionBaselineManager::PreSendUpdate, which is conditionally called from UReplicationSystem::NetUpdate. The condition for this is if (bAllowObjectReplication && bUpdateConnectionSpecifics).
This condition will fail if we have no connections active.
If we have actors spawned or placed in the world, when no connections exist, they will be set in PrevFrameScopableInternalIndices at the end of the frame, without ever going into UpdateScope. Thus, the moment we receive a connection, and we enter UpdateScope, PreviousScopable already contains the actors which were placed in the world or spawned before a connection existed, and never end up calling AllocPerObjectInfoForObject because it is not considered an object that just came into scope.
To confirm this is the case I set bAllowMinimalUpdateIfNoConnections to false, so that UpdateScope is always entered when no connections exist, and this fixes the issue.
Is this a known issue, or is there a fix you can suggest to us without us needed to set the option to false?
Kind regards,
Céleste Neukirchen