Follow UE Fest Stockholm on Physics Replication LOD

Hey,

Following up on UEFest conferences on physics prediction and the release of 5.7 we’ve been working on resimulation with promising results.

We’d like to start prototyping with PhysicsReplicationLOD to manage interactions between objects set to resimulation and other set to predictive interpolation.

Would it be possible to get an early version of this system while waiting for 5.8 to start fiddling with it?

Thank you,

Cheers

Nicolas

[Attachment Removed]

Steps to Reproduce[Attachment Removed]

Hello Nicolas, the PhysicsReplicationLOD is available in UE 5.7, though as you know it’s not completed and it has issues, it has not seen active development since late 2024 but plans are to make it work properly during 2026.

To start using it you need to run physics replication with Resimulation and Predictive Interpolation which it sounds like you do.

To enable it you do this:

  1. Project Settings -> Physics -> Replication -> Enable Physics Replication LOD
  2. Create a UNetworkPhysicsSettingsDataAsset if you don’t already have one and tick the box: Focal Particle in Physics Replication LOD
  3. Add a NetworkPhysicsComponent to your pawn and link to the DataAsset

This will make the autonomous proxy of your pawn a “focal point” in the Physics Replication LOD.

At this point the Physics Replication LOD should take control over the replication mode of all objects except the focal point(s) which should be left at Resimulation.

There are settings in the project settings as mentioned above and if you hover over them they have some valuable descriptions.

There are also CVars here under the tag: p.ReplicationLOD.

The logic is inside PhysicsReplicationLOD.h / .cpp

PhysicsReplication.h / .cpp is calling into the LOD system to query which mode should be used, done through FPhysicsReplicationAsync::ApplyPhysicsReplicationLOD()

It can be a bit tricky to understand how it performs the LOD, I’m going to write a tutorial later when I’ve finished the logic, but there are some visualizations if you enable these:

p.Chaos.DebugDraw.Enabled 1

p.ReplicationLOD.DrawDebug.Enabled 1

p.ReplicationLOD.DrawDebug.WorstLatency 300

The last one sets the “worst expected latency” which is not really a property used in the logic but for visualization is performs a color interpolation from Green (if I remember correct) towards Red. This represents how far behind the forward predicted time a replicated object is, Red means it’s inside the forward predicted timeline which is where Resimulation operates.

There are two spheres around the Focal Particle that appears with the debug draw enabled, the smallest one which is Red is where objects start replicating with Resimulation. Blue is where objects are fully forward predicted but still running Predictive Interpolation, note that this is NOT where the transition from the interpolated timeline to the forward predicted timeline happens.

There is no hard limit to when the transition starts happening for objects, it depends on how far behind the forward predicted timeline they are replicated (which is dependent on your network latency).

The transition is handled by the setting “TimeOverDistance”.

Example 1:

Say that you have 100ms one way latency, i.e. Predictive Interpolation normally runs 100ms behind the forward predicted timeline.

TimeOverDistance = 0.15 ms/cm

Distance for Full Prediction = 200

The object is 1000cm away from the focal particle.

1000-200 = 800

800 * 0.15 = 120ms

The object should be replicated 120ms behind the forward predicted timeline, but we receive data from the server 100ms behind it so we clamp it to 100 and let predictive interpolation runs in its organic timeline.

Example 2:

Say that you have 100ms one way latency, i.e. Predictive Interpolation normally runs 100ms behind the forward predicted timeline.

TimeOverDistance = 0.15 ms/cm

Distance for Full Prediction = 200

The object is 400cm away from the focal particle.

400-200 = 200

200 * 0.15 = 30ms

The object should be replicated 30ms behind the forward predicted timeline, Physics Replication gets this time from the LOD system and extrapolate the target state from 100ms to 30ms behind the forward predicted timeline and then runs Predicitive Interpolation based on the new extrapolated target state.

Replicating based on an extrapolated target does introduce some issues, which is what the main problem with the system is, so objects that you look at while they are inside the transitional area replicate a bit worse than they should at the moment.

[Attachment Removed]