Representing Exploration in Metroidvania Games

Towards a Poetics of Topological Exploration

Peter Mawhorter

Indira Russlanova

Ross Mawhorter

Abstract

Exploration is a core gameplay element in many games, but it has a special central place in the Metroidvania genre, where hidden powerups, backtracking, and map-based navigation are genre-defining elements. At the same time, space in Metroidvania games can be quite well represented by an abstract topology (i.e., by a graph of connections between rooms), without needing to deal with the details of a grid-based or survey-type model of spatial relationships. These two properties give rise to unique challenges and opportunities in understanding the player experience of exploration in these games. This paper proposes two formal digital formats for representing exploration of Metroidvania games: an algorithm-friendly sequence-of-graphs representation, and a complimentary human-accessible journal representation. We have refined these representations by using them to annotate explorations of several games in the genre, and discuss the difficulties we encountered and changes we made in response.

Metroidvanias and Exploration

“Metroidvania” is a game genre based on the operational logics of Super Metroid (Sakamoto 1994) and Castlevania: Symphony of the Night (Hagihara 1997):1 an explorable space (usually in two dimensions) that includes various barriers, which can be passed after acquiring permanent upgrades that are scattered around the map. These upgrades usually also make the player more powerful in battle, and fighting enemies throughout the map is a staple of the genre (although some would argue it’s not a necessary aspect). Additionally, secret areas with optional upgrades are hidden throughout the map, and an in-game map view is available which automatically records what the player has discovered and which helps indicate unexplored areas. Finally, in contrast to “open-world” games, the space of Metroidvania games is constrained to a series of rooms with specific paths between them; it can be abstracted into a topological representation without loosing very much information, although spatial relationships and metrics are still important for using the map systems that these games include.

In these games and the more recent examples of the genre like Metroid Prime (in 3D) and Ori and the Blind Forest (which does away with room transitions) the excitement of exploration and discovery is central, even though combat and platforming challenges are also important (Pacini 2002; Mahler 2015). One thing that demonstrates the centrality of exploration in these games is the design of fan-made randomizers: mods which scramble the placement of items in the game (Jewett 2021). Randomizers are designed to give veteran players a fresh challenge, and while some do randomize enemy placement or statistics, the focus is on altering the exploration of the game by swapping item locations, rather than on altering the platform layouts or combat challenges.

While there is a large body of work on exploration in games, the focus has been on open-ended 2D and 3D environments, usually using maps to represent space (see e.g., Osborn et al. (2021), Si (2017), and Stahlke (2020)). At the same time, some work in both procedural content generation and reinforcement learning has emphasized graph-based topological representations, although these works have not taken the human exploration process as their main focus (see e.g., Dormans (2010), Smith, Padget, and Vidler (2018), and Zhan, Aytemiz, and Smith (2019)). In a similar dichotomy, the literature on the psychology of exploration makes a distinction between route-based and survey-like spatial knowledge, often assuming that route-based knowledge is an earlier stage of knowledge development than survey-like knowledge (see Jamshidi and Pati (2021) for a review and Foo et al. (2005) on questions of knowledge representation). For Metroidvania games, topological information alone is sufficient for most navigation tasks, which suggests a distinct player experience as well as the opportunity for a very different formal representation of that experience.

The aim of this paper is to describe how players explore these games at the abstract level of routes, in order to come up with formal structures for representing their exploration processes that could be applied in future PCG systems in a variety of ways. These structures are also the foundation for future work in topological “exploration poetics,” which would attempt to theorize how topological structures in games evoke particular feelings among players. The formal structures described here have been implemented as the open-source exploration library published on the Python Package Index.2

There are two main representations available in the exploration library: an algorithm-friendly sequence-of-graphs representation, which we term an exploration trace, and a more human-accessible text-based journal format, which we call an exploration journal. An exploration trace takes the form of a list of time steps, with a map, a position, a transition, and a game state corresponding to each time step. The individual maps in an exploration trace are multi-digraphs that can support tags and annotations for nodes and edges, and which incorporate explicit nodes representing unexplored spaces. These maps also include a structure for specifying transition requirements in terms of powers and tokens, and a structure for specifying the effects that taking a transition has on the rest of the map and on the player. As we will describe in the section on complexity, a simpler format consisting of a single map along with a trace of positions cannot fully capture exploration in Metroidvania games.

