Recursive Unlocking: Analyzing Resident Evil’s Map Design with Data Visualization

Resident Evil is often credited with inventing the survival horror genre. While that particular accolade may not be entirely factual, the game is worthy of recognition for cementing horror as a viable, mass-market console genre. Critics are quick to point out that Resident Evil’s basic game system, consisting of static backgrounds, 3D characters, and character-centric pivot-and-move controls, were lifted almost entirely from Alone in the Dark. Resident Evil, some will argue, might have taken the Dark formula and spruced it up for prime time, but it can hardly be credited with any great game design innovation.

Though it’s true that Resident Evil used Alone in the Dark as its template, I think that critics who write the game off as a copycat are not paying enough attention. There is a wealth of interesting game design ideas in Resident Evil, and in this article I want to tackle one of them in particular: the design of the mansion map.

It’s been a while since we all played Resident Evil, so let me refresh your memory. At the beginning of the game the protagonists find themselves locked in the sinister Spencer Mansion, which is also home to lots of zombies and (as we eventually find) a large underground secret laboratory. As the game starts there are only a few rooms that are accessible–access to most of the mansion is sealed behind locked doors, secret panels, and powered-down elevators. As the player progresses through the mansion he finds keys that unlock doors in areas he’s already visited, and must eventually return to those areas to find more keys to unlock new areas of the structure. Thus the player travels through the map in a very non-linear fashion, moving back and forth between rooms as items are collected and puzzles are solved, and eventually passing into areas with entirely new rooms. The map opens itself up like a spiral shell. I call this design Recursive Unlocking.

This approach has interested me for a long time. The genius part of the Resident Evil level design is that in the course of playing through the game two things happen: the player unlocks shortcuts and the player runs out of ammo. At some point the game becomes entirely about traversing efficiently through the mansion; it’s a run from the safe room (where we can save) through the shortest possible set of rooms until we reach another safe room or a new puzzle to solve. There’s simply not enough ammo to dispatch all of the zombies in the game, so route planning and deftly maneuvering through the Victorian building is eventually the key source of challenge.

Though the Recursive Unlocking pattern is interesting, I’ve struggled with how to study it. The actual order in which rooms are accessed has a lot to do with the player himself; most of the time there are two or three puzzles that are in the process of being solved simultaneously, and the level of traversal efficiency can depend on the order in which these puzzles are attempted. That said, there’s clearly a method behind the design of Spencer Mansion and its surrounding areas. The brains behind this game carefully architected the map so that the player’s traversal through the mansion would occur at a pace that they could control. To understand how the Recursive Unlocking methodology works, it would help to understand how the space was designed in the first place. Since we can’t just call up Shinji Mikami, Hideki Kamiya, and the rest of the (large) design team, I turned to the next best thing: data mining and visualization.

Methodology

When designing a game we can assume that the level designer thinks in terms of the fastest path through the space. If several goals must be completed before the next space is unlocked, the level designer knows the most efficient order in which to complete them. He’s likely to lay the main path out first, then go back and flesh it out with extra details, secondary goals, or side-paths. Therefore, if we look at a highly efficient traversal of the space that doesn’t rely on bugs or tricks, we should be able to get a rough approximation of how the level was put together originally.

What I did is take a video of a speed run of Resident Evil: Director’s Cut (using Jill, on Arrange Mode, with 100% completion) and trace the player’s path through the game. I recorded each room transition in order, along with a time stamp, to produce a mapping of the speed runner’s entire path through the game. Then I wrote some code to render this path over a 2D map of the whole game using Processing. Finally, I took all the data I had, threw it into a spreadsheet, and made some graphs.

The results are pretty interesting. The speed runner takes the most efficient path possible through the game; no time is wasted with story or items. The only rooms visited are those that are necessary to progress to the end of the game. Since this is Arrange Mode, the actual details of the traversal might differ slightly from the original Resident Evil, but even so the main arc of the game, the way that the player moves from one part of the mansion to another, is clearly visible and worthy of analysis.

Visualizing Recursive Unlocking

Here’s a visualization of the most efficient path through Resident Evil 1.

