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

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.

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 start a new race every second it would take 34 million years to do so.

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 Stanton
Senior Editor

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."

Read more
Pint, a lalafellin mage, looks towards the sunset sky and closes his eyes in gracious defeat in Final Fantasy 14.
FF14 streamer yields to the MMO's bounciest catgirl, after inspiring them to beat his new speedrunning record 3 times before he could finish making a video about it
A cameraman, floating in a cloud, looks rather unhappy at Mario in Super Mario 64.
Viewers watch in horror, unable to help, as blindfolded Super Mario 64 speedrunner almost gets a world record that wouldn't have counted: 'I would've cried'
A pack of real life Balatro cards.
Turns out that Balatro, like Tetris before it, can only be 'finished' by scoring so high it crashes the game
Diablo leers from the cover of Diablo 1.
Diablo speedrun sleuths proved its 15-year world record was fake after reverse-engineering the game and failing to replicate the run in 2.2 billion possible randomized dungeons
The speedrunner Niftski reacts as he breaks the Super Mario Bros. world record.
Super Mario Bros. speedrunner sets a new world record on a PC using keyboard controls and boldly proclaims they're 'now 0.3 seconds off of absolute perfection'
A Path of Exile 2 sorceress casting flaming skulls in a hellish landscape
Path of Exile 2 numberlord spends 16 straight days killing rare monsters to prove that a stat that makes loot better makes better loot
Latest in Games
Metaphor: ReFantazio character art
Metaphor: ReFantazio battle director says turn-based RPGs can still be just as popular as action RPGs: 'I personally believe turn-based games have a long future ahead of them'
assassin's creed shadows review
Assassin's Creed Shadows streamer goes viral after confronting whining commenters: 'Normal people don't get upset about this sh***'
Assassin's Creed Shadows change seasons - An upper-body shot of Yasuke looking cheerfully up into the distance.
'This is just the beginning': Assassin's Creed Shadows dev team thanks fans for their support and promises more to come in the future
Geralt sitting on a wall wearing a Cyberpunk jacket modded by TheRealArdCarraigh
The Witcher 3 devs had to practically remake the game engine to make official modding possible
Serana from Skyrim, modded to look like a desiccated corpse.
Skyrim realism mod fixes your vampire girlfriend, giving her a voice and look more suited to someone who just got out of a coffin after 2,000 years
Inzoi
Ultra-realistic life sim Inzoi has officially shoved Hollow Knight: Silksong and Deadlock out of the way to become Steam's most hotly-anticipated game
Latest in News
Metaphor: ReFantazio character art
Metaphor: ReFantazio battle director says turn-based RPGs can still be just as popular as action RPGs: 'I personally believe turn-based games have a long future ahead of them'
assassin's creed shadows review
Assassin's Creed Shadows streamer goes viral after confronting whining commenters: 'Normal people don't get upset about this sh***'
Assassin's Creed Shadows change seasons - An upper-body shot of Yasuke looking cheerfully up into the distance.
'This is just the beginning': Assassin's Creed Shadows dev team thanks fans for their support and promises more to come in the future
Geralt sitting on a wall wearing a Cyberpunk jacket modded by TheRealArdCarraigh
The Witcher 3 devs had to practically remake the game engine to make official modding possible
Serana from Skyrim, modded to look like a desiccated corpse.
Skyrim realism mod fixes your vampire girlfriend, giving her a voice and look more suited to someone who just got out of a coffin after 2,000 years
Gabe Newell looks into the camera, behind him is a prop of a turret from Team Fortress 2.
Gabe Newell's cult of personality is intense, but a Valve exec who worked with him says his superpower is how he 'delighted in people on the team just being really good at what they did'