Building a dodge game where everyone gets the same storm
Notes from the first build of Stormday: the decisions, the numbers, and what got thrown away. Part one covers design through launch. Later entries will cover what real players did to the difficulty curve.
Why a daily dodge game
After retiring the old library (the about page has that story), I wanted a game that could only be described as itself, and a reason for someone to come back tomorrow.
Daily puzzles solved the second problem years ago, but almost all of them are word or trivia games. Daily skill games barely exist on the web. The format fits a dodge game unusually well: a seeded pattern means that "I died at 31 seconds" is a sentence your friend can verify, and survival time is a score anyone understands without a tutorial.
The one rule: the storm is the same for everyone
This sounds like a feature and is actually an engineering constraint that shaped everything else.
- The seed is a 53-bit hash of
"stormday:YYYY-MM-DD"in UTC, fed to a mulberry32 generator. No server. Any device can rebuild any day's storm forever. - The simulation runs at a fixed 120 steps per second, independent of frame rate. A phone at 30 fps and a desktop at 144 fps step the same world the same number of times. The automated test suite runs a scripted player through a day twice and asserts the results are identical to the bit.
- Nothing in the simulation calls
Math.random(). Even the particle bursts use integer arithmetic on their index, so a replay could be reconstructed from inputs alone. - The whole day's timeline, a couple of hundred attack fragments and well over a thousand background drops over five minutes, is generated up front in a few milliseconds. The sim just consumes events as the clock passes them.
I dropped the game engine I had used for the old site (Phaser) for a plain canvas renderer. A deterministic sim is easier to trust when every line of it is mine, and the entire game is now 13 KB of gzipped JavaScript instead of 300. First paint on a phone is under a second, which matters when the link arrives in a group chat.
Hand-made fragments, seeded arrangement
The obvious approach is to spawn hazards at random and let the seed drive the randomness. I did not build it that way, because I have played enough randomly generated dodge games to know the failure mode: noise has no rhythm and no tells, and once in a while it is simply impossible. Fun dodging comes from readable shapes.
So the storm is built from twelve hand-designed fragments: rain, crossfire, sweep row, sweep column, tunnel, ring, laser, laser fan, spiral, bouncers, seeker and blast zones. Each fragment is a small function that, given a start time, the day's generator and the current pressure level, returns a list of spawn events. A director walks the timeline, picks fragments by weight from those unlocked at that moment (lasers from 11 seconds, spirals from 20, seekers from 26, laser fans from 45), and waits a gap that shrinks as pressure rises. A separate thin layer of background drizzle runs the whole time so there is never a dead moment.
Pressure is one number, intensity(t): 0.3 at the start, 0.55 at 8 seconds, 1.3 at 25, 2.4 at 50, 3.5 at 90, then creeping up. It scales shot speed (by 0.82 + 0.24·I), shrinks gaps, shortens warnings, and raises the fragment rate. Having one knob made tuning possible, and it has already been turned once: the first curve was gentler (1.0 at 30 s, 1.9 at 60 s) until the first person to play a preview build survived 75 seconds on their first try.
Tuning with robots
I cannot play my own game a thousand times, and one person's reflexes are a terrible sample. So I wrote three scripted players that run the real simulation headlessly, 30 days at a time, in under a second:
- Idle never moves. It measures how gentle the opening is.
- Human-ish decides eight times a second and moves at most about 360 pixels per second, choosing the safest of 25 nearby positions by projecting every hazard half a second ahead. Perfect reactions, mediocre planning.
- Lookahead is the same brain at 30 decisions a second with no speed limit. Superhuman reactions.
Where it ended up, median over the first 30 days with no cards bought: idle 7.5 s, human-ish 40 s, lookahead 43 s. The bots are a floor, not a ceiling: the one real person who has played so far beat the human-ish bot by about 1.7×, because a person plans a route and the bot only reacts. That puts a decent first result somewhere in the 30–50 second range, and 60 seconds genuinely earned, which is the shape I wanted: a result you can improve on in three tries.
The bots found four real problems before any human did:
- Every day opened identically. Fragments unlock by time, and at 3.5 seconds only rain was unlocked, then only the sweep row, so day after day started rain → wall → ring. Fixed by randomizing the first attack's start between 3 and 4.5 seconds and unlocking crossfire and rows earlier.
- Vertical walls were killing two thirds of runs. A column sweeping sideways with its gap near the top of a tall arena asked the player to travel 400 pixels in under two seconds while dodging rain. Now the gap is restricted to the lower 34–88% band of the arena, the wall is slower (110–140 instead of 150–200, and its speed stops scaling at 1.2×) and the gap is wider. Rows and tunnels got the same treatment after an independent review pointed out that walls were still three quarters of the human-like bot's deaths; they are now about 37%.
- Rings on top of you were unavoidable. Within about 40 pixels of a ring's centre the shots are too close together to pass between. The telegraph ring was enlarged from 22 to 30 pixels and made to pulse so that "get away from this now" is unmistakable.
- Magnet was a different game. At 0.9 radians per second of steering for three seconds, Magnet days ran half as long as any other. It is now 0.45 rad/s for two seconds, which is "shots lean toward you" rather than "shots hunt you".
Input: the thumb problem
The original plan was "the cursor is the dot", which is perfect with a mouse and terrible on a phone, where your thumb covers the thing you are trying to keep alive. Touch now uses relative drag: put your finger anywhere, and the dot moves by the same amount your finger moves, scaled by 1.15 so a thumb resting in a corner can still reach across. Mouse keeps absolute tracking. Keyboard moves at a fixed 380 px/s and is deliberately the slowest, because it is the least precise.
One subtle thing: pointer movement is capped at 1,500 px/s inside the sim and the player's movement each step is tested as a line segment, not a point, so a fast swipe cannot tunnel through a shot. A hit that you visibly passed through would be the most unfair thing in the game, so this was in from the first version.
Ideas that got cut
- One-button control (tap to flip direction). Simpler to explain, but it turns dodging into timing and removes most of the expressive play. I chose pointer control on paper and never built the one-button version; if players ask for it, it would be a separate mode, not a replacement.
- Drift, a modifier that pushed the player downward. Under absolute pointer control it does nothing: the dot simply re-chases the cursor. It became Crosswind, which bends shots instead, and which works identically for every input method.
- Inverted controls as a modifier. Technically a twist, practically just unpleasant. A modifier should change what you look at, not punish your hands.
- Mid-run power-ups. They make runs incomparable. If one player found a shield pickup and another did not, the shared seed stops meaning anything. The Shield modifier gives everyone the same shield on the same day instead.
- Speed-up after death to show "what would have come next". Fun, but it leaks the pattern to people who have not played yet. Maybe for archived days later.
Small decisions that mattered
- The death map. The share card shows a 3×4 emoji grid with a 💥 where you were caught. It costs seven characters and turns "42.8s" into a story: "I died in the bottom-left corner, same as you."
- Grazes. Passing within 11 pixels of a shot ticks a counter and sparks. It changes nothing about your score and everything about how the game feels at 40 seconds.
- Honest percentiles. With no leaderboard yet, the result card shows an estimated "top X%" derived from the difficulty curve and says, in the same line, that it is an estimate and not live data. I would rather be boring than make up a number.
- Pause on tab throttling. If a frame takes more than half a second, browsers have throttled the tab. Instead of simulating the missed time at once, which drops you into a wall you never saw, the run pauses.
- Launch day is always Clear Skies. Puzzle #1 has no modifier so everyone learns the base storm first.
The first tester said "it's fine"
The first person outside me to play a preview build survived 75 seconds, said the difficulty felt easy, and said the game felt familiar: not bad, just a dodge game. That is the most useful sentence anyone has said about it. Dodging alone is a known quantity; what was missing was a decision.
So the run now has a shape. Every ten seconds survived is a wave; a wave pays a gem; a gem buys one of three cards: extra life, five percent fewer shots, five percent slower shots, a smaller hitbox, interest on future waves, a stored flare that wipes the screen, or a ten-second time warp. The three cards in each wave are drawn from the day's seed, so the shop is identical for everyone, which keeps the daily comparison honest: two people with the same time made the same choices available to them, and probably different ones.
Two implementation details mattered. Cards that slow or thin the storm act on the hazards' own clock, not the player's or the score's: the survival timer still counts real seconds, and the day's event schedule is untouched, so a day's pattern is still the pattern. And the "thin out" card drops shots by a hash of each event's index rather than at random, so it is deterministic and never removes walls, lasers or blast zones, which are the storm's structure. In the balance harness (30 days, median), the human-like bot lasts 40 s buying nothing, 44 s buying the first affordable card each wave, and 56 s when it prioritises extra lives. The curve was steepened at the same time (a tester at 75 seconds on a curve meant to make 60 rare told me that much), so the net effect is a harder storm with more ways to survive it.
What's next
Real players. The curve above is calibrated to robots and one developer. The next entry will have the first week of actual results and whatever they break. After that: a proper anonymous leaderboard so the percentile line can be true, and a second daily game built on the same shell.
If a day felt unfair or a tell was unreadable, tell me: contact@arcadesnap.com. Balance changes go on the updates page and only ever apply to future days.