You can download a full-res movie file (Quicktime format, 30 MB) of this if you want. There’s also a Java applet version, but it doesn’t work well in some browsers and needs a lot of memory.

This speed run is by UltimateSpeedRuns. The maps were produced by Daniel Engel and posted on Gamefaqs. Resident Evil: Director’s Cut: Unauthorized Game Secrets had a useful numbering system for the rooms (which is unfortunately ignored by the actual walkthrough text) that I used to keep track of the speed run data.

What you are seeing here is the path from room to room that UltimateSpeedRuns took to finish the game in a little under an hour and a half (you should also check out his hilarious 44 second speed run of Clue). The game starts with Jill entering the dining room on the first floor of the mansion and ends with her running down a hall in the laboratory to catch an elevator to the helipad. There are 213 room transitions here, which I’ve sped up to show in about a minute (if you want to see them in real time, try the Java applet).

Analysis

So that looks pretty cool and all, but what does it really tell us? Let’s start with some of the raw data collected for this research.

There are 116 unique rooms in Resident Evil, split between four major areas: the mansion, the courtyard, the guardhouse, and the laboratory. A room is any space the player can occupy: a hallway, passage, closet, or room. To finish the game, UltimateSpeedRuns visited 213 rooms total, which means that most rooms were visited only twice. Does it strike you as odd that a game known for requiring a lot of backtracking can be completed without passing through most rooms more than two times? Remember, this includes all hallways and passages, as well as proper rooms, in the game.

In fact, the data shows that we can be far more efficient than that. Of the 116 rooms in the game, 19 of them were not visited at all in this run. These are rooms that contain story pieces, or access to guns or other items that are not strictly necessary for progression. The majority (44, 38%) of rooms were only visited once. The most visited room in the entire game is a small hallway in the upper-right part of the mansion’s first floor. This room connects the mansion to the courtyard, to the second floor, and it is also right in the middle of several shortcut paths. It was visited a total of eight times.

This means that while there is some backtracking involved in Resident Evil, the path is from beginning to end is mostly linear. In fact, looking at the video above, we can see that there is a common pattern to the traversal: the player enters an area and then spends a lot of time in that immediate vicinity, visiting adjacent rooms several times before moving forward or heading back the way they came. You can see how an area will light up with activity for a few seconds, then the player travels on to some other part of the mansion. There’s a little bit of micro-backtracking within these “hot” areas, but very little retracing of steps across the larger map. At a macro level, Resident Evil is pretty much a linear string of these hot spots.

The presence of these high-activity areas reveals a key trait of the level design in Resident Evil: items and puzzles are organized together spatially and on the game timeline. When a puzzle in a room becomes solvable, it’s likely that the next item required after it, or the previous item required to access it, is in an adjacent room. The hot spots we see in the video are areas where a bunch of related items are stored in close proximity, but the unlocking of these hot spots is sequenced, so we also know that related items are revealed to the player when they become relevant. The message to the player is this: the items you have now are useful soon, and you won’t have to travel far to use them. Looking at the fastest-path traversal of this game, we can see how a skilled player only collects items when they are relevant and close, which leads to hot areas of the map and helps him avoid back tracking. That he can schedule item collection and traversal like this at all indicates that the levels were designed with this sort of progression in mind.

Of course, regular players might not realize that there’s an optimal order to collecting items and solving puzzles. They may backtrack to previous areas unnecessarily, or miss a key item and be unable to progress. But because the items and puzzles are staged both spatially and on a timeline, the player who wanders around looking for the next step should find himself returning to the same areas over and over. If there’s something left to be done in one room, there’s probably an item or puzzle in a room close by as well. This design serves to shrink the search space for the player, to localize the area which requires extra focus. I’m sure many players do this unconsciously without realizing that they are being guided by the game design.

Recursive Unlocking in Practice

There’s one specific moment where the player suddenly makes a long arc back through the first floor of the mansion, revisiting the areas where the game began. You can see this in the video at about 35 seconds in, which puts it at roughly 60% of the way through the game (it occurs 51 minutes into the speed run). This is a great example of the Recursive Unlocking pattern because it shows how the designers use this map layout to control tension and pacing.

