Frequent Server Lag from Client Replication "SafeMove"

Reproduction Steps

This issue has been happening on and off in my game. It happens primarily when many clients are connected to the server (~50+). I cannot reproduce it, and I believe it started happening a few weeks ago but I had written it off as another issue. The server microprofiler logs show Replicator ProcessPackets → SafeMove → MoveCoarse taking anywhere between 40 and 100ms. Based on the label, I believe this is a physics replication issue. It seems this may be related to the bug in this post, as this is where an engineer states they added the microprofiler label.

Expected Behavior

I expect client physics replication to not bog down the server.

Actual Behavior

Client physics replication is not always processed efficiently. Screenshot included.
https://i.imgur.com/4BNFrJi.png

Issue Area: Engine
Issue Type: Performance
Impact: Very High
Frequency: Constantly

2 Likes

Thank you for the report! That does look very similar to the bug report from March. We’ll look into it, but you likely won’t get a response until Monday at the earliest :slight_smile:

3 Likes

Thanks for the report. We’re aware of this, it’s a performance edge case with the SafeMover (the thing that pushes parts above other parts). Usually this happens with a lot of characters on the same SpawnLocation, when a SpawnLocation is below a huge tall part, or when the safemove’d model is extremely complex.

We’re planning a rewrite of this system with continuous collision detection that should be much faster and more accurate, but for now there’s still room for a targeted performance fix - we’ll look into that.

3 Likes

This is easy to reproduce, just use player.Character:MoveTo(), which causes lag spike
In my case I fire an event to server with mouse position


Current workaround is to just pivot the character
Is there any information on when “SafeMover” is being rewritten? (or I may have missed something, if I did I’m sorry)

1 Like