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.
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).
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.
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.)
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()
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.