At this point in the game the player has been all over the mansion. Then they left the mansion and spent some significant time (about 15 minutes of speed run time; 16% of the total game time) in the guardhouse. They then returned to the mansion and fought a boss (the giant snake, second appearance). This lead to a new area of the mansion that the player has seen but been unable to access (the library on the second floor), and eventually deposits the player back in the long hall next to the dining room where the game begins. The next destination for the player is the courtyard, which is accessed from the top-right corner of the map, and to get there the player passes back through the main hall and a bunch of other rooms that appeared early in the game.

We can see in the traversal visualization that this is one of the few times the player actually has to cross the whole mansion map without doing anything on the way. This trip serves a couple of purposes. On some level, it is comforting for the player to revisit these early areas, as they are familiar and the location of nearby saves and health has been long since memorized. On the other hand, the passage also serves to ratchet tension up as the player approaches a new area (the courtyard basement): the zombies that the player originally faced in these halls have now been replaced with giant spiders and hunters, both of which are pretty hard to kill. And finally, this section serves as a reminder of where we are; it brings us back to the beginning of the game and reestablishes the mansion in our memory. This is the last time the player will see the mansion; after traveling through the courtyard basement the he continues to the laboratory, which is the last environment in the game. So the last bit of the mansion that we see is the area that introduced us to the mansion to begin with. It is these rooms that we’ll remember the best when the game is over.

Using Traversal to Fight Fatigue

Another interesting aspect of this visualization is the way that the player moves between the four main environments: the mansion, the courtyard, the guardhouse, and finally the laboratory. These areas all look very different; the mansion has huge ceilings, Victorian stylings, and lots of zombies. The courtyard is outdoors, and has zombie dogs, snakes, and eventually hunters. The guardhouse is a wooden structure, old and dilapidated compared to the mansion, and it’s overrun by spiders. The lab is all metal hallways and complex piping, with sliding doors and glowing screens–another big departure from the previous areas.

The mansion accounts for the biggest chunk of the game, but it’s less than half (43%). One fourth of the whole game takes place in the laboratory, and the guardhouse and courtyard combined account for the remaining 30%. In terms of rooms, the mansion itself is the most dense (59 rooms visited), followed by the lab (21 rooms), with the guardhouse and courtyard about tying for third (with 18 and 17 rooms respectively). These areas are not reused much; the player generally enters one of these areas, solves a bunch of puzzles (another hot spot in the traversal), and then leaves, never to return again (the courtyard is sort of an exception–it gets traversed twice).

The four major locations in Resident Evil look distinct and play differently to prevent player fatigue. After solving a bunch of statue puzzles and placing gems into stone eye sockets for a few hours, the player is ready for a change. Leaving the mansion gives the designers an opportunity to change up the pace of the game, introduce new enemies, and just give the player a break from the areas he’s already seen over and over again. Given that the entire design of the Resident Evil map is based on recursion over the same key areas, these secondary spots are an attempt to prevent monotony.

It’s also interesting to note that by looking at how much time the player spends in each room, we can sort of get a sense of how the design changes from area to area. The speed runner in our video goes through the mansion rooms at an average of 37 seconds per room. The mansion is primarily a traversal puzzle. Time spent examining the environment isn’t recorded by this data, as the speed runner did not bother. The guardhouse is similar: 36 seconds per room. But the courtyard and laboratory areas are much longer: 53 seconds per room and 59 seconds per room respectively. Perhaps the difference in speed is related to an intentional change of pace between these areas, or perhaps it is a side-effect of the development process. Either way, it seems clear that the rooms in the mansion and guardhouse feel different than those in the courtyard and laboratory because they are passed through so much more quickly.

Other Fun Facts

Here’s a couple of other interesting tidbits I gleaned from this data.

  • The hunters are introduced almost exactly half-way through the game.
  • The door opening animation, which plays between rooms to mask the room load time, takes about 5 seconds. In total, the accumulated cost of this load time is about 25% of the total play time of this speed run.
  • Arrange Mode (used for this test) moves the locations of items around on the map, but doesn’t generally disrupt the order or point in progression in which they appear.

