Skip to content

Spelunky

Derek Yu's cave-diving platformer, rebuilt on every visit

Derek Yu's Spelunky, a free PC game made with Game Maker and released in December 2008, put the random levels and permanent death of roguelikes into a real-time platform game. Yu published its source code a year later. A rebuilt version with new art and multiplayer came to the Xbox 360 in July 2012, followed by other platforms, and Spelunky 2 arrived in 2020.

Spelunky is a platform game you can never learn by heart. Each time the player’s small, whip-carrying explorer drops into the mines, the caves are rebuilt: new tunnels, new traps, new shops, a new place for the exit. Die, and it is back to the first level with nothing, to a first level nobody has seen before. Derek Yu made it with Game Maker and gave it away as a free PC game in 2008. “I was working on some simple platformer and roguelike prototypes,” he told Retro Gamer, “when it occurred to me that a randomised platformer might be fun.” Edge, reviewing the rebuilt Xbox 360 version four years later, called it “Derek Yu’s masterpiece” and concluded: “You may finish Spelunky, but you’ll never complete it.”

Fast facts

  • Designer: Derek Yu; the later versions were made by his company, Mossmouth.
  • Original: freeware for Windows, first released on 21 December 2008, made with Game Maker.
  • Source code: published by Yu under the Spelunky User License, a non-commercial licence, with version 1.1 in December 2009.
  • Xbox 360: released on Xbox Live Arcade on 4 July 2012, with new art, music and multiplayer.
  • Later versions: PC, PlayStation 3 and PlayStation Vita (2013), PlayStation 4 and Nintendo Switch.
  • Sequel: Spelunky 2 (Mossmouth and BlitWorks), PlayStation 4 and PC, September 2020.

A randomised platformer

The idea came from mixing two kinds of game. Roguelikes such as Rogue and NetHack build a new dungeon every game and end it for good when the character dies. Platform games have hand-built levels that players learn by repetition. “Everyone loves a good platformer, but playing the same levels over and over again can get tiresome even if they’re imaginative and well-designed,” Yu said. His hope was to “generate levels that were interesting enough to keep people playing over and over again, excited to see something new each time”. It was not hard to get working: “My level generation algorithm is pretty simple and once I got it working the rest of the ideas fell into place.”

The generator does not simply scatter tiles. “Spelunky levels are actually just a series of rooms that are stuck together,” Yu told Edge, “and the challenge is then to make it feel like it wasn’t built that way.” A shop is one room; a snake pit is three stuck together. “You can’t just glue random stuff together,” he said. “Randomisation adds a lot of stuff in and of itself, but the special stuff makes it really work.” Much is fixed. The worlds always come in the same order, from the mines through the jungle and the ice caves to the temple, and certain objects are always waiting somewhere in each. Edge thought the result was “procedural, then, but it still feels handmade”. The procedural generation entry follows the technique back to Elite and Rogue.

The game looks a lot like Core Design’s Rick Dangerous, a 1989 platform game whose explorer hero crash-lands in South America and fights his way into a temple, but Yu told Retro Gamer he had only ever seen videos of it. What he liked about old games, he said, was that they “tend to treat discovery as a sacred part of play”, and he told Edge he loved the original Zelda. “Comfort is the last thing I want out of a videogame.”

Everything reacts

Yu built the game from simple rules that apply to everything. “If you can pick up a rock you can throw it, and that means you can pick up an enemy, or another player,” he explained. The player starts with a whip, a few bombs for blowing holes in the scenery, and ropes for climbing out of pits. A spider can knock the explorer into the path of an arrow trap, which bounces him into a caveman. Golden idols are worth a fortune but set off a trap. Linger too long on one level and an invulnerable ghost comes looking. Rescuing a damsel and carrying her to the exit earns an extra point of health; the Xbox version added the options of a man or a dog instead.

The shops show how the rules fit together. Their stock is random, so a jetpack or a shotgun might turn up on the first level. Their owners, though, all behave the same way when crossed. Yu told Edge the shopkeepers came from the game’s roots in roguelikes, where stealing is normal and so is killing the thief. Rob one and he opens fire; escape, and every other shopkeeper in the game is waiting. “That’s straight out of Roguelikes, really,” Yu said of the chains of accidents the game produces. The humour, he said, “was more of a happy accident”. Edge found the list of what had killed its reviewer read like “one part Indiana Jones fanfic and one part Goosebumps paperback”, while the real causes were “haste, carelessness, corner cutting, greed”.

Death is permanent in the roguelike sense: there is no saving partway through a run. The permadeath entry follows how Spelunky and the games after it changed the idea.

