Original Post — Direct link

Wondering if anyone has a follow-up to this post from a July 2015. I'm trying to find out if the server compensates for differences in ping: https://www.reddit.com/r/RocketLeague/comments/3erkr1/how_does_physics_synchronization_and_lag/

"I'm curious if anyone has any insight or theories how RL implements the synchronization between the server and the clients.

The EU servers have been struggling lately and to me the behavior in some of the matches seems just bizarre, as just attempting to drive straight forward can throw your car around the field wildly.

I haven't dabbled much with net code for games, but here's my layman assumption:

  • Client runs the simulation based on player input and latest information from server. Whatever you do is reflected instantly on your client so there's no input latency, but the overall state is an estimation.

  • The server runs a simulation on it's own based on the latest inputs from both clients, this is the one true state that can trigger things like goals and boost pickups.

  • The properties for the cars, ball, boosts etc. is communicated back to the clients, which match them against their own estimation.

  • If the state differs, the corrections are applied bit of a transition animation so things kinda rubber band around instead of blinking, which can be unnoticeable with very low latency

  • To compensate for the latency, the client keeps rendering the other players doing whatever they did in the last tick. E.g. accelerating forward.

  • As long as ticks come reliably at a fast pace, there shouldn't be huge differences between the states. Although things can move and change their direction very fast in the game.

The server are struggling to maintain steady stream of state ticks to the clients, which results in a bunch of rubberbanding despite the low ping.

But none of this would explain why my car might warp five meters to the right and start spinning from the very start of the match, despite me just accelerating.

Is the server-side simulation calculating physics wrong because of the load? Does it run some kind of simplified model?

Is there some kind of anti-cheating sanity checks that go awry when the server can't process all the requests and the clients seemingly report warping across the field?

To me a competitive, fast-paced physics game with lots of players and networking sounds like quite a programming nightmare. Obviously only developers know the actual specifics of the implementation, but I'm also interested if there's any tech-savvy readers who might shine some light on this with an educated guess."

External link →
about 7 years ago - /u/Psyonix_Cone - Direct link

Originally posted by [deleted]

  • Client runs the simulation based on player input and latest information from server. Whatever you do is reflected instantly on your client so there's no input latency, but the overall state is an estimation.

  • The server runs a simulation on it's own based on the latest inputs from both clients, this is the one true state that can trigger things like goals and boost pickups.

  • The properties for the cars, ball, boosts etc. is communicated back to the clients, which match them against their own estimation.

  • If the state differs, the corrections are applied bit of a transition animation so things kinda rubber band around instead of blinking, which can be unnoticeable with very low latency

  • To compensate for the latency, the client keeps rendering the other players doing whatever they did in the last tick. E.g. accelerating forward.

  • As long as ticks come reliably at a fast pace, there shouldn't be huge differences between the states. Although things can move and change their direction very fast in the game.

If I am understanding, you are saying that the server dictates all things in the game, velocity, angle, position, coordinates, boost amount, etc etc then updates the clients, then you are correct. The clients do not update the game state to the server. They only sends inputs to the server. And the clients do a smart prediction by playing the game "X" milliseconds in the future based off of half of your ping.

If it was any other way involving clients sending more data such as gamestate, people could cheat.

 

But none of this would explain why my car might warp five meters to the right and start spinning from the very start of the match, despite me just accelerating.

If you play on PC, I want to see proof of this. Such as recording the gameplay with a gamepad display on top that shows your current inputs.

 

Is there some kind of anti-cheating sanity checks that go awry when the server can't process all the requests and the clients seemingly report warping across the field?

Clients can't report warping. Clients can only send input, "send jump to server, server makes client 'X' Jump".

 

/u/Psyonix_Cone, is it possible for the server to get your input wrong, like driving in a straight line from the beginning only to be warped to the side as if you were turning? I've seen claims of this, and I never have any server lag except very rarely, so I can't say if it's possible.

I am not aware of anything on the server that would cause you to turn without having pressed turn recently. If you have a really bad connection the server will zero-out your inputs to limit how far you move while disconnected.