The journal format is a text format where rooms, their entrances, and their exits are specified, including information about requirements for traversing connections and about observed-but-unexplored connections in each room. We hypothesize that this information about observed connections is central to understanding the player experience of exploration, and that distinct patterns of unexplored connections will contribute to distinct feelings of gameplay. The journal format is designed as a list of entries most of which specify a single location or connection, and includes some conventions for deducing additional information (such as the entrance location when revisiting a room) in order to minimize human journaling effort.

The exploration library has routines for parsing an exploration journal to construct an exploration trace, and the opposite conversion is also possible (although not yet provided). This conversion algorithm is one of the main contributions of this work, because it makes the production and curation of exploration traces much easier. An exploration journal can be maintained during gameplay (e.g., to assist with mapping in a randomized game) or to allow more natural play, a recording of play can be re-examined by the player to produce a journal. However, only with some strong assumptions can a journal be derived from observing someone else’s gameplay (see the complexity section).

In the rest of this paper, we first explore related work, then describe the exploration trace and journal formats in detail, comment on the complexity necessary in these formats, and finally suggest possible applications of this work.

Related Work

There is much existing literature on the topic of exploration, spanning disciplines such as urban planning, geography, psychology, cognitive science, and neuroscience (regarding human exploration), robotics and AI (more abstract and/or automated exploration), and of course game studies, both technical and non-technical. The following sections give a brief overview of each area.

Human Exploration of the Real World

Jamshidi and Pati (2021) provide an excellent and broad review of the literature on what is termed “wayfinding” which includes human exploration and navigation. On the cognitive/neuroscience side, Siegel and White (1975) provide an early overview of how space might be represented in the mind, and how such representations are learned; Peer et al. (2021) has an updated perspective on these issues and focuses explicitly on the distinction between graph-like and map-like representations. The consensus espoused by Peer et al. is that both graph-like and map-like cognitive structures exist, although there is no clear ordering in terms of which is learned first or derived from the other. Graph-like structures are assumed to be at least an encoding of specific topological relationships between spaces, possibly with associated metric information about distances or angles involved. In contrast, map-like structures are described as grid-based and Euclidean, encoding absolute positions of different objects of interest.

The Image of the City (Lynch 1964; see also Lynch 1984) provides a higher-level conception of how humans represent space (specifically cities) based on rich interviews and interactions with city residents. It is not concerned with specific cognitive structures, but it does suggest five components of spatial representations: paths, edges, districts, nodes, and landmarks. Similarly, other studies of human behavior in the real world (e.g., Gerber and Kwan (1994)) tend to produce relatively more complex and less abstract conceptions of human spatial representation. The formats we present here are more formal by design, and because of their focus on exploration in a specific game genre.

Formal Exploration

Growing out of cognitive science and AI research, a number of systems and formalisms have been created to represent exploration in computers, both in attempts to model human cognition and for practical purposes in robotics. Gopal, Klatzky, and Smith (1989) present a detailed computational model of human cognition related to exploration and navigation, which includes mechanisms of perception and memory. Focused on accurately modelling human cognitive processes, their model is more detailed than the model presented here, which would be an advantage in work that aimed to use a model to simulate gameplay, but which has disadvantages in terms of deployment effort. Their model is also designed to simulate human exploration rather than to record actual human exploration processes, in contrast to the models we present, although developing a simulator based on our models is one promising direction for future work. However, we do directly share one of their motivations, which is to “…make clear the complexities of existing theories and indicate where assumptions must be made in order to bridge theoretical gaps” (p. 310).

Remolina and Kuipers (2004) similarly present a detailed logical theory of topological maps, which would be suitable for representing the kinds of relationships that our model represents, but which is a bit unwieldy as a primary format. In theory, automatic translation from our formats into the predicate-based representation implied by Remolina and Kuipers should be possible, and might be an interesting area of future work since it would allow for automatic symbolic reasoning about explorations. Their model might need to be extended with some kind of temporal logic (Emerson 1990) to be able to represent not just instantaneous spatial relationships but also their incremental discovery over the course of an exploration. On the other hand, our present model has a weaker representation of angles and distances than their model has, although this is extensible through custom annotations or tags.

