Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lag compensation #14

Open
handsomematt opened this issue Aug 14, 2022 · 0 comments
Open

Lag compensation #14

handsomematt opened this issue Aug 14, 2022 · 0 comments
Assignees

Comments

@handsomematt
Copy link
Member

Currently our networking model is Client -> Server -> Client - however one of the clients is pretty much always going to be the server.

An example of lag would be if one client has 100ms ping, when the client hits the ball the physics simulation would've already been running for 100ms extra making the ball appear further away and then suddenly teleporting forwards.

A solution I'm thinking is: when a client hits the ball, calculate how long it will take to reach the opposing players end of the table and slow your local physics simulation down over that delta so the ball will reach it's intended destination 100ms later. This should seem seamless, at the most extreme it'd probably only slow down by 10% which will barely be perceived by the player.

@handsomematt handsomematt self-assigned this Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant