Menu

The Cursor Jumps 28 Pixels or Glides 4: Same Packets, One Delayed Clock
πŸ“°

The Cursor Jumps 28 Pixels or Glides 4: Same Packets, One Delayed Clock

DEV Community: frontendΒ·Devanshu BiswasΒ·6 days ago
#LF6lv8QF
#devtofrontend#devto#dev#every#cursor
Reading 0:00
15s threshold

A multiplayer cursor looks like a drawing problem. It is a timing problem.

Everyone else in the file is a stream of sparse positions that arrive late, out of order, and sometimes not at all. The screen redraws about sixty times a second. The positions do not. Almost every frame you paint is therefore something you made up, and the whole craft of the feature is in how you make it up.

πŸ‘‰ Live, with every table computed in your browser by the same engine: https://dev48.in/design/day83-presence-cursors.html

πŸ”΄ The wire is simulated

There is no socket here. A seeded transport models a 90 ms latency floor, 100 ms of uniform jitter and a 12% drop rate , and the clock is an explicit fixed 16 ms step, so the replay is a pure function of (seed, settings) and reproduces byte for byte. The digest over every rendered position of every frame is 31da09e9 on every machine.

What that costs: the point estimates below are properties of this draw.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.