This graph also doesn’t depict what this module does correctly. It’s misleading. This is a better representation of what the module does looks like in a graph.
Here, I’m using an In Quad curve. The formula to construct a graph that describes what the module does here would be:
(for an InQuad curve)
Where c is the change of value in the tween, t is the current time, d is the duration of the tween, and l is latency. This equation just allows all of the graphs at the equation to always intersect (end the tween) at the same x value, which is time. This is what this module does with client latency compensation.
In any easing equation (for different easing styles) it’s the same thing. Easing functions require 4 things: a start point, change in value, duration, and current time. So, using this concept with any easing equation would mean that
- start point = server start point + latency
- duration = server tween info duration - latency
- change in value = whatever the server is tweening to
- current time = always a moving time-based value like tick()
Y axis is change, X axis is time
The server tells client 1 and client 2 to run a 3 second tween, and move a part 2 studs up.
The blue tween is client 1, who will have no latency for the sake of this. The green tween is client 2, who has .5 seconds of latency which is why the green graph is translated a bit to the right (it means that it starts after client 1).
As you can see, they finish at the same point at the same time. This is what the module is supposed to do.
Here, I’ll apply 1.5 seconds of latency to client 2.
As you can see, they still end up at the same place at the same time.
No matter how much latency you apply, they will end up at the same point at the same time. This is the “client latency compensation” being done here.