Spielerando

Events from different players cannot be put in order because their clocks disagree

If you want to know who acted first in a team, the time on each device is not enough, since devices can be minutes apart. This entry shows how to estimate the difference from a few exchanges with the server and how sure you can be.

Why this works

Two clocks cannot be compared directly, but a question and an answer with the server can: the answer was made somewhere between sending and receiving, so the error is at most half the round trip. The quickest exchange leaves the least room for error, so it is the most trustworthy.

When not to use it

Do not bother when the exact order of events does not matter, such as daily totals. If two events are closer than the stated uncertainty, no method can put them in order. When order decides who wins, let the server stamp events itself when they arrive.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 2 common mistakes and the fix
  • 31 lines of example code with 3 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "Events from different players cannot be put in order because their clocks disagree" (read_entry line-up-clocks-of-players-and-server) in my game. Build it step by step, and show me how you checked that it works.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP