I'm enraptured by this Zelda maniac who worked out there are 1 quadrillion 83 trillion 414 billion and 90 million possible permutations for a dog race in Majora's Mask

12 hours ago 26
The cover art for Majora's Mask showing Link and various other characters from the game.
(Image credit: Nintendo)

Yes it's a Zelda game, but bear with me because this is a story only possible on PC. The Legend of Zelda: Majora's Mask was first released on the Nintendo 64 in 2000, and since then has been the mainline entry that all the cool kids say is best. There are plenty of reasons for this, from the grim and unsettling atmosphere to the brilliant Groundhog Day structure, but one of the enduring appeals is all of the game's mysteries.

Most of these are intentional and authored by Nintendo, but some are not. And one of the biggest unresolved questions about Majora's Mask is about a dog racing minigame where, to put it mildly, the odds are heavily stacked against one blue dog in particular.

Yep, this is an underdog story. At the back of Romani Ranch there's a location called Doggy Racetrack, where the player finds 14 dogs: Four are coloured white, three beige, three gray, two brown, one gold and one blue. Link can place a bet on any dog and then watch a race play out… except not all dogs have been created equal.

First of all, the game is designed in order for the player to exploit it. Once Link has obtained the Mask of Truth, you can equip this and pick up the dogs to tell what they're thinking: Dogs with happy thoughts are likely to finish higher, while dogs that are under the weather are a bad pick. On top of this, the gold dog is a bit of a winner, and when his thoughts begin with "ruff" a first place finish is highly likely.

The blue dog, on the other hand, is one of life's losers. So much so that the blue dog is a kind of mini-meme within the Majora's Mask community: It just never wins, to the extent that everyone thought (not unreasonably) it couldn't win. There are several factors going into this but, in order not to bore you with math, the blue dog has a lower base speed than all the other dogs and, despite there being a small element of RNG to this base speed calculated on each frame, over the course of a race that is going to hurt it relative to the rest of the pack.

Majora's Mask fans have wondered for years whether it was possible for the blue dog to win, and the first glimmer of hope came when the existence of a glitch in the race was confirmed. Again simplifying things, the way the game triangulates where the finish line is also creates a tiny sliver of the track halfway round that can trigger the end of the race early: But the line is so small, and the chances of a dog being positioned on it so low, that it's incredibly rare. This glitch had previously been suspected before it happened live to various well-known Majora's Mask speedrunners.

The below video by Vidya James does an excellent job of explaining the entire blue dog saga, and goes into detail on the parts I'm simplifying as well as including all the relevant clips. But this glitch was key in encouraging an individual who goes by Falkush to start messing around, and seeing if they could come up with a legitimate in-game scenario where the blue dog wins.

Keep up to date with the most important stories and the best deals, as picked by the PC Gamer team.

Thing is, and this is what enraptured me about Vidya James' presentation, the 14 dogs, their various moods, and the different speeds and RNG influence all add up to a mind-boggling number of permutations. I just don't have the math knowledge to check this so I'm taking his word for it: There are one quadrillion 83 trillion 414 billion and 90 million possible permutations of this dog race. 1,083,414,090,000,000 potential dog races. If you were to run each of these races at the game speed, it would take 34 million years.

Faced with such an insurmountable number, Falkush wrote a script that would run the race repeatedly on an emulator from the same starting state: One where the blue dog is in the best possible mood, maximising its chances of winning. After each race it advances the game by one frame to change the hidden RNG value for the next race before it starts. By automating the process (with some clever use of an auto-splitter to record race results for Falkush to later check-over) Falkush was able to get the game running thousands of races a day.

After three days and 8,410 races, this happened:

The blue dog's first-ever recorded victory, thanks to the glitch. The fact it only took 8,410 races indicates the glitch may be more common than thought, but in the glitch-less races the blue dog was still lagging with its best finish fourth place.

This wasn't enough for Falkush, who wanted a legitimate blue dog victory. They tweaked the script to not only maximise blue dog's chances, but minimise the chances of the gold dog and the other faster dogs (based on their pre-race condition). If there were any circumstances under which the blue dog could win, this was them.

Falkush has a Github repository showing all their work brute-forcing blue dog, should you be so inclined, but all that most of us need to do is watch the below: After over 30,000 attempts, the first-ever legitimate recorded blue dog victory in Majora's Mask, well over two decades after release.

Blue Dog True Win (Majora's Mask N64) - YouTube Blue Dog True Win (Majora's Mask N64) - YouTube

Watch On

This story encapsulates everything I love about speedrunning. The practice is not just about watching someone go through a game fast, but about how people get into the guts of games, reverse-engineer what's going on, and set themselves challenges to solve. There's no world record for the blue dog winning the race in Majora's Mask: People just knew it wasn't supposed to happen, and it possibly couldn't happen, and decided to tinker around inside this little universe to see if, in any possible reality, blue dog could win. It's a testament to ingenuity, hard work, community collaboration, and of course object proof of that old canard: Every dog really does have its day.

Rich is a games journalist with 15 years' experience, beginning his career on Edge magazine before working for a wide range of outlets, including Ars Technica, Eurogamer, GamesRadar+, Gamespot, the Guardian, IGN, the New Statesman, Polygon, and Vice. He was the editor of Kotaku UK, the UK arm of Kotaku, for three years before joining PC Gamer. He is the author of a Brief History of Video Games, a full history of the medium, which the Midwest Book Review described as "[a] must-read for serious minded game historians and curious video game connoisseurs alike."

Continue reading