google / google/codeworld

Coalesce rapid mouse movements in games

Open
#379 9 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Haskell
Stars
1.3k
Forks
201
PR merge metrics
No merged PRs in 30d

Description

Games generate a LOT of mouse movement events, which are each propagated to all clients. We should be able to reduce this. For example, suppose each client tracked when it already had a mouse movement sent within the last 50 milliseconds; and if so, coalesced all consecutive mouse events and postponed broadcasting them until 50 milliseconds had passed.

We could also look into a trick similar to the redraw-avoidance. It's less straight-forward, though, because even if the MouseMovement doesn't modify local states, it still needs to be sent because it might matter in whatever (as yet unknown) state the game will be in, in the merged canonical event stream. So that's not great. BUT, if we could introspect that MouseMovement events are _always_ the identity function for a given game, then we could save a lot of traffic.

It's not immediately clear to me how to discover this. @nomeata knows a fair bit about this: any ideas?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.