The Xbox 360 version

Spelunky’s own site tells how the freeware game reached a console: Braid’s creator, Jonathan Blow, put Yu in touch with Microsoft. The Xbox Live Arcade version came out on 4 July 2012. Andy Hull was lead programmer and Eirik Suhrke wrote a new soundtrack; the original music had been by George Buzinkai and Jon Perry. “Even with the basic concept left largely untouched it was still a monstrous amount of work for three people,” Yu told Retro Gamer. “It’s much more than a port of the original.” He replaced the pixel art with a painted style, rebalanced much of the game (shopkeepers became easier to deal with, and torches were spread through the dark levels), and added up to four players, cooperating or fighting each other.

Edge previewed it early in 2012 under the title Spelunky HD and noted that before Dungeons Of Dredmor and The Binding Of Isaac “there was Spelunky, a freeware PC title”. Its review that September found the rebuilt game “just as fair” and “every bit as tantalising”. Versions for the PC, PlayStation 3 and PlayStation Vita followed in 2013. Yu was surprised by the game’s run: “I never imagined that little freeware game would come such a long way.”

Spelunky 2 and after

The success of Spelunky came as independent games were finding an audience. Edge grouped it with ADOM and NetHack in 2010, and Wireframe wrote in 2020 that “Spelunky assembled new levels to explore each time you played, and hundreds of rogue-lites followed suit”. The roguelike entry follows that line.

Yu wrote a book about making the game, Spelunky, published by Boss Fight Books in 2016. Spelunky 2, made by Mossmouth with the studio BlitWorks, which had converted the first game to Sony’s machines, came out in September 2020 for the PlayStation 4 and the PC. It split the route through the caves into branches and crowded every level with more creatures and traps. Wireframe gave it 83% and called it “a bullish, uncompromising love letter to its masochistic fan base”, though it found death in the sequel was more likely to bring “a sigh, rather than a chuckle”.

Sources

  • “A moment with… Derek Yu”, Retro Gamer issue 107, October 2012, p. 14: the origin of the idea, random levels, the generator, the original soundtrack, Rick Dangerous, discovery in old games, three people working on the Xbox version, the painted art, the game’s success.
  • Computer and Video Games issue 93, August 1989, p. 53: Rick Dangerous advertisement (Firebird; crash-landing in South America, the temple).
  • Edge issue 237, February 2012: Spelunky HD preview (freeware origins, whip, bombs and ropes, damsels, co-op and deathmatch).
  • Edge issue 244, September 2012, pp. 86–91: Spelunky review (Xbox 360) and interview with Derek Yu (rooms stuck together, handcrafted elements, Zelda, humour, rebalancing for Xbox Live Arcade, rocks and enemies).
  • “Spelunky’s shops”, Edge issue 246, November 2012: random stock, shopkeepers and their roguelike origins.
  • Edge issue 213, April 2010: roguelike feature (ADOM, Spelunky, NetHack), as cited in the indie games entry.
  • Edge issue 260, December 2013, p. 71: Spelunky on PlayStation 3 with a Vita as controller.
  • Wireframe issue 32, February 2020: “hundreds of rogue-lites followed suit”, as cited in the permadeath entry.
  • Jon Bailes, Spelunky 2 review, Wireframe issue 44, October 2020, p. 98: PS4 and PC, Mossmouth and BlitWorks, £15.99, branching routes, 83%.
  • Spelunky World, Mossmouth’s site for the game (web, secondary; the developer’s own pages): freeware in 2008, Jonathan Blow and Microsoft, the Xbox Live Arcade release on 4 July 2012, Andy Hull and Eirik Suhrke; the Spelunky Classic page with version 1.1 and its source code, which requires Game Maker. https://www.spelunkyworld.com/info.html and https://spelunkyworld.com/original.html
  • “Spelunky User License v1.1b”, Derek Yu and Mossmouth, last updated 25 December 2009 (web, secondary): the licence for the source code. http://www.spelunkyworld.com/files/COPYING.txt
  • “Spelunky” and “Spelunky 2”, Wikipedia (web, secondary): the first public release on 21 December 2008; the 2013 versions; Spelunky 2 on PS4 on 15 September and on the PC on 29 September 2020. https://en.wikipedia.org/wiki/Spelunky
  • Boss Fight Books, Spelunky by Derek Yu (web, secondary; the publisher’s page): published 29 March 2016. https://bossfightbooks.com/products/spelunky-by-derek-yu

See also

Checked. Verified against primary sources and signed off by a person.