Jittery Character Movement on Client

Hi all,

My team and I are working on a sport simulation project that runs in editor. Multiple characters are driven by data we receive and move around a field. Typically the operator will host on one machine, and another will connect as a client for viewing.

Recently we’ve run into an issue where our characters seem to jitter on the client. This seems to be affecting both their transforms and as a result, their animations. It looks like multiple frames are being skipped between updates.

As a bit more context, the characters have a standard Character Movement Component with settings identical to Lyras’. They are parented to another actor which is what is being directly moved by the data we receive. In the past this has worked fine for us but at some point we began to see this jitter.

What are the main things to try when attempting to identify the cause of this issue? I’ve spent a few days troubleshooting this issue without any luck. I’ve tried edits to DefaultEngine.ini I found suggested in other posts, changing settings on the CMC, stripping out the animations entirely… I have tried using the network profiler and nothing seems amiss at first glance, but then I’m not 100% sure what to look for there. This is a BP only project but if there was a C++ solution we could look at implementing it.

Thanks in advance

Jitter is caused by the server correcting the client. It’s calculations are not matching the clients.

You can try one or both of these options. But you will lose server authority on the movement.

One of the most common root cause of the jittering is the change of the max walk speed.

The CMC (Character Movement Component) is locally predicting the movement, while sending the necessary information to the server so the server can replicate the movement done by the client. If the server movement results in a different position than the client predicted, a correction is sent back to the client (just as @Rev0verDrive mentioned), causing jittering.

In the editor, you can enter two console commands that can help find these issues early.

Enter this to enable packet lag, simulating a real-world network. I like to set this to an extreme value (say 500ms) because any error is more obvious this way:
NetEmulation.PktLag 500

The other option is optional, helps you identify if a correction was made:
p.NetShowCorrections 1

Ii you indeed change the max walk speed (e.g. character sprint), then you have to do some extra work so the CMC prediction will be correct. A video explanation: https://www.youtube.com/watch?v=RtQRMcupJs0