Manual actor/world physics simulation tick

Hi everyone,

I’m prototyping a custom multiplayer system with a mesh of game servers, a replication server (only handles data) and state interpolation for the clients. Currently using UE 5.3 built from source.

With the awesome features that Unreal has I would like to use the built-in systems (apart from the networking) as much as I can, so think character movement component and the chaos vehicles for example.
So far things are working great as far as the custom mesh goes (replication, authority transfer etc).

Where I’m running into issues, is when a player changes their input on an actor that they control. Let’s use a vehicle as an example.
Imagine they’re driving along in their vehicle and now begin to apply steering input to the left. The server has already simulated a few updates ahead and transmitted these to the client (so that we have some data buffered in case of high latency for the client) in order to have a buffer locally (that would be correct if nothing changes in the object’s trajectory/state). These buffered updates are now incorrect both on the server and on the client because of the input change, so in this situation we’d like to re-simulate (using the new state values) the out of date updates on the server and push those to the client. So in my head that would be placing the actor back at the point where the state changed, set the new state values and then advance the physics simulation forward by the required amount of steps/deltatime.

I haven’t been able to find any way to execute manual physics updates for an actor using the built-in physics system. While I did stumble across some similar threads, everything I could find was either very old (pre-UE5) or had no resolution.

If manually simulating a single actor isn’t possible, perhaps is there a way to simulate a copy of the entire physics world / a subset of relevant actors that I put into a separate physics world? In that case maybe I can have the server re-simulate the entire/a subset of physics world and pull the updated data from there.

Any input would be appreciated. I’ve been messing around with this for so long that I may have ended up with tunnel vision, so outside input could be refreshing.

Thanks for your time!

Anyone? I’ve explored other options in the meantime, asked around, but still unable to figure out a solution to this.

As a tl;dr for my initial post, I am basically searching for a way to ‘fast forward’ physics simulation.
Functionality similar to the Physics.Simulate(float step) in Unity, which one can use to advance the physics simulation ahead.

No chance you could settle for letting physics run normally but slow down everything else instead, right? Because that’s how time dilation works. Sadly, it does not affect physics simulation. What you’re asking about was not possible out of the box under UE4’s physX implementation. Not entirely sure what Chaos has to offer in this regard.


However. You can set Global Time Dilation which does affect everything, and then override instances’ dilation:

Above, the world (including the physics sim) runs 4 times as fast but the Pawn is slowed down to a quarter speed. Perhaps you could leverage it somehow.


Almost certain this is not gonna cut it :expressionless:

1 Like

Thanks! It’s certainly worth investigating.

I think I’ve read that PhysX had a way to advance the simulation for an entire physics scene, but as I’ve never actually developed within UE with PhysX I’m not sure how accurate that statement is.

If ticking a separate physics/world would somehow be possible I think that would suffice as well (seeing as I could proof-of-concept this specific behaviour with the Unity Physics.Simulate, which advances the entire world).

This is an experimental feature (at least in UE v5.3) so tread with caution:

Once enabled, we can use Async Tick to drive physical updates (adding force every tick (but not necessarily frame!)):

image

In other words, it lets you run updates in a separate thread with a fixed interval unaffected by the world delta seconds.


Now, the experimental Tick Physics Async applies it to the actual existing simulation:

I’ve been using Async Tick for months now and it’s a blessing. Not sure how well the experimental part works, though - may be worth checking it out. There are features around that are wildly undocumented. I hope I’m not mixing things up.

That sounds promising, though I’m not entirely sure how I can achieve something like:

  • Set chaos vehicle back to a state in the past (position/velocity/engine inputs etc, pulled from a set of structs that hold these state snapshots)
  • Simulate the physics back to ‘now’ from that point in the past (however many seconds/steps that may be, let’s assume for this example that we know exactly how many times we need to trigger the simulation with the fixed deltatime)

Because that’s the root of the problem that I’m trying to solve. To update the physics simulation for an X number of steps (assuming each step has a fixed time) within a single call.

I can try to give a more specific/detailed example, but I want to avoid burying you or anyone that might stumble upon this thread in a huge pile of text like I did in my initial post :joy: