Hi,
I’m looking into a bug with our game where replicated actors become net relevant before world partition streaming completes.
To give a high-level summary of the setup:
- It’s a networked game using a dedicated server instance.
- We make use of World Partition to stream the Level on Client. Entire world is loaded on Server.
- For network relevancy we make use of the replication graph. The affected actors are part of a 2D Spatialized Dynamic node(not sure if relevant, better to mention it).
This doesn’t always cause issue but when the following conditions are met on the server:
- The replicated actor also replicates movement/transform.
- The actor is “at rest”, standing on terrain.
- It is a dynamic or kinematic body affected by gravity.
and the actor then becomes net relevant to the client:
- Receives and instantiates the replicated actor.
- The world partition cell which the actor is in haven’t loaded yet.
These conditions lead to a situation (as far as I can tell) where the client simulates physics on the actor, resulting it in falling down. Since there is no ground to catch it, it continues falling. At the same time the server instance is at rest, resulting in no movement updates (and by extension, no corrections). This leads to the actor representation de-syncing between client and server.
Typing it out like this it feels like a common issue that can happen with any dynamic/kinematic actor where networking and world partition are involved. We don’t know of any or have found any engine-level systemic solution to this problem and so we are compelled to ask: Is this actually a natural race condition in the engine? Or is it possibly something we have done incorrectly with our setup of world partition and the replication graph?
--Current Work-around--
That said we have a “work around” of the server replicating the sleep state to the client and the client then temporarily disabling simulation for the actor if it is “sleeping” and surrounding world partition isn’t loaded yet. We can apply this generally to dynamic actors but we want to hold off on committing until we know whether we actually need to solve this ourselves or if there is something we have done wrong initially, or simply have missed the already existing solution.