Conclusion

Visualization of player data can give us interesting insights into how games like Resident Evil work on the macro level. Using a speed run for this sort of visualization is ideal because it removes any bias and confusion that might stem from individual player sensibilities and shows us something close to the path that the level designers intended. In Resident Evil’s case, the Recursive Unlocking pattern is used to control the pace of the game, the flow of the narrative, the progression of enemies and weapons, and even to force a change of scenery on the player, all while maintaining a non-linear feel. This sort of analysis reveals how much thought actually went into the construction of the layout of this game. I think you’d be hard-pressed to find another Adventure game from the Resident Evil era that pulls off such a tight and formal traversal; this level design is clearly the product of serious planning. The data here shows that the layout of Spencer Mansion and its surrounding areas was probably the single most difficult part of the Resident Evil design, but the work that Capcom’s designers put into it made the game the masterpiece that it is.

13 thoughts on “Recursive Unlocking: Analyzing Resident Evil’s Map Design with Data Visualization

  1. LOL@Tom. Nice!

    Great analysis, Chris. This really helped me understand one of the key ingredients of great level design. You articulated perfectly a feeling I had about the game but couldn’t identify. You’ve also justified my feeling that this game really is a masterpiece of the genre.

    I think Chris is the real master of unlocking…key elements of game design. 🙂

  2. Nice comeback! Hey Chris… any idea how does it work in the Resident Evil Outbreak series? Specially in the “Decisions, decisions” Scenario… would be very interesting to get your opinion about that….

    There are some “abstract” aspects that an analysis can’t account like, for example, the fear experimented and also the randomness in the necessary combat sequences (health, weapon used, ammo, hit%, etc).

    Please continue with this great features! ;D

  3. I’d like to see a side by side comparing the original and the Gamecube remake as far as the map experience goes; it would be interesting to see. 🙂

  4. Very interesting analysis and I’m glad that more people are willing to delve deeper into the design of horror games.

    However, your speed map does mask some problems. For one, Resident Evil does not give clear directions were players can go and hints have to be found. Multiple rooms are open to explore simultaniously and rooms often only have one point of enterance. Thus, the backtracking itself isn’t a result of map-design, but of gameplay design. Players wander through the building because they do not know where to go. An experience the designers were probably aiming for, but your map and data make it seem that it is all in the design of the location. Not so.

    For instance, when one finds the sword key, multiple rooms open up, if one can correctly recall the rooms which were locked before, traversal will be quicker, but if players don’t know where to go, they have to walk through the very same rooms again.

    Now I know this is just a minor glimpse at a possible scientific analysis of map design, but it would be far better to review 100+ videos of first time players and map their routes. Even a handful of blindrun players would give a better look on the map design.

    I don’t think what you say is faulty, but your choice of a speed gamer has some serious influence and making generalizations about the game design feels pretty off-mark.

    So really, all the map does is show the most efficient route required to complete the game, leaving many interesting data elements on the floor.

    Wouldn’t a display of the ‘most efficient’ route elevate mapdesign in every case? Compared to first timers?

    I’m not saying RE was badly designed, it clearly wasn’t. I just think you come to a hasty (but right) conclusion by using the wrong set of data and method.

  5. Paul,

    I agree that the speedrun data does not, in any way, represent an average player. Wandering around is certainly part of the Resident Evil design, but each player does this differently; without an analysis of many many players (as you suggest), I think it would be difficult to draw conclusions about how players actually respond to this map.

    But that’s not what I’m trying to do here. I’m specifically looking at the fastest path–the path through the game where wandering is eliminated. The reason I think that path is interesting is that I think level designers think in terms of the fastest path, with ancillary areas hanging off the sides. Thus by looking at the most efficient route we can glean a little bit of information about how the map was constructed.

    For example, this analysis shows that there is almost always an effort to localize a particular puzzle and its relevant pieces to a specific area; if there’s something to do where you are now, there’s probably something else to do nearby. This is a purposeful design consideration, and one that I wouldn’t have noticed without this data.

    Individual players may or may not actually clear an area as they go–the game is certainly designed to encourage some wandering and exploration, as evidenced by the way that enemies increase in power over time. But since every player is bound to play differently, my analysis focused on the design of the map rather than the way it is consumed by individuals. And for that purpose, I think the speed run data is actually very good; the signal-to-noise ratio is very high, and we are given a little window into what the designers were thinking when they put this game together.

  6. I do think your speed-data can be used to check map-efficiency, but I think there is a better designed aspect added to RE’s map system you perhaps overlooked. One that has more influence than puzzle positions.

    The gradual unlocking of areas: Players obtain keys and new areas open up, not just a specific room (although that happens too).
    You can literally layer the progress by seeing what gets unlocked at what point (or timeframe), enlarging the map with each step. Perhaps in a future analysis, you could include this in your methods of analysis.

    Still, I applaud you for taking a scientific approach to games that radically differs from the stale “Do violent VG affect behavior?”.

    VideoGames desperately need mature research, we are running 20 years behind as it is…

  7. You can literally layer the progress by seeing what gets unlocked at what point (or timeframe), enlarging the map with each step.

    Yep. I call this gradually increasing problem space “recursive unlocking.” It’s the key to RE1 map design, hands down.

  8. Nice article but I think the use of a speedrun can be misleading and lead to a few generalizations.

    Puzzles and key items only work in “hot spots” for like half of them.

    For the other half the placement of the puzzle solving item will not be in a room nearby but in another “hot spot” or even in another area of the game.

    The speedrunner does not show this because he knows about it: for example, the product you find on the east aisle of the mansion is used to kill the plant located on the west aisle, which are pretty far from each other to be considered the same “hot spot”.
    However the speedrunner just picks it up on its way to do something else.

    Also most puzzles or locked door that will open a new big area do not work in hotspot either, but instead either makes you go all around the place, or backtrack a lot. For example after the guardhouse you get a need key, and you’re told by the game (Wesker tells you) to go back to the house and check any locked door. And after this part you still need to backtrack through the house and the garden before opening the underground.

    Another couple of puzzles which do not work in hot spots are those related to getting new weapons. The broken shotgun used to get the shotgun is on the opposite aisle again. The jewel to get the Magnum is not in the same “hot spot” either. However this helps us to tell something else on the design of RE that would need a separate study…

  9. I have noticed everyone’s maps (including the in-game one) are off at the stairs by the Serum Room… The stairs from the 1st to the 2nd floor don’t line up by a lot, but the rest of the place lines up perfectly…

  10. First up, I wanna say there is a citation error here: All the videos on the channel UltimateSpeedRuns were reuploads from speeddemosarchive.com.

    The real runner’s name is Damien “Dragondarch” Moody.

    http://speeddemosarchive.com/ResidentEvil.html

    This is a fantastic analysis. Honestly, I don’t think using a speedrunner as the source data was a bad thing at all, because you can still examine any possible route changes and come to the same conclusion.

    I analyzed and interpreted the games in much the same way through my own experience speedrunning them, followed by reviewing the way I handled my first playthroughs. Level design and scenario design which forces the player to think and destroys his expectations is what makes a survival horror game great. This lays out the reason why I think the REmake is intrinsically the best Survival Horror game of all time and why I crap all over RE4. I would actually like to use the term “recursive unlocking” myself.

  11. http://www.attiliocarotenuto.com
    This analysis is simply astounding, it really highlights how much time they spent on designing even the smallest bits of the game area, and your data visualisation is a great idea for showing this.

    I’d be very interested to see the same approach applied to another similar game to see if some patterns are recurring in the genre.

  12. Hey Chris

    Great read; I used to visit your site way back when and recently finished the original RE trilogy again and thought I’d visit your site again.

    It is however the first time I am reading this article – which is awesome!
    A dude named Dave wrote above: “You articulated perfectly a feeling I had about the game but couldn’t identify” which is damn true! I always felt that RE’s environments were amazing and intricate, but this just made me understand why.

    Again, great article, now I’d love to read your views on RE6 and it’s fairly linear structure compared to the Recursive Unlocking design of the originals

    Cheers!

Comments are closed.