So, I start looking into this.
My plan is to sync by physic sub-step tick instead of using time stamp or Delta Time.
The problem is that Unreal sub-step tick into separate thread.
I need to know thread timeline and when it synchronize back to game thread.
I’m not sure at which point game thread receives replication call back.
I also look into PhysX’s immediate mode.
This can be useful if I want to replay small-subset of physics body or fast-forward projectile such as rocket.
Nvidia open source their PhysX on github you can get invite by register as Nvidia developer and agree to their license.
In PhysX’s Immediate mode snippets, The API is very complicate.
You need to compute a lot of intermediate data and allocate aligned memory for caching.
The snippets is also very slow because it brute forces computing every possible rigid-body pair.
I’m going to experiment putting rigidbody to sleep.
http://docs.nvidia.com/gameworks/con…999aad04f27c28
Then restore velocity without waking rigidbody.
http://docs.nvidia.com/gameworks/con…104ad7f0f30c05
If this works, I will let you guys know.