COLUMN: @Play: 'Spelunk, Spelunk, Spelunk'
February 6, 2009 4:00 PM |
['@ Play' is a monthly column by John Harris which discusses the history, present and future of the Roguelike dungeon exploring genre.]
"Probably the easiest way to describe Spelunky is that it's (kind of) like La Mulana meets Nethack - every time you play the levels, items, monsters, and so forth, are all procedurally-generated. [...] My goal was to create a fast-paced platform game that had the kind of tension, re-playability, and variety of a roguelike. In roguelikes, the gameplay tells the story, and I wanted to give Spelunky that type of a feeling... but make the player rely on their reflexes rather than their brain (or knowledge of what 50 billion command keys do!). If there's a best of both worlds, that's what I was trying to go for."
-- Derek Yu, introducing Spelunky on TIGSource Forums.
Spelunky has been talked about on a fairly substantial number of blogs in the short month of its public existence. Considering that its aim is to bring some of the unique characteristics of the roguelike games into a different genre, I figured it was fair game for examination here. The result is quite a clever little game, highly addictive and quick to play. Death is incredibly frequent, but that should come as no hindrance to us, right?
Right?
[Note: This is @Play's fiftieth column. At the end is an overview of topics already covered and a list of links to them.]
The object of Spelunky is to work through a series of cave levels, avoiding damage and sudden death while collecting treasure and working towards the mysterious goal. Every level begins with the player at the top, the exit somewhere at the bottom, and a lot of loot and pain to discover along the way. Yep, sounds like a roguelike all right.
But Spelunky is a platformer, an action game presented with a side view. Its controls are greatly simplified, and the emphasis is on finding clever ways around obstacles. Treasure is found in the form of money and jewels, as extra supplies, as carryable tools like teleporters and shotguns, and as special equipment ranging from climbing gloves to jetpacks.
Making its array of dynamically-created action puzzles possible is a fairly deep system of object interactions, which helps to push this borderline case back into our purview.
Nearly everything can be made use of in the right circumstances, including a lot of the enemies who are trying to eat our poor hero, unofficially dubbed "Indie" by the TIGSource Forums. Bats can be lured to set off arrow traps. Exploding frogs can break open sealed chambers. Falls from great heights can be survived by landing upon a hapless snake. One of the most impressive examples of these interactions has to do with the many ways of defeating arrow traps. Found in the first four levels, they are one of the game’s most interesting obstacles, and they well illustrate the kind of situations the game's excellent random level algorithm can produce.
Avoiding the Point
One of the best ways to design traps, in other games as well as in roguelikes, is to give them an activating method, to simulate some operating mechanism. Not to just automatically harm the player when he enters the trigger area, but set some process in motion that harms him. It feel less arbitrary, but it potentially gives him a way of escaping the effect if he can come up with a way to avoid or subvert the process. In Nethack, for example, levitation means floor triggered traps or pits will not be set off, and if one can find and move the boulder-half of a rolling boulder trap, it is made harmless. This way it feels lell like damage by fiat. It makes sense.
Spelunky’s arrow traps are another good example. They operate by sensing motion. It doesn’t matter what, of the game’s many types of objects, is doing the moving. What follows, in the name of examining the kinds of design decisions that went into making Spelunky, is a fairly in-depth examination of them. It should go without saying that this is a spoiler, although in this game it's a relatively minor one.

In the image above, the trap is circled in white, and the extent of its sight range is represented by the red line. That’s about six-and-a-half blocks in front of the statue. The orange line shows about the route the arrow will follow.
Now take note that, in Spelunky, objects in rapid motion may harm the player. A stationary or slow-moving arrow is harmless, yet if you throw a rock against a wall so it bounces back and strikes you at full speed it’ll hurt you. So, when the arrow reaches the end of that orange line it’ll be at rest on the ground and cease to be a problem. If there were a wall in the way, the arrow would bounce off, and possibly harm Indie on its rebound. If it hurts it hurts bad, for arrow hits in Spelunky do two points of damage. That's half the player’s base total, and a enough penalty this early in the game to warrant a restart unless some other advantage has been found.
One way to thwart an arrow trap is simply to fall straight down through its watch line. If the player is a full block away from the trap as he falls by the arrow will miss him, even with the arrow’s high speed. So, falling from point 1 will set the trap off safely… but only if the player can bend his fall so he lands on the steps below; if he landed on the low portion of the ground, the fall might be enough distance to inflict a point of falling damage. (This, mind, could be avoided by doing a ledge-hang from the upper platform, a good technique to utilize if you’re unsure if the fall is safe or not.)
If the player is approaching from ground level, then the situation is a little trickier. In many cases then it might be best to walk under the trap and let it be. But what if there were some prize on the upper route the player wanted to obtain, like a supply box or treasure chest? Standing on the upper-most step, at point 2, and jumping is a bad move. Indie would set off the trap at the apex of his jump, leaving him hanging for too long in the arrow’s path, giving it plenty of time to strike and bleed off two pints.
But one of the enemies circled above is a bat. Bats trigger when the player enters a wide area beneath it, causing it to give chase. They’re slow enemies, so in this case when it crosses the red line it’ll trigger the trap and get killed instead of the player. Just standing at point 2, at the top of the stairs, should do the job. Triggering the spider would probably work too, though it activates only if Indie walks directly beneath, and it's more unpredictable in its attack than a bat.
What if the player is moving in from the right, and wants to pass the trap going left? It’s a little expensive resource-wise, but he could drop a bomb above the trap at point 3 to outright destroy it. The player would have to be sure to get out of range of the blast; bomb hits are instant kills in this game. In a pinch he could also throw the bomb across from either point 3 or, in an upward arc, from point 4, and use its motion to set off the trap. Bombs are important equipment though, and it’s best to look around for something else, like a rock, jar or skull to throw and set off the trap.
If none of these tools are available then it’s really best to avoid setting it off at all, but if the player could find a way to enter the trap’s sight at the very end and move slowly, he might be able to take advantage of the difference between its straight vision range and the arrow’s curving path. This can be used to safely trigger arrow traps lying on flat ground; if the player slowly walks towards the trap, the arrow will actually hit the ground around the player's feet.
Spooky + Spelunky = Spelooky?
Roguelikes get their tension from the fact that the player, ideally, never has all the resources he might want. The tradeoff used in Rogue is food vs. experience; the player could stick around on the easy levels forever killing weak monsters to rise in level if he didn’t have to keep moving to keep himself fed.
Spelunky’s version of this takes the form of the Ghost. On all levels except the first and last, there is a two minute timer on the level. After that the music turns spooky and a warning message is displayed. 30 seconds after that and the Ghost enters the level, relentlessly chasing the player down and causing instant death on contact.
Some have complained about the timer, but I find that it’s a brilliant addition, and the time limit seems quite well-tuned; if the player is working towards nothing other than reaching the exit then he has plenty of extra time; most levels can be beaten in less than a minute. But there are plenty of other rewards to find: damsels to increase health, idols worth a fortune if brought to the exit, and an abundance of gold and jewels.
There are also shops to buy from (or rob), supplies to collect and treasure to uncover. If the player is going along collecting these things as fast as he can, he might be able to get them all, but he’ll have used up lots of his bombs and ropes getting them, and has probably taken a good amount of damage as well. The proper way to look at it is to look at an early exit, in the early levels at least, as a waste of resources. There’s no benefit from having extra time at the end of a level (except for achieving a special trophy), so the player must strike a balance between efficient progress and loot collection.
Somewhere, Izchak Miller is Looking Down on Us, Smiling
Of most interest to us roguelike fans is perhaps Spelunky's shops, which are lifted just about as completely as possible, given the completely different style of game it is, from Nethack. In Nethack a shop is a room with a shopkeeper at the door; the primary reason not to steal from the shop is that the owner will attempt to take out payment in flesh if you abscond with his merchandise. Spelunky's shopkeepers are similarly protective over their inventory; every one of them carries a shotgun, perhaps the game's most formidable weapon.
The following things will draw the wrath of a storekeep: walking out of a shop carrying inventory without paying, damaging the walls, floor or ceiling of a shop, harming inventory or otherwise causing it to leave the premises, harming the shopkeeper either directly or indirectly, or sending an instakill object into a shop. (Throwing in a bomb is particularly entertaining, even if you are unlikely to survive the situation.)
Even if you escape the shopkeeper, or manage to kill him, all the remaining shopkeepers in the game will be out for blood. They'll also camp out by the exit waiting for you for a couple of levels. Of course, there are strategies to decrease the danger of robbery,but… but I don't think I'll be spoiling those kinds of things today, sorry.
Raising Real Estate Values in the Caves
For everything Spelunky does well, there are a couple of things that could perhaps use some work. (Well it is beta software after all.) What there is usually errs on the side of being just a little too difficult. There are a number of carryable items the player can use; firearms, exploration tools, flares, idols and damsels. But only one of these things can be carried in-hand at a time. The player can make due by running back and forth ferrying items along towards the exit, but this is somewhat annoying, and rapidly approaches unworkability as the player juggles more than two such items.
This could be seen as a limiting factor, to prevent people from being able to make full use of their inventory or to limit their usable possessions, but when the player encounters a dark level, carrying around a flare is essential unless the player wants to stumble into an arrow trap or jump down onto a bed of spikes. The result: dark levels tend to act as an effective barrier to carried items, making it difficult to keep even a single useful tool, like a shotgun, through them.
Even if the player manages to keep a flare all the way through a dark level, the odd way that light behaves in the game makes them less useful than you'd think. All light sources in a dark area display a very small portion of the (otherwise black) terrain around them. The player has a similar aura around him. If the player is physically close to a light source however, his own circle expands, getting bigger the closer he is. The upshot is, the technique of throwing a flare into a hole to see if there's spikes, monsters or arrow traps nearby is less useful than you'd expect, as the flare won't reveal anything beyond a block around where it lands. (It may also find water, which kills the flare.) To see further, the player will have to jump down to be closer to the flare, but will then probably end up getting feasted upon by whatever lurks there unseen. This is potentially a big problem with the man-eating plants in some of the later levels.
Those arrow traps I mentioned before, for all their charming complexity, have a problem that makes them slightly too difficult in certain situations. Their sight range is 6 and 1/2 blocks. The play window 20 blocks wide. The player is typically in the middle of that, giving him 10 blocks of vision horizontally. The result is, when walking along level ground, the player tends to have little time to react to arrow traps lying on the ground in front of him, especially if he's using the run button to escape some other danger, like giant spiders or crushing boulders.
Some of the later areas are unusually demanding upon the player's supplies and equipment. He begins with four bombs and four ropes. Bombs can break through rock, generally one space horizontally and two spaces down; ropes allow the player to go upwards in a level without needing platforms to rest on. Extras can be found in the levels and bought in some stores, and while they're often common, they're just as often absent in the game. Not to spoil things unnecessarily, but the third area (levels 9-12) seems particularly bad in this regard. Making it through usually depends on loading up on ropes on the earlier levels, but sometimes there just aren't many ropes to be had.
All of these things comes to matter a little more than it might in a traditional roguelike because Spelunky severely limits the number of hit points the player has. He has no maximum, but can only regain hits from damsels, and then only one at a time. Each level contains an huge variety of ways to get hurt for one or more hits, or get instantly killed, and our hero only has one life. As a result, everything that can harm the player effectively does so permanently; the player can never let himself just eat damage to get through a tiresome situation. This may be the hardest thing of all about Spelunky, and it's something that even roguelikes tend to offer more leeway towards; to regain health in most, the player need only find a monster-free room and rest a few dozen turns. I can't say if Spelunky's system really works; most games end far short of level 15, even for an experienced player, unless he gets a lucky break along the way. But then again, the action-oriented nature of the game, and relatively large number of empty spaces, means the player is more more able to avoid damage than in Rogue or its kin. It seems to be another case where the game is only slightly too hard.
Spelunking Along, Singing a Song
Yet surprisingly, these issues don't detract from its addictiveness too much. Overall, difficulty is only a little high considering the mood of game; that is to say, the game is often brutal yet fair. It's only when the flipside of that "often" comes in that the player is screwed over, and then it's usually masked well enough that he's not sure if it was his fault or not. And in a game where you're expected to die hundreds of times before you win; the fact that the game plays so quickly helps to counter the frustration this might otherwise cause.
Spelunky's generation system seems to work by filling in map spaces with sections of pre-generated level templates and then "roughening" them up a bit before inserting extra blocks, monsters, traps and treasure. It's a mechanism not used often in true roguelikes, but it seems to work rather well for a platformer. And it's good that Spelunky doesn't tame its level design too much as it generates its randomized levels.
Lots of commercial games that make use of random generation do that. In their efforts to ensure all areas are fairly completable, they also restrict a lot of interesting generation results. Those interesting juxtapositions and finding ways to overcome them, or even utilize them, are most of the fun to be had in Spelunky, and it turns out to be rather a lot of fun after all. This makes me rather anxious about my complaints above: in a rush to fix them, it would be easy to go overboard and rob Spelunky of its delicious challenge. This, really, is the biggest challenge to roguelike design: making it hard but fair. To thrust the knife at the player's throat, but to never touch him, relying on his own actions to push it in.
This is @Play's fiftieth post! Here's a listing of prior columns (thanks to the links page at http://nethackwiki.com/), sorted by topic:
Overview:
A View of the Field
Roguelikes and OD&D
More on Roguelikes and D&D
Learning to play:
Introduction
Keypresses
Roguelike movement & implications
On specific games:
Rogue
Pokemon Mystery Dungeon Blue & Red Rescue Team
ToeJam & Earl
ADOM
Dungeon Crawl
DoomRL
HackLite
Mysterious Dungeon series
Seven Day Quest
POWDER
Angband
SLASH'EM
Mystery Dungeon: Shiren the Wanderer DS
Larn
Super Rogue
Izuna: Legend of the Unemployed Ninja
Vulture's Eye & Vulture's Claw
Legerdemain
Monstania
Incursion
Spelunky (You are here.)
Roguelikes as stories:
Giant Eel Stories, Volume 1.
Giant Eel Stories, Volume 2
Storytelling in roguelikes
Playthroughs:
Taloon's Mystery Dungeon
Shiren the Wanderer SNES Part 1
Shiren the Wanderer SNES Part 2
Minutae:
Ways to die in Nethack
Metagame elements
Humor in Nethack
Quests in ADOM
Wishing in Nethack & spoilers in general
Shiren the Wanderer: Fei's Problems
On representing monsters as letters
Items (overview)
Development:
Nethack patches
Borg players
Dungeon generation algorithms
Game balance in Nethack
Homebrew Roguelikes on the Nintendo DS
The Nethack source code
Time and speed in roguelikes
Social:
devnull 2008 (10th anniversary)
devnull 2008 interview
Categories: Column: At Play
16 Comments
Great read. I'm definitely interested in seeing what the 'roguelike' approach can do to other genres.
Andrew Doull | February 6, 2009 5:15 PM
I second Andrew's thought, and furthermore, I demand to see a 'roguelike approach' post-apocalyptic racing/driving game wherein there are randomly generated paths, with survivability concerns (food and gas) constantly nipping at your ankles. Rewards for choosing intelligent paths based on previous knowledge of the game to avoid conflict and find caches of supplies. Areas with varying levels of safety for camping out overnight, and strategies for protecting yourself when you have to sleep somewhere questionable. Pimp your ride (ha) to try and keep up with increasingly tough dangers as you trek towards the last remaining human city.
Well, chop chop. We've got to get this terrible idea made so we can start on the randomly generated dungeon Golf concept.
P.F. | February 7, 2009 3:28 AM
Baroque (Wii/PS2 remakes) isn't in the topics list, and it was one of my favorite games from last year. It's definitely worth a look as a real time action RPG / roguelike hybrid. Review please :)
Lucas | February 7, 2009 7:49 AM
P.F.: Neither that, nor the dungeon golf game, sound like they would be necessarily bad.
Lucas: I've considered writing on Baroque several times. I haven't yet because I prefer to have played a game before I write on it, and I haven't had the chance yet.
John H. | February 7, 2009 12:01 PM
Another great column John H....definitely a game and endeavor I can get behind that could well get an entire mass of people thinking on Roguelikes that prior had no reason to consider it.
Otherwise, I've come across a fresh doozy for ya:
http://trianglewizard.webs.com/index.htm
I was blown away by the potential of this, and that much of it is already realized. The trailer and explanation in the "What's this?" part explain things excellently. I definitely think it is column worthy somewhere down the line as you work through the backloggery and such.
getter77 | February 7, 2009 1:04 PM
getter77: Noted, will investigate, thanks.
John H. | February 7, 2009 5:46 PM
John, this is my favorite column on GSW by a long way. Fascinating stuff, please keep it up.
Omroth | February 8, 2009 3:59 AM
@John: I'll give you the driving game, but the golf thing? Well, I'm sure it could be well made. I'm just curious about it now.
Been catching up with past articles thanks to this post. I've played Mysterious Dungeon games and Dwarf Fortress (not completely that related, I know,) but I think the last time I tried to play NetHack I ran in fear from not knowing what the hell I was doing.
These articles have inspired me to maybe try again.
P.F. | February 8, 2009 12:22 PM
P.F.: The weird thing is, there has already been a combat golf game! Ninja Golf for the Atari 7800 had traditional golf sections, but action combat between shots.
How I'd do a randomly-generated golf game is to have randomized hole layouts (of course), but also perhaps start out players with a small number of clubs and offer them the chance to earn extras along the way by hitting the ball into designated areas. (Well, it's one possibility.)
It's funny, but after all the columns on aspects of Nethack, we've yet to have one on Nethack in general. I think I've avoided it under the assumption that it was just too complex a game to treat in one column, but we've done ADOM (though probably not well) and Angband. Hmmm, might be worth a shot.
John H. | February 8, 2009 6:39 PM
John: Ninja Golf and pizza on bagels. The world is an amazing place.
Could actually be fun to set a golf game amidst lots of fantasy elements (as cheesy as it sounds,) and use normal golf scoring as a factor; either as hunger, having to watch your total score and keep it below a certain amount (alterable with difficult-to-obtain items), or as a means of reward and how you attain things that will let you deeper into the 'dungeon' or whatever you're traveling through.
Usables, equipables, and randomly generated obstacles could all factor into what strategies a player has to use to get through holes quickly.
In any case, I was wondering about an article on NetHack myself. I'd figured you hadn't done so because it's the king of the hill at the moment and doesn't need the coverage, but I'd love to hear what an experienced player has to say about it. Picked up POWDER, by the way, because the 6-button interface seemed pretty user friendly. Also, newest version seems to come with a very helpful tutorial! Very enjoyable thus far.
P.F. | February 8, 2009 7:32 PM
The golf talk has me actually wondering about what it would take to see this implemented. Hmmm....
On Nethack being king of the hill: Well, it's weird. Nethack's fortunes have actually fallen a little lately I'd say. In some circles Nethack is on the outs, the massive amount of spoilers needed to play well being a major reason. And yet, it's still probably my favorite roguelike; ultimately there is nothing in it that isn't just another version of the same kinds of things as scrolls of scare monster and potion throwing in Rogue. It's just taken to its utmost conclusion. Nethack's biggest fault, indeed, may be that it's actually too easy, or more precisely the player is too able to take his fate into his own hands. Instead of making due with what he finds, there may be too many guaranteed resources.
John H. | February 9, 2009 1:21 AM
I think prototyping an isometric Golf-like version wouldn't be that hard at all with things like Construct and Game Maker around. Working with simpler prototypes for other things in Construct as we speak. As far as an actual 3D 'Golf' game goes, not sure. Not familiar with any 3D engine creation whatchamabobs. Might actually need a codemonkey for that.
(I think just sitting down and writing a design doc to thoroughly identify what elements to lift out of RL's and adapt for something like that would take even longer than popping together a basic version in, say, Game Maker. Heh.)
It's practically frightening to hear you say those things about something so foreign and monolithic like NetHack to me. Heh. But I could see, at the very least, that maybe these things you're talking about are more than anything detracting from the emergent storytelling aspect of the game? That once the player has his proper 'knowledge set,' that the triumphs and failures that would come through in most stories from a randomized game become diluted by the amount of static things that a skilled player does every single game he (or she) plays?
I know the gut-busting parts of most early Dwarf Fortress stories were entirely randomized events and the sheer absurdity of them; when something completely unpredictable would be the end of a campaign, or when temporary victory came from a frantic and cobbled together effort and not carefully planned, well informed strategy. Different sorts of games, of course, but I think they do share the gift of emergent storytelling.
P.F. | February 9, 2009 4:37 AM
The key to doing the random golf game, I expect, is to do it in a tileless form. To use an image buffer to hold the course and keep it overhead view. Maybe include a quasi first-person view, along the lines of NES Golf, but that wouldn't be strictly necessary. Hell, maybe even display the course using ASCII graphics? Why do I have an urge to try this out in a 7DRL? Probably won't find the time though....
Anyway, if kept in an image buffer then library drawing functions could be used to construct the course. I believe most golf courses use round, or roundish, shapes in their construction because they're attractive landscaping, and so using circle plotting functions could do that easily.
Nethack is really not that complicated. Well okay, it IS, but a lot of that complexity irons out into being irrelevent 99-100% of the time. It can be reduced down into a number of rules of thumb that will serve most players well enough to ascend. Things like getting Poison and Magic resistance as soon as possible, being careful around cockatrices, how to make and use holy water, what to do in the castle, getting the most out of a wand of wishing, etc. Maybe I should do a column on this.
Dwarf Fortress, yes, I think most people became enamored of it because of those Something Awful play reports. It's not a roguelike (well, not in its primary play mode) but it is ROGUELIKE-LIKE. Tarn Adams says a lot of the ideas for the game come from his brother's stories, which may explain why the game seems so narrative-rich.
John H. | February 9, 2009 1:43 PM
Just dropping a note to say congratulations on the 50th article, John. @play is my favorite (semi-)regular gaming read.
Phil Nelson | February 9, 2009 8:24 PM
As intimidating as it sounds, those specs for the golf game sound the most fitting without going full-blown PhysX 3D nonsense. Still, I'm not opposed to a tile-based environment either.
And by all means, write away concerning NetHack! What better way to cover the modern state of RL's than to speak at length on one of the primary examples of the genre. I'm sure you'd well address (even moreso than you already have) how the current state of things in, say, NetHack relates to both the past and future of the genre as well.
When it comes to that sort of storytelling I think more random elements and more personality in the individual units in the game do lend themselves better to emergent storytelling.
P.F. | February 10, 2009 3:51 PM
Congratulations on fifty columns. Has it really been four years?
Ribbit King and the GameBoy Mario Golfs both did a nice job of integrating other gameplay systems into golf. Mario Golf had a structure for leveling and gaining abilities through equipment, though there wasn't much exploration and the actual play was pretty standard. Ribbit King was more interesting, as most of the changes increased the level of unpredictability, where a slight mishap could send your frog hopping to a completely unexpected place.
It would be interesting to play a golf game with randomly generated levels that hid some of the terrain effects from the player until they hit a ball into that area.
mister slim | March 2, 2009 12:44 AM