Darkmass.io

How Darkmass.io Is Built

Darkmass.io is written in Rust from the server to the browser. This page tells the engineering story behind that sentence: how one simulation runs in two places at once, why steering feels instant across an ocean, and what keeps the game fair when nothing on your machine can be trusted.

Play

Last updated 11 July 2026.

One simulation, two machines

Every online action game faces the same problem. Your input has to travel to the server, the server has to work out what happened, and the result has to travel back. Even on a good connection that round trip takes long enough to feel. If the game waited for it, your Star would trail your cursor like a weight on a string, and steering, which is most of what you do in Darkmass, would feel wrong from the first second.

The usual escape is to let your machine act first and have the server catch up. But that opens the opposite door: if the client's word counts for anything, a modified client can lie, and in a game about eating other players, sooner or later someone will build one.

Darkmass closes both doors with one design. The server runs the arena and is the only authority: it decides every orb eaten, every swallow, every death. Your browser runs the same simulation code, compiled to WebAssembly, and uses it to predict your own movement. The moment you move the mouse, the client steps its copy of you forward with the exact code the server is about to run. Steering answers instantly because nothing has to travel anywhere first.

Then the server's verdict arrives, and the client quietly corrects itself against it. Because both sides ran the same code on the same inputs, they nearly always agree exactly, and there is nothing to correct. When they do differ (usually because something changed near you that your client had not heard about yet), the client eases the difference away over a few frames instead of snapping you to the corrected spot. So you get the pairing arena games usually have to choose between: controls that respond at once, and a server that never takes the player's machine at its word.

Determinism in practice

"The same simulation" is a stronger claim than it sounds. Two computers can run the same program and still disagree in the last decimal place: different hardware, different maths routines, the same sum rounded two slightly different ways. In most software nobody would ever notice. Here it matters, because every step of the simulation feeds the next. A disagreement in the fifteenth digit compounds, step after step, until the two copies of the world have visibly drifted apart.

The Darkmass simulation is built so that cannot happen: the server and your browser step the world with the same code and get the same answer. The client's prediction is not an estimate of what the server will say; it is the same calculation, and it is normally exactly right.

Everything unpredictable in the arena is decided by the server and shared with your browser: where orbs appear, where the next event breaks out. Both sides are always working from the same facts.

That is what lets the game lean so hard on prediction. Corrections are rare, and small enough that you will not see them. When your Star does move oddly, it is the network, not a guess gone wrong.

Drawing the arena

Darkmass is a game of light on darkness, and that shapes how it is drawn. The world itself, the orbs and Stars and trails and events and the Void, goes to your graphics hardware. The signature look is additive light: where two glows overlap, their brightness adds, which is why a surge full of violet orbs reads as one bright pool rather than a stack of flat discs. A graphics chip does that kind of blending effortlessly for a whole screenful of glows; done by the processor alone it would be the most expensive thing in the game.

Not every setup can take the full-effects path. Older machines cannot, and neither can a locked-down browser or the occasional troubled driver. For those, the game quietly switches to a leaner way of drawing. The effects are simpler, but the arena, the rules and the simulation underneath are exactly the same.

Nobody is shut out because their laptop is old.

Text takes the opposite route. Your mass, the leaderboard, the event countdown, the names over Stars and the crown on the leader are deliberately kept out of the glow. Interface text needs to be crisp and readable at a glance, and light would only smear it, so the HUD stays sharp while the world blooms.

A giant golden Star in Darkmass.io rendered with layered additive glow, a smaller white Star nearby.
The additive glow around a giant. Each light layer is drawn on the graphics card, which is what keeps a busy arena smooth.

Staying in sync

Once you are in the arena, the server keeps your client fed with a steady stream of updates, and the important word is small. It never resends the whole world. Each update carries only what changed: this Star moved, that orb was eaten, a power-up appeared over there. From one moment to the next most of a crowded arena has not changed at all, so the savings are large, and they are what keep the game smooth on an ordinary home connection, or on a phone on mobile data.

Your own Star is predicted, as above. Other players are handled differently: the client draws them a small moment behind the newest update and smooths their movement between positions it knows for certain. The delay is too short to notice, and it buys continuous, believable motion instead of Stars stuttering forward each time an update lands.

Real networks hiccup. Wifi stutters, or a phone mast hands you over at an awkward moment. When updates pause for a beat like that, the client rides it out: motion carries on along its last known course, then eases back to the truth when fresh data arrives, rather than freezing or jumping. And if the connection drops while you are sitting on the menu, the client notices and quietly reconnects on its own. At most you will see "Connecting to server…" for a moment while it sorts itself out.

Running worldwide

Darkmass keeps a server region on each side of the Atlantic, one in Europe and one in North America, because no amount of engineering beats geography. A signal in fibre takes real time to cross an ocean, and a server on the wrong continent adds that time to every exchange.

You do not have to think about it. When the game loads, the client pings both regions, measures the actual round trip from where you sit, and picks the faster one — a measurement, not a guess from your address. If you want the other region anyway, perhaps because a friend plays there, the menu lets you switch.

Prediction softens distance too. Your own steering is computed on your machine, so it stays instant at any ping; latency mostly shows in how current your view of other players is. That is also why the lower-ping region is still worth having in a close chase.

Built to be fair

Underneath everything sits one rule: the server decides every outcome. Your browser predicts and draws, but its word counts for nothing. It reports your inputs, where you steer and when you hold the Gravity Well or Dash, and the server runs those inputs through the simulation itself.

That makes whole categories of cheating structurally impossible rather than merely against the rules. A modified client can draw whatever it likes on its own screen, but it cannot eat an orb the server did not grant, cannot move faster than the simulation allows, cannot make mass out of nothing and cannot refuse to be swallowed. The worst it can do is mislead the person running it.

And because there are no accounts, there is nothing behind the game to steal. No password to leak, no inventory to hijack, no progression to sell. The name you enter is gone when the session ends, and no run carries anything over from the last. That is not a promise but a property: there is nothing persistent for an advantage to live in. There is more on this, and on privacy, on the About page.

The stack, briefly

Under it all is one deliberate choice: a single language, end to end. Darkmass is written in Rust. The server, the simulation and the browser client are one codebase. The server build compiles natively for the machines it runs on; the client build compiles the same code to WebAssembly, the fast binary format every modern browser can run. That is what makes the shared simulation honest. There is no careful port maintained in two places, slowly drifting out of step; the same code is simply built twice, and that is why the two sides can agree so exactly.

Rust suits the job for unglamorous reasons. It is fast enough to step a crowded arena with room to spare, it catches whole classes of memory bugs before the code ever runs, and it has no garbage collector to pause the world in the middle of a chase.

From your side, very little of this shows. The whole client, simulation and renderer and interface together, arrives in one small download, and then it just runs. No installer, no plug-in. Open the page, pick a name and a colour, press Play.

If this page leaves something unanswered, the FAQ covers the short questions and How to Play covers the rules. Questions or feedback are always welcome at [email protected].

Play