Networking State Sync "Rubber Banding" Effect

Hey, so I came up with a State Sync System, in other words, the server sends the player states (snapshot) a few times per second to the client, when the client receives a few snapshots it will interpolate through a pair of snapshots close to the actual server time.

The system described above works fine in most cases, but there’s still a big problem on it and I don’t know why does it happens. This problem is called “Rubber Banding” I think, it occurs when the local player moves in the same direction as another player/s, there’s a short video about it:

If you look closely at the other player on each side, there is a noticeable jittery motion in the other player.

if it’s neccessary, there’s a repro;
Snapshot Based Replication.rbxl (36,5 KB)

Also, I’ve tried smoothing the current server position, this works fine, but it doesn’t work well when your character controller is too dynamic (i.e. jumping, vault, etc).

1 Like

Sorry, just a curious passer-by.

What is the actual use of this in a game?

1 Like

You might need some smarter interpolation. Maybe try to keep velocities more consistent, for instance.

I assembled some resources for inspiration on this topic in this post:

There’s a link to some videos from the developers of rocket league and overwatch, where they talk about some of these problems and how they solved it.

There’s not really an easy solution, and when pings are high enough, there’s a point where you can’t do much.

1 Like

The jittery motion is presumably from the simulated/interpolated motion not matching perfectly with the information received from the server. The part corrects its position, which results in the jittery effect you are referring to.

As @SpeedySanikJr asked, what is the use of this in the game? Utilizing built in systems for network communications is preferable. I believe Roblox Studio is written in C#, and I would imagine they have all networking code written in C# as well. C# is in general more performant than lua, so piggy backing off of that will probably help you out a bit.

1 Like

I’ve already tried a smarter interpolation with cubic splines to match player’s position and velocity, but yeah, this didn’t solved it, also I was thinking about some silly extrapolation stuff to reach a more responsive motion.

Edit: I’ve read the resources you provided, so it looks like my current system already does some similar stuff.

The purpose of this in-game is for a fully custom physics that I wrote, so I have almost absolute control over the player and for the player movement I’ve made a server authoritative architecture.

(The file that I attached in the post contains the current networking system.)

1 Like

Well if its not matching from the server correctly just as how @ifkpop stated he would have to send the time of the event fired and would then have to tell the difference of how long it too for the information to be sent and received using workspace:GetServerTimeNow()

It already matches the server time to interpolate through the snapshots.

Well the cause is most likely from having multiple players but your networking replication was presumably only built for single-player through server and client you might have to change some of it through the server-side and a bit on the client.