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

Factor estimated socket latency into currentTime sets for clients #15

Open
JoshuaKGoldberg opened this issue Sep 1, 2020 · 0 comments
Labels
area: game runtime Improvements to the core game experience. status: accepting prs This issue is ready for a pull request. type: cleanup Improving the structural quality of code or runtime smoothness/performance.

Comments

@JoshuaKGoldberg
Copy link
Collaborator

Example basic measurement implementation: https://stackoverflow.com/questions/4071258/how-can-i-find-the-response-time-latency-of-a-client-in-nodejs-with-sockets-s/45216554#45216554

By the time a client receives a "the video is now playing" update from the server, they're already some unknown number of milliseconds behind -- generally however long that socket message took to reach them. They should therefore advance the video by how many milliseconds that message took to reach the client.

Proposal: have EmitContext also measure the latency of Socket.IO's built-in pong messages and keep the running average in member of the context. I actually have an npm package that already keeps the calculation available: https://www.npmjs.com/package/fpsanalyzr

(Blocked on #10 getting merged)

@JoshuaKGoldberg JoshuaKGoldberg added status: blocked Other work must be completed before this is tackled. area: game runtime Improvements to the core game experience. type: cleanup Improving the structural quality of code or runtime smoothness/performance. labels Sep 1, 2020
@JoshuaKGoldberg JoshuaKGoldberg changed the title Factor estimated socket latency into currentTime sets for clients. Factor estimated socket latency into currentTime sets for clients Sep 2, 2020
@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs This issue is ready for a pull request. and removed status: blocked Other work must be completed before this is tackled. labels Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: game runtime Improvements to the core game experience. status: accepting prs This issue is ready for a pull request. type: cleanup Improving the structural quality of code or runtime smoothness/performance.
Projects
None yet
Development

No branches or pull requests

1 participant