{"id":81213,"date":"2011-06-12T18:05:36","date_gmt":"2011-06-13T00:05:36","guid":{"rendered":"http:\/\/horror.dreamdawn.com\/?p=81213"},"modified":"2011-06-12T18:05:36","modified_gmt":"2011-06-13T00:05:36","slug":"recursive-unlocking-analyzing-resident-evils-map-design-with-data-visualization","status":"publish","type":"post","link":"https:\/\/horror.dreamdawn.com\/?p=81213","title":{"rendered":"Recursive Unlocking: Analyzing Resident Evil&#8217;s Map Design with Data Visualization"},"content":{"rendered":"<div align=\"center\">\n<img loading=\"lazy\" decoding=\"async\" src=\"img\/recursive_unlocking\/header.png\" alt=\"\" width=\"700\" height=\"376\" \/>\n<\/div>\n<p><a href=\"?p=100000\">Resident Evil<\/a> 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&#8217;s basic game system, consisting of static backgrounds, 3D characters, and character-centric pivot-and-move controls, were lifted almost entirely from <i>Alone in the Dark.<\/i>  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.<\/p>\n<p>Though it&#8217;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.<\/p>\n<p>It&#8217;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&#8211;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&#8217;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 <i>Recursive Unlocking.<\/i><\/p>\n<p>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&#8217;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&#8217;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.<\/p>\n<p>Though the Recursive Unlocking pattern is interesting, I&#8217;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&#8217;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&#8217;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&#8217;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.<\/p>\n<h3>Methodology<\/h3>\n<p>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&#8217;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&#8217;t rely on bugs or tricks, we should be able to get a rough approximation of how the level was put together originally.<\/p>\n<p>What I did is take a video of a speed run of Resident Evil: Director&#8217;s Cut (using Jill, on Arrange Mode, with 100% completion) and trace the player&#8217;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&#8217;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.<\/p>\n<p>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.<\/p>\n<h3>Visualizing Recursive Unlocking<\/h3>\n<p>Here&#8217;s a visualization of the most efficient path through Resident Evil 1.<\/p>\n<div align=\"center\">\n<iframe loading=\"lazy\" width=\"853\" height=\"510\" src=\"http:\/\/www.youtube.com\/embed\/0ItnGW59vQg?rel=0&amp;hd=1\" frameborder=\"0\" allowfullscreen><\/iframe>\n<\/div>\n<p>You can download a <a href=\"files\/recursive_unlocking\/recursiveunlocking.mov\">full-res movie file<\/a> (Quicktime format, 30 MB) of this if you want.  There&#8217;s also a <a href=\"files\/recursive_unlocking\/applet\/\">Java applet version<\/a>, but it doesn&#8217;t work well in some browsers and needs a lot of memory.<\/p>\n<p>This speed run is by <a href=\"http:\/\/www.youtube.com\/user\/UltimateSpeedRuns#grid\/user\/E6CA7BDC35CBE14D\">UltimateSpeedRuns<\/a>.  The maps were produced by Daniel Engel and <a href=\"http:\/\/www.gamefaqs.com\/ps\/198454-resident-evil\/faqs\">posted on Gamefaqs<\/a>.  <a href=\"http:\/\/www.amazon.com\/Resident-Evil-Directors-Unauthorized-Strategy\/dp\/0761513043\/\">Resident Evil: Director&#8217;s Cut: Unauthorized Game Secrets<\/a> 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.<\/p>\n<p>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 <a href=\"http:\/\/www.youtube.com\/watch?v=HPzBVZL5O0U\">44 second speed run of Clue<\/a>).  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&#8217;ve sped up to show in about a minute (if you want to see them in real time, try the Java applet).<\/p>\n<h3>Analysis<\/h3>\n<p>So that looks pretty cool and all, but what does it really tell us?  Let&#8217;s start with some of the raw data collected for this research.<\/p>\n<p>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.<\/p>\n<div align=\"center\"><img loading=\"lazy\" decoding=\"async\" src=\"img\/recursive_unlocking\/visitsperroom.png\" alt=\"\" width=\"651\" height=\"373\" \/><\/div>\n<p>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&#8217;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.<\/p>\n<p>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&#8217;s a little bit of micro-backtracking within these &#8220;hot&#8221; 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.<\/p>\n<div align=\"center\"><img loading=\"lazy\" decoding=\"async\" src=\"img\/recursive_unlocking\/hotspots.png\" alt=\"\" width=\"967\" height=\"227\" \/><\/div>\n<p>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&#8217;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&#8217;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.<\/p>\n<p>Of course, regular players might not realize that there&#8217;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&#8217;s something left to be done in one room, there&#8217;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&#8217;m sure many players do this unconsciously without realizing that they are being guided by the game design.<\/p>\n<h3>Recursive Unlocking in Practice<\/h3>\n<p>There&#8217;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.<\/p>\n<div align=\"center\"><img loading=\"lazy\" decoding=\"async\" src=\"img\/recursive_unlocking\/mansion_final_arc.png\" alt=\"\" width=\"591\" height=\"370\" \/><\/div>\n<p>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.<\/p>\n<p>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&#8217;ll remember the best when the game is over.<\/p>\n<h3>Using Traversal to Fight Fatigue<\/h3>\n<p>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&#8217;s overrun by spiders.  The lab is all metal hallways and complex piping, with sliding doors and glowing screens&#8211;another big departure from the previous areas.<\/p>\n<p>The mansion accounts for the biggest chunk of the game, but it&#8217;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&#8211;it gets traversed twice).<\/p>\n<div align=\"center\"><img loading=\"lazy\" decoding=\"async\" src=\"img\/recursive_unlocking\/areatimes.png\" alt=\"\" width=\"513\" height=\"371\" \/><\/div>\n<p>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&#8217;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.<\/p>\n<p>It&#8217;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&#8217;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.<\/p>\n<h3>Other Fun Facts<\/h3>\n<p>Here&#8217;s a couple of other interesting tidbits I gleaned from this data.<\/p>\n<ul>\n<li>The hunters are introduced almost exactly half-way through the game.\n<li>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.\n<li>Arrange Mode (used for this test) moves the locations of items around on the map, but doesn&#8217;t generally disrupt the order or point in progression in which they appear.\n<\/ul>\n<h3>Conclusion<\/h3>\n<p>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&#8217;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&#8217;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&#8217;s designers put into it made the game the masterpiece that it is.<\/p>\n<div class=\"tableright\" style=\"width:260px;\">\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;s basic game system, consisting of static backgrounds, 3D characters, and character-centric [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61],"tags":[],"class_list":["post-81213","post","type-post","status-publish","format-standard","hentry","category-features"],"_links":{"self":[{"href":"https:\/\/horror.dreamdawn.com\/index.php?rest_route=\/wp\/v2\/posts\/81213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/horror.dreamdawn.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/horror.dreamdawn.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/horror.dreamdawn.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/horror.dreamdawn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=81213"}],"version-history":[{"count":0,"href":"https:\/\/horror.dreamdawn.com\/index.php?rest_route=\/wp\/v2\/posts\/81213\/revisions"}],"wp:attachment":[{"href":"https:\/\/horror.dreamdawn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=81213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/horror.dreamdawn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=81213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/horror.dreamdawn.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=81213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}