Welcome to the second installment of this article series about map generation in LoSt.
Part I covered the basic anatomy of a place. The topic of this post will be climates, and some things to consider when creating an overworld-based Roguelike, such as my game is set out to be. The rant that follows may please some in part or in its entirety; there's no "tl, dr", in any case.
Meanderings
|
þe olde labyrinthe |
Let's start with a digression, namely the topic of labyrinths, in a meandering attempt to reach the actual topic at hand, as it were.
Early European culture distinguished two main types of labyrinths: "unicursal" (with a single path leading circuitously to the center) and "multicursal" (having branching paths, only one of which leads to the designated goal)
1. In modern times we typically include a third category of "network labyrinths"
2.
We might attempt to establish a fourth kind of labyrinth here. Let's call it a "deterministic maze": It has several paths, all of which lead to the same endpoint. A curious specimen in academic labyrinthology, deterministic mazes are quite frequent in video games
3. Consider how
the exemplary level designs of Zelda are structured as deterministic mazes: In addition to a (meandering) main path, there are shortcuts and detours available. These, however, are carefully constructed to ensure the player's passage through certain waypoints (culminating with the boss). Likewise, story-driven games tend to gravitate towards one fixed ending (or a few), like a stream might bifurcate around a great rock, only to converge on the other side.
The traditional Roguelike dungeon falls under this category of deterministic mazes. All roads lead to Yendor. And yet, procedural generation shines at its brightest when behaving more like a network labyrinth, which is to say, when the completely unexpected occurs. After all, what could be more like a network-maze of thematic associations than Dwarf Fortress?
I'll make one last point concerning historical labyrinths: The maze King Minos had Daedalus construct for the Minotaur, served as a prison, to keep the monster trapped within. Conversely, the labyrinth is also a fortification, built to keep trespassers out. Most Roguelikes emphasize this last aspect of the labyrinth, as an impenetrable stronghold to safe-keep the universally coveted
MacGuffin. The motif of descending and ascending with the amulet, as featured in games like Rogue and Nethack, is actually
a quite striking image. However, it was clear from the outset that I wasn't going to take LoSt in that direction.
|
Out of the dungeon! (screenshot: LoSt #7) | |
|
|
In part, I wanted a less clearcut world than provided by the genre classics. Instead of the player vertically piercing a main dungeon, I wanted plots with broad horizons, unfolding around different locations on the map: inside houses, atop steep ravines, deep within thorn forests, on the makeshift streets of desert settlements … Rather than the concentric circles of some "Caverns of Chaos", I envisioned a network maze, like the myriad connections of a root system, or perhaps even that megalithic mythic maze, but splintered, turned microlithic by erosion or earthquake.
So, I bid you farewell, unending fields of nadir … for now … Fun fact: Versions 5-7 of LoSt
did play out in a dungeon (the goal was to break out of confinement), and I
am planning to reintroduce caverns and mine shafts at some point. But when that day comes, the underground biotope will only serve as one of several climate types, not the center of the world (as is literally the case in most RLs).
Drawing the line(s)
Turning away from the dungeon level as the measuring stick of map generation entails leaving behind a kind of thinking one finds in for instance Andrew Doull's
Unangband Dungeon Generation. And yet, rereading Doull's articles after all these years, they still inspire with their zen-like attention to fundamental design principles. Much like the pilgrim who must traverse the maze before reaching that vantage point where he finally achieves overview of its many winding paths, I find myself prompted to reexamine the inner workings of deterministic mazes, as I try to extricate myself from their manifold confines.
Games use deterministic mazes for a number of gameplay-related reasons. Globally and locally, the structure can grant the player a sense of agency whilst keeping the designer in charge of the game's progression. Some important aspects that a typical RL might contain in deterministic mazes, include:
- Scaling difficulty: The player descends ever deeper into the game world, and is faced with ever more challenging obstacles. Most RLs simply assign a numerical danger level to different monster types. The danger level of a generated level typically depends on the current depth, the player's level, or a function of both.
- Pacing progression and loot distribution: Just as the dungeon gets more dangerous, so the hero grows in strength, acquiring experience and better equipment. Some games design early levels to teach the player certain skills, or supply the character with certain props/abilities, which will be needed later on. In RLs, where each challenge might have several solutions, it is often a question of keeping the character appropriately powerful at any given time. Features like side-quests can also be used to ensure that the player has access to particular artifacts and resistances. This not only serves to balance difficulty, but even provides the player with an incentive to move on. After all, unearthing shiny loot is a core experience in most Roguelikes.
- Keeping the story in line: The world is organized so as to preserve narrative coherency. Granted, most Roguelikes skimp on the story, but let's take ADoM as an example. Before reaching the elemental temples, you are guaranteed to speak with the dying sage (who blocks your passage at an earlier level). This dialogue provides your character with an incentive to raid the temples and retrieve the orbs. In Rogue, and many successors, the vertical dungeon is presented as a goal in itself, with a storyline consisting of nothing more than a text snippet ordering you to head for the center of the labyrinth.
- (Surely, I'm forgetting something here …?)
|
early experiment with "deep" climates |
Some of all this must be emulated in an open world. In particular, the difficulty curve must be scaled by making sure that the top-tier baddies (and assorted goodies) won't show up too early.
When it comes to "keeping the story in line", the construction of an open world must strike the balance between narrative linearity on the one hand, and a more, if you pardon my French, "rhizomatic" narrative structure on the other
4.
Keeping that in mind for later, I was presently more concerned with making an open map that also provides meaningful thresholds in the game space.
|
./lost/kits/desert_life/climate.yug |
Currently, the world generator in LoSt starts out by dividing the map into roughly hexagonal zones and designating a climate type to each zone. The method is really quite blunt – I am very little interested in huge topological maps that make sense from a geological viewpoint
5 – world generation begins by setting a climate for the centre zone, and basically flood fills from there, calculating a climate for each new zone on the basis of its preexisting neighbors. During this phase, zones can also be prepatched to contain specified "places of interest"; a feature which will be used to situate settlements, special locations, boss fights, etc. The world generator is stored as a data kit, so it can easily be expanded and judiciously randomized. It will be able to choose between many small templates (for climate map generation, water distribution, locations …) and combine them into unique composite themes for each world. As the game progresses, each new zone is generated on the fly, and put to sleep once the player reaches a certain distance.
|
what was the thread, again? |
Regarding the looming question of how to put thresholds in an open gameworld, the examples of games having already done this in various ways are too numerous to start listing.
In LoSt, I'm experimenting with what I call "deep climate" types. A deep climate is a derivative of a basic climate, spawned in pockets within the bigger region. In their basic layout, deep climates provide a threshold by hindering the player's movement somehow: "Deep deserts" might be an area overgrown by thorns, or just a deadland with a looming ziggurat in the middle. "Deep plains" might be wild groves, oases ruled by ferocious animals and plants, understood in part by native people, but where no life-lovin' settler treads. The idea is to use these deep climates to set up barriers between the opening and the mid-game. Overgrown areas can be constructed as half-way mazes, with uneven "corridors and rooms" dug through an otherwise dense carpet of vegetation. Different kinds of deep climates will offer different kinds/degrees of impenetrableness. You can always wade through thorns at decreased speed, but it's harder to trick your way around a narrow mountain pass.
Deep climates zones will also spawn more dangerous encounters than the basic climates. They will feature fiercer cousins of the critters you find in the basic climate, or larger packs with more and tougher alpha individuals, in addition to particularly nasty critter types exclusive to the deep climates. I hope to use these deep climates as antechambers/buffers/passages to "vaults" and other special locations. Should I succeed in that venture, I may actually have done little more than replace the concentric RL dungeon with a slightly more loose network of glorified "deterministic mazes". And yet, that's still a place to build from, I guess.
Did I go a full circuit with this whole labyrinthine post, and end up about where I started? I should probably be content with that tiny advancement, a whiff of something slightly ellipsoid.
As always,
Minotauros
1 As Penelope Reed Doob points out in her study The Idea of the Labyrinth: From Classical Antiquity Through the Middle Ages, unicursal designs were curiously used to illustrate texts describing the multicursal labyrinth of myth. The earliest labyrinths were unicursal, and seem to have been something like fertility rituals, where the devout would pass through a spiraling maze – much like we organize airport waiting lines today. In any case, the kind of multicursal designs we know from children's comics and coloring books, is a modern phenomenon.↩
2 The very idea of the "network labyrinth" implies a winding maze in itself. The term was coined by Umberto Eco, who described it as "a tree plus an infinite number of corridors that connect its nodes." (From the Tree to the Labyrinth) This kind of maze connects with a multitude of modern concepts, from data clouds to deconstruction, whilst retaining an aspect of a particular medieval idea of the labyrinth as a metaphor for laborious/hard-gotten knowledge (even if substituting medieval "circuitousness" with modern "rupture" as the source of epiphany).↩
3 Streching the definition of a deterministic maze, we could hold Pacman as an early example: A maze with no center has as
its endpoint the state of depletion after Pacman has covered all its
corridors, gobbling up all the pellets. Pacman's concept of "covering the entire area" is really borrowed from the ancient unicursal mazes, but set instead in a maze of branching paths.↩
4 I'm not implementing bounties (quests) yet, but keeping some of this in mind: hoping to opt out of fixed quest lines, perhaps by implementing bounties as part of the factions found within the game world. Let's say you're assigned a mission to capture a criminal. The task should be solvable in different ways, but it should also be possible to ignore the mission, or join the baddies instead, or fail, yet live to see another day. I expect finalized versions of LoSt to have no win condition (but several possible plot hooks to get you started). This will ideally make it possible to recover, at least story-wise, from committing a blunder such as making your intended ally your lethal enemy.↩
5 A tiny bit of topology is high on my todo-list, but it will pay
more attention to the rules of drama than the rules of science. I am
thinking of adding an intermediate step in map generation, after the
climate zones have been defined, but before quest locations are placed,
where the game will put natural borders in the form of water and cliffs.
Rivers and lakes will be straightforward enough, simply continuous
bodies of water patterned across the land. Cliffs will be implemented as a
map feature, so the game won't keep actual track of relative elevation
etc. A cliff hex will be defined with a slope in one direction. It has
the property of sliding everything that lands on it in this direction.
Barring any special skills or equipment, if you try to scale a cliff
from below, you'll just be thrown back where you started, but it'll be
possible to jump down the cliff from above. Cliffs will also provide
special cover, giving advantage to shooters on the high side. Once the
functionality of cliffs is sorted out, they can be distributed around
the map, both in "encounter-sized" chunks, and in great walls that form
an initially impenetrable barrier: to reach that summit, you have to take the winding mountain road, crawling with baddies.↩