Behind the scenes
How the leaderboard verifies every run
In a browser game, the program runs on the player’s computer, and whoever controls the computer can change the program. So Hexapulso doesn’t believe the result the browser reports. The server replays the whole run, and only what it works out itself goes on the leaderboard.
The problem
If the game simply sent "I survived 300 s", anyone could send that message without playing. Signing or scrambling the message doesn’t fix it: the signing key would be inside the game itself, within reach of anyone who cares to look.
The solution: send the keys, not the result
- Ticket. Before the run, the game asks the server for a single-use ticket. It carries the seed: the number that decides every wall in that run.
- Run. The game runs with that seed and notes down what you did: on which step you turned left, let go, turned focus on, pressed a letter.
- Replay. At the end, the game sends the ticket and that list of inputs.
- Check. The server runs the same simulation, with the same seed and the same inputs, from the first step to the crash. The time and points that come out of that are what go on the leaderboard.
What the browser said happened is kept for investigation only. A ticket is good for one run at most.
Why the result is always the same
This only works if the simulation gives exactly the same result in your browser and on the server. For that, the game’s core follows strict rules:
- Fixed step. A run advances in 120 steps per second, always the same size, whatever your screen’s frame rate.
- Seeded randomness. Every bit of "chance" in a run comes from a generator that, given the same seed, produces the same sequence.
- No clock, no screen, no sound. The core doesn’t know what time it is or what is being drawn.
- Its own sine and cosine. Browsers’ trigonometric functions can differ in the last decimal place from one to another. The core computes its own with a polynomial, using only addition, subtraction, multiplication and division, which give the same result on any machine.
An automated test records a run in the browser, replays the same run outside it and compares the two results.
How big a replay is
A replay doesn’t store all 120 steps of every second. It stores only the changes: "after so many steps, the state of the controls became this". A one-minute run fits in a few hundred numbers. It is the same replay you watch when you click a row on the leaderboard: your browser replays the other person’s run on your screen.
The possible outcomes
| Outcome | What it means |
|---|---|
| Verified | The check matched. It goes on the leaderboard. |
| Mismatch | The replay doesn’t produce the result the game reported. |
| Incomplete | The replay ends before the run does. |
| Invalid | Rules swapped, malformed input, or sent too quickly for the time played. |
What about slowing the game down?
A replay played in slow motion, with the browser clock slowed down by a program, would be valid: the keys are right. Protecting the clock inside the browser doesn’t help, for the same reason as always. So the server is the one that keeps time. In Classic, the game sends a signal at the start, every 10 s of the run and each time a pause ends, and the server compares that with its own clock. A run that went slower than the server clock, or with too much pausing (more than 30 s in total or more than 10 pauses), still pays XP and coins but stays off the leaderboard. These limits were chosen by estimate and may be adjusted.
What this guarantees and what it doesn’t
It guarantees: nobody makes up time or points, swaps the seed, reuses a ticket, cuts a run short or sends a 10-minute run in 10 seconds.
It doesn’t guarantee: that a person was playing. A program that plays in real time produces a valid replay. For those cases there are automatic review flags (for example, direction changes faster than hands can manage), player reports, made from the replay’s pause screen, and manual review, which can take a run off the leaderboard.
In the daily challenge the seed is the same for everyone, so you can study the day’s walls. That is part of the mode, and it is why it has no leaderboard.
Old versions still count
When a rule of the game changes, the core gets a new version number and the previous one is kept, untouched. Each run is checked with the version it was played on, and your browser downloads the old version when you watch an old replay.