The literature in robotics and AI (particularly reinforcement learning) also addresses the issue of exploration, and includes the concept of an abstract “state space.” Gomez, Hernandez, and Barber (2019) specifically deals with a topological representation of space, and is representative of the literature in robotics, although much of that is instead grid- or map-focused. Meanwhile, Ecoffet et al. (2021) have recently advanced the state-of-the-art in reinforcement learning using a state-space exploration strategy modeled on human exploration (and which can benefit from human demonstrations). Although somewhat incidental, the domains used by Ecoffet et al. are arcade games. These research directions use human exploration as an inspiration, but are not concerned with faithfully representing human exploration processes, whereas our work aims to help understand the human experience of exploration.

Exploration in Games

Both psychology/experience based and formal notions of exploration have been investigated in the context of games specifically. In game user experience research, there is a strong body of work on spatial design patterns (e.g., Milam and El Nasr (2010)) and on how level design influences wayfinding (see e.g., Hoeg (2008), Moura and Bartram (2014)) although this work centers 3D spaces (see Khalifa, Mesentier Silva, and Togelius (2019) for an exception). Directly relevant to the current work on exploration is research on automatic exploration and mapping of games in both 2D and 3D (e.g., Stahlke (2020), Zhan, Aytemiz, and Smith (2019), Osborn et al. (2021), Campbell and Verbrugge (2019)), although these works mostly use map-like rather than graph-like representations of space.

Even more relevant is research on human exploration processes in games, including the work of Si (2017) on believable exploration behavior based on recorded human exploration processes (see also Biggs, Fischer, and Nitsche (2008)).3 Si’s work included annotated recordings of human exploration processes in a game supplemented by structured interviews, and this data was then used to develop heuristics for creating AI agents that could explore space in a believable manner. Although Si’s work is in a 2D domain, it was conducted in a mostly open and continuous environment and topological relationships are discussed but not foregrounded in his work. While we aim to capture the player experience of exploration as Si did, our format focuses on topological knowledge, and we are also aiming to create more structured and abstract representations of the exploration process to facilitate more quantitative comparisons between players.

Besides Si’s work, Stahlke’s work on automatically exploring game spaces is quite relevant, and notably includes both detailed model of memory for both spaces and entities, and a nice breakdown of possible motivations for exploration (pp. 51–54). Stahlke’s work like ours is explicitly motivated by a desire to understand the user experience of exploration, but it uses on a grid-based representation of space. Note that there are quite a few similarities between Stahlke’s approach and the previously mentioned work by Gopal, Klatzky, and Smith (1989). Because creating automatic models of exploration of topological graphs which mimic human exploration patterns is one of our future research directions, we will likely continue to reference this work in the design of such systems.

Finally, there is some that focuses specifically on exploration in Metroidvania games: Wahlberg (2015) has written about backtracking specifically, as well as the map configurations that lead to it, and Arnott (2017) has written about the mapping activity in the Metroid series specifically and how that relates to narrative elements of those games. Although quite relevant, neither of these works includes a formal representation of the player’s exploration process, and we believe that such a representation could be useful for both precisely describing specific configurations of game space and for quantitatively (or even qualitatively) comparing and contrasting different game spaces.

A few other works that are relevant include Toups et al. (2019) on map interfaces in games and Moura and Bartram (2014) on visualizing player traces (which includes an abstracted graph-based visualization of player movement through space). As outlined in this section, the main features of the present work that distinguish it from existing work are the focus on topological rather than Euclidean models of space and the intended use case as a means of recording and comparing abstracted records of player experience.

Formats

The main contribution of this paper is two interchangeable abstracted formal representations of human exploration processes: an algorithm-friendly sequence-of-graphs format which we term an exploration trace, and a human-accessible text-based format that we term an exploration journal. These formats are formally defined through the code behavior and associated mypy type annotations of the open-source exploration library, available on the Python Package Index (PyPI). In this section we use the system of abstract types provided in the typing module of the Python standard library to formally describe the trace representation, while the journal representation is described in terms of the trace structures it can produce.

We encourage perusal of the source code for those interested in the mechanics behind conversion between the formats, and would also welcome full or partial ports of these representations into other languages, consistent with the 3-clause BSD license that we’ve applied to the code. Concretely, the core.Exploration class represents an exploration trace, and the journal.JournalObserver class can be used to convert a journal (stored as text) into a trace.

