Massive Desync Issues w/ Characters

I’ve been experiencing some extremely bizarre “desync” problems with my characters in the game. It is very difficult to explain so please bear with me (and I am also very tired/desperate)-



Me and my friend play-tested today and quite often we were following each other’s “ghosts” as both of our clients displayed our characters in entirely different times and positions.

For clarification:

  • No custom replication is used and humanoids are being used.
  • Replication/sync for my game’s vehicles, heavily relying on the physics engine and remotes for events that replicate to all clients like VFX, turrets, animations, etc, have no problems whatsoever and does not experience desync issues like what has been happening with the humanoid characters.
  • I am using the upgraded avatar joints, and I have IK controllers under the humanoid that I don’t necessarily use but haven’t fully implemented yet.
  • While this is happening, the sent/recv metrics are below 50 KB/s (I may be wrong if this is actually causing these character issues)
  • The only things that are affecting characters on another client would be just the rotations of neck and waist joints so that they are replicated

Could this be something I can fix? Is this a bug I have to report to Roblox? Any help is greatly appreciated. I am just worried that I have to restart a large portion of my code in order to apply any fixes.

4 Likes

Does this only occur once the user begins to shoot?

That’s what it looks like to me from what i see in the clips provided.

2 Likes

No, it’s very difficult to predict when this would happen. But so far this had only happened when the player is holding a firearm

1 Like

Could you provide a clarification as to what you are manually replicating for characters between players and the physics instances you are using? My guess is that whatever you are doing to update the characters is conflicting with the default behaviour provided by their specific humanoid. If you are attempting to update the assemblies of another character that you do not have network ownership over, then that may be another cause.

1 Like

I’m not sure if this kind of behavior would be an effect from rotating the joints of other characters for neck and waist movement, however it is worth a try. Perhaps it is an issue only occurring with the Avatar Joint Upgrade, but I will provide updates when I downgrade

1 Like

I just spotted something while play testing -


image

Under the replicator section the MTU size looks like it has been capped to 1200 while the data ping increases from the milliseconds to the seconds, and this happens when engaging in combat with other players. How does this happen?

2 Likes

I crosschecked this with the videos your provided in the OP and since the Recv metric wasn’t unreasonably high (>100 KB) this is most likely your combat logic causing intense performance issues on the server, leading to the perceived latency spikes across players. I recommend that you use performance profiling tools (Identify performance issues) to identify where such spikes occur and address them accordingly.

2 Likes

Is it possible to use the microprofiler for network spikes? If it is, how does that work, and if it isn’t then what specific performance profiling tools would you recommend? I will continue debugging tonight

1 Like

Is it possible to use the microprofiler for network spikes?

Yes! You can use the MicroProfiler to inspect network traffic, which matches your question. (Though since I already established that this may not be a networking issue, this probably isn’t what you’re looking for.)

what specific performance profiling tools would you recommend?

If you’re new to using performance profiling tools, I recommend you use the script profiler menu in the Developer Console. This allows you to measure the CPU time costs associated with function and method calls, and is particularly useful as it displays them in a way that is easy to understand and not as meandering to navigate as something like the MicroProfiler. If you’re using APIs which can be computationally expensive depending on how you’re using them and the kind of geometry involved in your game (e.g. spatial query, raycast) then they’ll show up accordingly and you can identify performance bottlenecks in that way.

Ultimately though the MicroProfiler is the gold standard of performance profiling due to how verbose and granular it is in the information it provides and the various features it contains. Fortunately there is plenty of tutorial articles and information available in the official documentation and online. It used to be confusing for me when I was learning it for the first time and now I always use it as a reliable metric for performance profiling in my own games.

1 Like

Thank you for the debug tips! Update - I’ve managed to narrow down the problem to my character scripts. The spikes happen under these circumstances:

  1. Spikes in “sent” network data happens when simply walking,
  2. High framerate make this worse (240 fps)

I turned off the logic for it and allowed the default roblox character handling to take over, so I know the problem is the way I’m doing movement. Turning off features that are usually replicated by the built-in engine like animations and even just the change of WalkSpeed doesn’t seem to do anything. I use AlignOrientation for controlling where the character looks at, and even throttled my heartbeat/renderstepped functions to 60 fps, and it didn’t help. As of now the last thing I’ve done is measure the time in milliseconds it takes to go through the full program in the loop, nothing seems abnormal (averaged 0.1ms, my frames would most likely drop if it took longer)

I know my custom character handler is the issue, but I have no idea what went wrong or how to fix it :smiling_face_with_tear: