FPhysicsReplication

Hi,

I’m trying to implement network prediction on PhysX based pawns for a long time without any success. Recently, I found a class called FPhysicsReplication which might help. I’m trying to investigate how it’s been used, but, I could not find any examples. Is this class newly added in UE 4.20? Is there any smoothing inside this class?

Thanks.

Prediction and Replay is borderline impossible for PhysX, because you can’t simulate objects individually. You have to simulate the entire scene, or nothing at all.

So far as I can tell this class is purely to make physics object replication smoother. It checks to see if a physics body is moving towards the desired transform, and if it isn’t, it accumulates error until a threshold then “snaps” the body to the authority position. It also looks quite experimental.

Hey, thanks for the reply. I saw your work on that. Well I managed to create a separate replay scene for replay, but the problem is you just tick your own actor without any collisions, which creates a huge problem. Do you think this is impossible in UE4? State replication only causes huge discrepancies in dedicated server mode. Is there any sample code for FPhysicsReplication? I did not find any inside Engine source code.

This sample simply finds actors in a buffer with radius and simulates the actor with found actors:

Is it a final solution: NO, but worth trying. Btw, in your example, I could not realize where to perform smoothing.