Of the two formats, the trace format is more general, and could in theory represent many different kinds of exploration (e.g., exploring hypertext nodes or conversation states in a visual novel), although it has been designed with Metroidvania games in mind. An exploration trace includes the following four components:

  1. A list of decision graphs representing how topological player knowledge evolves at discrete time points.
  2. A list of positions (termed decisions) occupied at each time step.
  3. A list of transitions taken at each time step, which names which connection was traversed in the topological graph to arrive at the subsequent state.
  4. A list of game states at each time step (represented as flexible mappings from slot names to game state information).

The lower-level units of representation are thus decision graphs (core.DecisionGraph) and game states (core.State), the latter of which is just a type alias for the built-in dict type that offers a mapping with unique keys. Decision graphs are graphs composed of decisions (graph nodes that have unique names) connected by transitions (directed edges which have names that are unique with respect to their source node). Along with game states which are less fully specified. Although game states can include arbitrary keys and values, by default they include a 'powers' slot which holds a set of strings naming unique powers acquired (e.g., "double jump") and a 'tokens' slot which holds a mapping from string token type names to integers representing expandable tokens acquired (e.g., "small key": 3).

Complexity

Case Studies

Applications

Arnott, Luke. 2017. “Mapping Metroid: Narrative, Space, and Other M.” Games and Culture 12 (1): 3–27.
Biggs, Michael, Ute Fischer, and Michael Nitsche. 2008. “Supporting Wayfinding Through Patterns Within Procedurally Generated Virtual Environments.” In Proceedings of the 2008 ACM SIGGRAPH Symposium on Video Games, 123–28.
Campbell, Jonathan, and Clark Verbrugge. 2019. “Exploration in NetHack with Secret Discovery.” IEEE Transactions on Games 11 (4): 363–73. https://doi.org/10.1109/TG.2018.2861759.
Dormans, Joris. 2010. “Adventures in Level Design: Generating Missions and Spaces for Action Adventure Games.” In Proceedings of the 2010 Workshop on Procedural Content Generation in Games. PCGames ’10. New York, NY, USA: Association for Computing Machinery. https://doi.org/10.1145/1814256.1814257.
Ecoffet, Adrien, Joost Huizinga, Joel Lehman, Kenneth O. Stanley, and Jeff Clune. 2021. “First Return, Then Explore.” Nature 590 (February): 580–86. https://doi.org/10.1038/s41586-020-03157-9.
Emerson, E Allen. 1990. “Temporal and Modal Logic.” In Formal Models and Semantics, 995–1072. Elsevier.
Foo, Patrick, William H. Warren, Andrew Duchon, and Michael J. Tarr. 2005. “Do Humans Integrate Routes into a Cognitive Map? Map- Versus Landmark-Based Navigation of Novel Shortcuts.” Journal of Experimental Psychology. Learning, Memory, and Cognition 31 (2): 195–215.
Gerber, Rod, and Tammy Kwan. 1994. “A Phenomenographical Approach to the Study of Pre-Adolescents’ Use of Maps in a Wayfinding Exercise in a Suburban Environment.” Journal of Environmental Psychology 14 (4): 265–80.
Gomez, Clara, Alejandra C. Hernandez, and Ramon Barber. 2019. “Topological Frontier-Based Exploration and Map-Building Using Semantic Information.” Sensors 19 (20). https://doi.org/10.3390/s19204595.
Gopal, Sucharita, Roberta L. Klatzky, and Terence R. Smith. 1989. “Navigator: A Psychologically Based Model of Environmental Learning Through Navigation.” Journal of Environmental Psychology 9 (4): 309–31. https://doi.org/https://doi.org/10.1016/S0272-4944(89)80012-X.
Hagihara, Toru. 1997. “Castlevania: Symphony of the Night.” Konami.
Hoeg, Thomas. 2008. “The Invisible Hand: Using Level Design Elements to Manipulate Player Choice.” PhD thesis, Southern Methodist University.
Jamshidi, Saman, and Debajyoti Pati. 2021. “A Narrative Review of Theories of Wayfinding Within the Interior Environment.” HERD: Health Environments Research & Design Journal 14 (1): 290–303.
Jewett, Celeste Clark. 2021. “Game Randomization: Emergent Gameplay Communities.” PhD thesis, University of California, Santa Cruz.
Khalifa, Ahmed, Fernando de Mesentier Silva, and Julian Togelius. 2019. “Level Design Patterns in 2d Games.” In 2019 IEEE Conference on Games (CoG), 1–8. https://doi.org/10.1109/CIG.2019.8847953.
Lynch, Kevin. 1964. The Image of the City. MIT press.
———. 1984. “Reconsidering the Image of the City.” In Cities of the Mind: Images and Themes of the City in the Social Sciences, edited by Lloyd Rodwin and Robert M. Hollister, 151–61. Boston, MA: Springer US. https://doi.org/10.1007/978-1-4757-9697-1_9.
Mahler, Thomas. 2015. “Ori and the Blind Forest.” Microsoft Studios.
Milam, David, and Magy Seif El Nasr. 2010. “Design Patterns to Guide Player Movement in 3d Games.” In Proceedings of the 5th ACM SIGGRAPH Symposium on Video Games, 37–42.
Moura, Dinara, and Lyn Bartram. 2014. “Investigating Players’ Responses to Wayfinding Cues in 3d Video Games.” In CHI’14 Extended Abstracts on Human Factors in Computing Systems, 1513–18.
Osborn, Joseph C., Adam Summerville, Nathan Dailey, and Soksamnang Lim. 2021. “MappyLand: Fast, Accurate Mapping for Console Games.” Proceedings of the AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment 17 (1): 66–73. https://ojs.aaai.org/index.php/AIIDE/article/view/18892.
Pacini, Mark. 2002. “Metroid Prime.” Nintendo.
Parish, Jeremy. 2014. “The Metroidvania Mission Statement.” metroidvania.com. https://www.metroidvania.com/2016/01/01/welcome-to-metroidvania-com/.
Peer, Michael, Iva K Brunec, Nora S Newcombe, and Russell A Epstein. 2021. “Structuring Knowledge with Cognitive Maps and Cognitive Graphs.” Trends in Cognitive Sciences 25 (1): 37–54.
Remolina, Emilio, and Benjamin Kuipers. 2004. “Towards a General Theory of Topological Maps.” Artificial Intelligence 152 (1): 47–104. https://doi.org/https://doi.org/10.1016/S0004-3702(03)00114-0.
Sakamoto, Yoshio. 1994. “Super Metroid.” Nintendo.
Si, Chen. 2017. “Believable Exploration: Investigating Human Exploration Behavior to Inform the Design of Believable Agents in Video Games.” PhD thesis, University of Technology Sydney.
Siegel, Alexander W, and Sheldon H White. 1975. “The Development of Spatial Representations of Large-Scale Environments.” Advances in Child Development and Behavior 10: 9–55.
Smith, Thomas, Julian Padget, and Andrew Vidler. 2018. “Graph-Based Generation of Action-Adventure Dungeon Levels Using Answer Set Programming.” In Proceedings of the 13th International Conference on the Foundations of Digital Games, 1–10.
Stahlke, Samantha Nicole. 2020. “Synthesizing Play: Exploring the Use of Artificial Intelligence to Evaluate Game User Experience.” PhD thesis, University of Ontario Institute of Technology.
Toups, Z O., Nicolas Lalone, Sultan A. Alharthi, Hitesh Nidhi Sharma, and Andrew M. Webb. 2019. “Making Maps Available for Play: Analyzing the Design of Game Cartography Interfaces.” ACM Trans. Comput.-Hum. Interact. 26 (5). https://doi.org/10.1145/3336144.
Wahlberg, Tobias. 2015. “Blockades in the Metroidvania Genre of Games: A Examination of Backtracking.” PhD thesis, Uppsala University.
Zhan, Zeping, Batu Aytemiz, and Adam M. Smith. 2019. “Taking the Scenic Route: Automatic Exploration for Videogames.” In 2nd Workshop on Knowledge Extraction from Games at the 33rd AAAI Conference on Artificial Intelligence, 26–34. http://ceur-ws.org/Vol-2313/KEG_2019_paper_9.pdf.

  1. Note that the original Metroid is part of the genre, but the original Castlevania is not. See Parish (2014) for an explanation of the origins of the term.↩︎

  2. https://pypi.org/project/exploration/↩︎

  3. Note: having read Si’s work closely, we do not fully endorse his typology of player exploration strategies, although having any detailed typology of these at all is certainly useful.↩︎