Dedicated server is always simulating skeletal physics on the PhysX level, no matter how bEnablePhysicsOnDedicatedServer is set

Version: 4.4.3-0+UE4

By default, physics simulation of a SkeletalMeshComponent is disabled on a dedicated server, so as to save resources. It can be enabled by setting USkeletalMeshComponent::bEnablePhysicsOnDedicatedServer=true (see Enabling SkeletalMeshComponent physics on a dedicated server can fail subtly, leading to erratic behavior - World Creation - Unreal Engine Forums for some issues). However, PhysX is internally simulating the skeleton no matter how this flag is set: bEnablePhysicsOnDedicatedServer has no effect on PhysX level.

This can be seen by connecting the engine to the PhysX Visual Debugger (PVD) and looking at the PhysX’s internal scene with bEnablePhysicsOnDedicatedServer left at it’s initial default value (false):

UE: the skeleton stays still

PhysX: the skeleton stays still, but accumulates gravitational velocity (thus, PhysX must be simulating it. it doesn’t move due to UE constantly overwriting the transformations of the skeleton’s PhysX bodies.)

If physics simulation is enabled at a later point (skel->bEnablePhysicsOnDedicatedServer=true; skel->SetSimulatePhysics(true)), then the skeleton will immediately start falling at a high speed, due to the accumulated velocity.

(I did not take a look whether the accumulated velocity is visible also on the UE level; I stumbled on this by accident while tracking a different issue in PVD.)

@oricohen: You seem to be working on this topic and might want to take a look at this?

Hey hiili,

I’m looking into this issue right now (and some of the others you’ve reported). Do you know if this happens in any later version than 4.4.3?

Hi Jonathan,

I just tried this out in 4.5.0 and it seems that this issue has been fixed! :slight_smile: With server physics off, a representation of the ragdoll is still created on the PhysX level (by design?), but the ragdoll does not anymore accumulate gravitational velocity. Also, it is now shown as blue in PVD (meaning disabled, I guess?) until I enable server physics (skel->bEnablePhysicsOnDedicatedServer=true; skel->SetSimulatePhysics(true);), at which point it turns green and starts to gradually fall with no incorrectly accumulated initial velocity.

I re-checked this in 4.4.3, although with a slightly different setup. The ragdoll is green in PVD all the time (and accumulates gravitational velocity) even when server physics are off.

Just out of curiosity, please share if you know anything about which change might have fixed this? Thanks! :slight_smile:

I don’t know which change fixed this issue - there were a LOT of changes in 4.5!

I’m looking into your other unanswered issues, as well - does this solve any of those?

I don’t think so, as they are not directly related. :confused: I know that at least the off-by-90’ issue is still present in 4.5.

Okay, I’ll keep looking into those.