Character Interpolation Period

I’m currently implementing Lag Compensation (based on Lag Compensation - Valve Developer Community) into my game on roblox, but I keep running into issues where the player’s position is delayed from remote events.
I figure this is because of roblox’s interpolation period used to smooth out player movement.

That brings me to my question, what is the interpolation period that roblox uses?, I need to be able to adjust the rewinding by that amount in order to get an accurate hit.
But I cannot seem to find any sort of documentation about it.

2 Likes

To put it bluntly, it fluctuates, there is no set interpolation period Roblox uses depending on a variety of factors including but not limited to:

  • distance from the camera
  • distance from the player
  • physics settings
  • ping

You can see my past tests/frustration with this here: Method to get physics interpolation/extrapolation data

The closest we’ll really get is when Player/NetworkPing and :GetServerTimeNow() from Release Notes 488 finally releases, at which point we can just create our own physics interpolation system for characters.

At the moment you can somewhat create your own system using *DO NOT USE* High precision clock syncing tech between clients and server with accuracy of <1ms

2 Likes

Until those are implemented setting the interpolation period to 100 seems to be much closer to what I used to experience, so its good enough for now. Thank you so much for the explanation!

1 Like

I might add that you should also verify that users with higher ping can still play. For instance, consider changing the testing ping (in File → Studio Settings → Network → Incoming Replication Lag). Note that this uses seconds.

Hey, thanks for linking my post. Just wanted to point out that :GetServerTimeNow() is already live (despite what the release notes page might say). However, from personal testing, I found that GetServerTimeNow severely disappointed when it came to synced time precision, and my own module (and all of its janky glory) came out far, far superior in every situation.

I don’t recommend using my own module because the code is sketchy and probably will break eventually, but for my own project I continue to use it.

Speaking of my own project, this really doesn’t contribute to the problem being discussed and is more of a poorly hidden self-promotion, but if you want to see an example of lag compensation being executed well on Roblox, here’s a cool clip I recorded of my own spectator system in action: Fun with spectator mode - YouTube

If you do custom replication, it can have some really amazing effects. Complete control over network usage (throttling update rates i.e network LOD, network “replication zones”), ability to do position extrapolation and whatever to get real-time replication. Always exciting to see people talking about this stuff.

4 Likes