Listen Server, clients animations are jittery/laggy

The problem is not simple because as a server you’re supposed to hold truth, and interpolation/smoothness is not the truth.
As an example scenario, lagging client might send moves packets (1,2,3) but you receive them in order (2,3,1). Server cannot advance until it has packets in order so it performs all three moves at once when it receives the first (last).

Regardless, Epic still added interpolation for sims movement on listen server, at some point :

(also controlled by this Cvar, which should be enabled by default)

image

Their implementation interpolates the primary mesh of characters away from their root, so the character location still holds “truth” but the visual mesh is fake.


As you can see though, it has zero handling for animations. Animation is ticked in TickCharacterPose.

A quick search shows that TickCharacterPose is called from SimulateMovement (simulated proxies) and MoveAutonomous (autonomous proxies, servers).

For clients on listen server, MoveAutonomous is used to perform movement when receiving an update from the client. So we are only ticking animations when receiving an update from client. This is most likely the source of the issue. The comments suggest that this was intentionally designed this way, or maybe this was designed for dedicated servers without much thought put into listen servers :

A quick dirty solution would be to call TickCharacterPose every tick, rather than waiting for client updates. This is essentially what bOnlyAllowAutonomousTickPose=false does, directly from within the skeletal mesh component. However now animations are gonna tick both from skeletal mesh component and from CMC so they’re gonna run twice as fast (and still be jittery from CMC). You have to also cancel out animations ticking from the CMC in that case.


Be aware that if you are using AnimNotifies to drive any gameplay elements, chances are this solution is going to generate synchronization issues as your server is now predicting animations instead of waiting for client updates. This is probably the reason Epic is not doing it.

7 Likes