Home

Blog

Spelunky Analysis

A brief analysis on an indie masterpiece.

Spelunky is a very hard 2D platformer game developed by Mossmouth and published by Microsoft. The game is very popular among game developers and hardcore gamers who praise Spelunky for its hard, but fair mechanics and elegant design.

But. What makes this game elegant? What makes it hard but fair? What makes this game click? I played over 50 hours of Spelunky to come to a rather definite answer you can put into practise in your own projects.

Note: It is extremely useful for you as a reader to at least take a look at what Spelunky is and maybe watch a gameplay video or two.

Decisions, decisions and decisions…



Spelunky is a game full of different decisions you have to make. Should I steal from this shopkeeper? Should I bring the damsel and the shotgun or slowly juggle them to the exit? What I found out is that every decision you make is designed to have its flaws. So even though some options are better than others, they each have their own set of pros and cons.

All this and the fact that this game is a roguelike makes making decisions even more challenging because if you make the wrong decision, it might send you back to the start of the entire game. (More about roguelikes later in this article) There are lots of examples of this decision system in Spelunky, but I picked 2 juicy examples to show you this system in action.

The 1 Item Limit



Wait, did you know, Spelunky lets you only pick up one item at a time? There are some exceptions, but this simple mechanic affects most of the game. Why? How?

Spelunky wanting to force tough decisions out of the player, implemented this mechanic for this sole purpose.

Let's say you grabbed a damsel and you are slowly going downwards to bring her safely to the exit so that you can get an extra life point. On the way to the exit, you find a chest which contains a shotgun. Now, you get the tough decision whether to drop the damsel, the shotgun or none. When you decide to leave none behind, you are forced to juggle the 2 items slowly down the level, putting you at risk in attracting the ghost. All the decisions are almost equal, they have their own set of pros and cons.

Creator Derek Yu once said that he didn't want health to be so easy to pick up, he wanted the player to drag the damsel down the level to exit. Unlike other games where consuming something instantly makes the player stronger, after all, Derek Yu wants the player to make tough decisions. Health or weapons, defence or offence, etc.

Shopkeepers

Yes. Shopkeepers, they are designed to kill and annoy you. They are very tempting to steal from, and when you steal, you do get a lot of loot, but the consequences are high too. Because you have stolen from 1 shopkeeper, all other shopkeepers in the whole run get angry at you and try to kill you as well.

The connection between your score and money makes the shopkeepers very tempting to steal from. I mean just look at that jetpack and bomb box. "They are so expensive, but you can also steal you know?", says your brain.

This temptation is purposely put into the game to encourage you to take risks and master those punishments.

This decision-based design forces you to take risks rather than go the easy way out. It is basically a risk/reward mechanic, but there isn't technically a good answer.

Difficulty

Spelunky, as discussed at the beginning of this blog post, is a very hard 2D platformer. But what makes this game hard? And how did Mossmouth prevent Spelunky to become too hard?

Roguelike

This game is, first of all, a roguelike. A roguelike comes in with many different definitions, but (almost) all roguelikes have permadeath and randomly generated levels or worlds, and I think, these are the main reasons for this immense difficulty.

Permadeath is a mechanic where death means starting over, not just starting from the beginning of the level you're in, but from the very first level, yes, level 1-1. This seems like bad game design. Why would you ever make the game start again every time the player dies? Won't the player just rage quit? No. If this game took Skyrim's 32.5 hours to complete, permadeath would cause players quitting, but Spelunky on the other hand just takes 1-3 hours to finish. This makes the permadeath 10x less painful, so very safe to put into the game. Permadeath itself already makes the game harder, but it would be very boring if you have to go through the same levels over and over again after you died. How did Spelunky solve this?

The obvious answer to that is randomly generated levels. Randomly generated levels will make sure that there is always a new level to explore and unlike other platformers like Mario where you can easily just remember the layout of the level, Spelunky forces you to not master the level, rather the mechanics, such as the reach of your short whip, the range of your bombs, your jump and more. This not only makes players masters of the mechanics, but it also makes speed-running more interesting. Whereas in other similar games, the speedrunner has to just repetitively play the game over and over again, it is not really that repetitive with Spelunky. Every playthrough is unique enough to feel different. They all have their unique quirks that put them apart from other titles.

But there is a catch to randomly generating levels because Spelunky generates its levels randomly, there is a risk to making the levels feel boring, impossible, messy, overall not engaging to play through, but Derek Yu successfully balanced generated content with hand-crafted content. Here is how Spelunky generates its levels. I can't explain the concept too well, but Mark Brown's video is an awesome visual way to understand this mechanic:

The generator first divides the level into a 4x4 grid. Firstly, the generator chooses a box on the top layer, this box is where the entrance of the level will be placed. The generator then chooses to go left, right or down randomly to slowly move towards the bottom layer. If it tries to go down again and can't, it makes the last room the exit. Then, the boxes the generator has been are all given a random template. Creator Derek Yu has handcrafted a number of templates for all types of rooms, from rooms that you drop in, and corridors or rooms that let the player drop down.

The boxes the generator didn't touch are given a template too, but without any order, so some of them will be blocked off, others can contain shops or even those golden idols.

Another advantage of this method of generation is that you can choose whether you would like to go into the non-critical path or not. While other games implement a UI where you can choose between easy, normal and hard, Spelunky hides its difficulty choices in its gameplay. A UI at the beginning of the game usually doesn't clearly tell you what hard, easy or normal difficulty means. After all, every game interprets these difficulties differently.

Hard vs Cheap

There is a difference between hard and cheap. A hard game is fair, it plays within its own rules and limits, everything is anticipated and you know why that game over screen just filled your screen when you die in a hard game.

Cheap games are games that don't anticipate, they sometimes break the game's rules and they always leave you thinking, what just killed me there?
To be honest, There isn't really a line between the 2, it mostly comes down to how you feel when playing the game. Now let's go back to Spelunky.

Spelunky never felt cheap in any way to me. Everything has a reason to do something. A spider drops from the ceiling when you stand under it. A tiki trap strikes with its deadly spikes when you stand close enough. Not everything, but some movements are anticipated, such as how a mine in the ice caves beeps before exploding.

Conclusion

Spelunky is a 2D roguelike game that works by using the power of player decisions and elements like permadeath and randomly generated levels to keep the player engaged, but still manage to be a game that is very difficult but fair. Fairness was achieved because the game made the game follow its rules and when it is game over, it is always the player's fault. But sometimes, it is the game's fault but this is usually intended to make the player feel the feeling of satisfaction when conquering such a problem.

Anyways, this isn't everything that Spelunky offers to make it engaging and a great game, but it is all I got. But of course, there are also other great people who shared their analysis on the internet, where I got my information from and maybe, you can get an even deeper knowledge of this game and how to implement it in your own creations:

Mark Brown
Snoman Gaming
Noclip Documentary of Derek Yu
Medium's critique
Game of the Year 2013: Spelunky

Happy developing. Be sure to share this article with your friends and other game developers you might think need to read this. If you have any suggestions regarding content or questions that still hang around your mind, don't hesitate to email me I'd love to answer your emails: tinynerd001@gmail.com