LIKABLE GAMES
Developer notes

How we made Reef Hop fair (with a very patient robot)

Reef Hop looks simple. A little turtle hops from lane to lane across a reef, and spiky urchins drift up and down the lanes in between. You tap to hop forward, swipe or use the arrow keys to step sideways, and see how far you can get before one of them catches you.

Early versions of Reef Hop had a problem that was easy to miss if you were good at it and impossible to miss if you were seven. This post is about how we found that problem, the two changes that fixed it, and the very patient robot that helped us prove the fix worked.

How a round works

The reef is a long strip of lanes running across the screen. Sandy lanes are safe. Darker lanes carry a steady stream of urchins, some drifting up and some drifting down, each lane at its own speed. Every new lane you reach counts as one hop, every star you scoop up adds 5 points, and a medal pops up every 25 hops.

One touch from an urchin ends the run with a big "OUCH! SPIKY!" That single-mistake rule is what makes the game tense and fun. It is also why fairness matters so much here. When one mistake costs you the whole run, the mistake has to be yours, not the game's.

What was going wrong

Two things in the early builds could knock a player out without them doing anything wrong.

The first was stacked hazard lanes. Each new lane was picked more or less at random, so two or three urchin lanes could land side by side right at the start. To get across, you had to read two or three streams at once and time several hops in a row with no pause in between. A grown-up who had played fifty rounds could just about manage it. A younger player hit that wall in their first ten seconds and had no idea why.

The second was landing on a spike. Urchins keep moving while you hop. If you jumped into a lane at the exact moment an urchin slid into that spot, the game counted a hit the instant you touched down. On screen it looked as if the turtle was knocked out before it had even landed. Even when the maths says that is fair, it does not feel fair, and in a kids' game the feeling is what counts.

Fix one: keep the hazards apart early

Reef Hop builds the reef a little ahead of you as you go. Every time it lays down a new lane, it now follows a few rules:

  • The first three lanes are always sand, so every run starts with a breather.
  • For the first 30 lanes, an urchin lane is never placed right next to another urchin lane. After every hazard there is at least one sandy lane where you can stop, look, and plan.
  • After lane 30, two urchin lanes can sit side by side, but never three in a row.
  • The chance of a lane being an urchin lane starts at about 38% and creeps up a little with every lane, topping out at 60%.

The urchins themselves also get quicker and bunch closer together the further you go, up to a set limit. So the game still gets harder. It just gets harder in a way you can see coming, instead of throwing its worst at you before you have learned the controls.

Fix two: a short landing grace

The second fix is a tiny timer. A grace period is a short moment where a game lets you off on purpose, because the alternative would feel like a cheat.

In Reef Hop, the moment you start a hop, the turtle is safe for 0.38 seconds. The hop itself takes about 0.13 seconds, which leaves roughly a quarter of a second of standing on the new lane before an urchin can count as a hit. The game also never checks for hits while the turtle is in the air. Mid-hop, an urchin can pass right underneath you and nothing happens.

A quarter of a second is too short to notice when you play. You will not see the turtle flash or go see-through. But it is long enough that an urchin sliding past at the exact moment you land no longer ends your run. If you stay standing in its path, it still gets you. The grace forgives bad luck, not bad choices.

The very patient robot

Here is the hard part about testing a kids' game. The people making it have played it hundreds of times. We know how the streams move. We hop the instant a gap opens. If we test the game by playing it ourselves, it always looks fair, because we are not the players it is for.

So we wrote a simulated player: a small program that plays Reef Hop by itself, pressing the buttons instead of a person. A simulated player can run game after game without getting tired or bored, and it plays the same way every time, which makes it a fair judge of whether a change helped.

The obvious way to build one is to make it perfect, working out the exact safe moment and hopping right then. We did not do that. We made it cautious. It looks at the next lane, waits until there is a clear gap in the urchins, and only then hops. That is how younger kids really play. They stop on the sand, watch a few urchins go by, and hop when it looks safe. They do not hop on the very first frame a gap appears.

A cautious player turned out to be the perfect test, because it walks straight into both problems. Waiting on a sandy lane works well. But when two urchin lanes sat side by side, there was no sand to wait on. And when a gap closed just as it landed, it was knocked out on touchdown.

What the numbers said

Before the fixes, the cautious robot averaged about 4 hops per run. Four. That is a run that ends before a child has worked out what the game is about.

After the fixes, the same robot, playing in exactly the same careful way, put together runs of 31 to 85 hops. Nothing about the robot changed. The game changed, so that a patient, careful player is now rewarded for being patient and careful.

Notice that the robot still loses. Past lane 30 the doubled-up lanes and faster streams start to catch out a player who only ever waits. That is how we want it. A skilled player who reads the streams and hops through tighter gaps will still go further. The top of the game is still high. The bottom just is not a trapdoor anymore.

The lesson: test with the player you actually have

It is tempting to test a game with a perfect player, because a perfect player tells you whether the game can be beaten. But "can it be beaten?" is the wrong question for a kids' game. The better question is "does it feel fair to the person actually holding the phone?"

The player we actually have is often seven or eight, playing on a small screen with a thumb, and pausing to think before every move. A test player that behaves like them showed us a problem our own play never would have. We now try to ask the same thing about every game on the site: who is really going to play this, and does our testing play like them?

The same thinking runs through a couple of our other notes. It is why we retired one of our own games when young players said its controls felt dead, and why we check what is really inside a game instead of trusting a screenshot.

Try it yourself

Next time you play Reef Hop, watch for these rules at work. Early on, every urchin lane has sand on both sides. Somewhere after lane 30 you will start to see doubles. And if an urchin ever brushes past just as you land and nothing happens, that was the grace timer doing its job.

A few tips that follow straight from how the game is built:

  • Treat sand lanes as waiting rooms. There is no clock in Reef Hop, so stopping costs you nothing. Wait for a wide gap, then go.
  • Hop when the gap is in front of you, not when it is about to be. The grace window is short. It covers a near miss, not a hop straight into a passing urchin.
  • You can queue up to two hops. Tap during a hop and the turtle will do the next one as soon as it lands. That helps across a double lane, but only if both gaps are open.
  • Stars are worth 5 hops each. A sideways step to grab one is often worth it, as long as you are on sand.
  • You can step back, but not far. The turtle cannot drop more than four lanes behind the furthest point it has reached.

If you are a parent wondering whether Reef Hop suits a younger child, our parents' guide covers what to expect from each game on the site.

Games in this post