
Ghost Ship made a blog of sorts with a look under the hood of DRG’s infinite cave machine. “The moment you select a mission in Deep Rock Galactic, a cave is born.” Now that is an interesting concept. I hold a massive amount of love for DRG, myself, although I admit we don’t play it near as much as I’d like. To be fair though, our group size tends to fluctuate to a point where a 4 person game becomes more difficult for us to play. Lately for example, our group size tends to be just a touch over 4 on most weekend days when our group gets together (and the evil foosball isn’t interrupting it, but distracting several of our friends!). There is quite a bit of eye candy on the Ghost Ships post, and I suggest (as always), you take a peek at the official post on their Steam site, here. In a somewhat bit of irony, I was able to pull the post in it’s entirety, but I removed the images, as I just want to get the information out here for anyone interested, and not risk any copy right issues where possible. Rock and Stone! đ
Below Decks at Ghost Ship: Cave generation in Deep Rock Galactic
Take a look under the hood of DRG’s infinite cave machine
Hello Miners,
Weâve got another behind the scenes peek for you, this time on one of your most requested topics: cave generation. Letâs explore how the caves of Hoxxes get formed, thousands of times over again, every single day. Hope you like it!
Planting a cave seed
The moment you select a mission in Deep Rock Galactic, a cave is born.
Out in some invisible abstract, the game generates a seed. This is a procedurally-generated string of numbers containing the instructions for a brand new cave system. This random number decides what the caverns will look like, where youâll find mineral deposits, and which fiends await you within. All of this is determined in a fraction of a second, flash generated when you lock in a mission.
This new cave is entirely unique. There are many like it, but this one is yours.
Caves â or more specifically, procedurally-generated caves â are what define Deep Rock Galactic. They set the stage for the action, giving life and lore to the game. Theyâre what make each dwarfâs traversal tools relevant, enabling each classâ function and identity. And the game owes a great deal of its replayability to the limitless pool of possible caves to explore.
So howâs it all work?
Let’s dig into it.Cave generation in a nutshell
Your cave seed gets generated right when you select a mission, but the actual cave comes together once you hop in the Drop Pod.
As you hurtle toward Hoxxes, the cave generator really gets to work. Cave systems come together like pearls on a string: one room at a time, connected by narrow, winding tunnels.
While the overall cave system is a unique result of random generation, the individual cave rooms are hand-crafted. If you imagine the cave generator as our automated chef, we still want real people to make sure it’s cooking with high-quality ingredients. There are over 100 cave room templates to pick from — but many of these templates also contain multiple internal ‘randomizer’ variants, so spawning the same template 20 different times would still produce 20 unique rooms.
Depending on the mission type, length and difficulty, these room templates could get warped, mirrored, or overlapped as the cave generator strings them together. On-site Refinery missions, for example, mash multiple rooms into one massive cavern. This is why you’re likely to see huge herds of Lootbugs during these missions, because the entire cave’s population all gets spawned at the same point.
But to understand how this generation really works, we need to take a closer look at one of these cave room templates.
A cave room template? A Windows 98 screensaver? There’s no way to be sure.
In focus: how a cave room template works
Every cave room template is composed of intersecting spheres, half spheres and flat planes. This cluster of shapes tells the cave generation engine what sort of volume to carve out of the solid rock, creating the rooms where each mission takes place.
The image above is the template for a cave room — itâs the instructions that the procedural generator uses to create a unique cavern.
Hereâs what youâre looking at:
- Green and yellow lines –Â These lines determine the general shape of the room. The yellow lines act as the outer boundary, the base layer upon which the cave generator applies ânoiseâ like textured surfaces and biome-specific rock patterns. The green lines are the inner boundary, limiting how far this ânoiseâ is allowed to fluctuate and push into the space itself.
- Small orange orbs –Â You can see these clustered in the center, surrounded by an outer yellow wireframe. They act as randomizer elements: they mark space that might either be hollowed out to create extra volume, or filled in with a random protruding rock formation. When this cave room is created, each of these has a random chance to be âactivatedâ or not. This way, each individual cave room can have an even greater degree of unique and unpredictable variety.
- Medium orange half-spheres –Â These half-domes, seen around the outer perimeter of the cave room, mark potential exit paths for the room. In game, these are the areas filled with compacted dirt. The cave generator engine uses these as nodes to link this room to the rest of the cave system via tunnels.
- Orange wireframe globe –Â The orange sphere in the background limits the size of the cavern. In the game, various cavern templates are sorted by different sizes. If the template in question pushes beyond this orange globe, weâve got to either re-categorize its size, or cut it down to fit within the globe.
For comparison, directly below is this same cavern template once itâs been fed through the procedural generator and rendered in the game. This one template has dozens of possible major iterations, and would never look quite the same if we loaded it again.
A single cavern, viewed from the outside using the power of Developer Magicâ˘.
Early version of cavern and tunnel generation. Simplified wireframe structure elements are clearly visible.
What makes a cave fun?
While a computer brain is great at randomly stitching a cave system together, itâs not so good at deciding what sort of cave is actually fun to play. Thatâs why we have human brains in charge of that part.
Anders Heindorff Frederiksen, Senior Game Designer at Ghost Ship Games, has been the human brain (and complete human person) designing the cave rooms since Season 03. In his words, he makes the building blocks that feed into the cave generator. Heâs the one putting together the cave wireframes like we looked at just above.
As he sees it, there are a few key considerations in making a good cave: traversal, natural wayfinding, and dramatic experience.
A cave should require players to carve out terrain and use their traversal tools to get around, but it shouldnât feel like a maze. While larger cave systems can get a little labyrinthine, individual rooms should still feel intuitive, with their shapes âfunnelingâ players through to the next exit point. Itâs about balance: not so simple that it gets boring, not so complex that it feels punishing. On top of all that, a cave room should just seem cool. That one comes down to gut feeling.
However, Anders canât guarantee all of this by hand-sculpting it. Heâs still got to make design decisions that can withstand random variation from the cave generator.
âOnce I make a new room, Iâll load in and play it a bunch of times with Scout, then Driller, and so on. Sometimes I play through it and it really sucks. Then Iâve got to figure out what doesnât work, and why,â he says. âIt might be that the visibilityâs bad, or the room is basically unplayable as some classes. I can only set the framework for the space before the generator gives its own spin on it, so thereâs a lot of trial and error.â
Early experiments with room generation, and shaping cave surface textures.
Concept sketches for different cave rooms and rock formations.
Biomes: furnishing the caves
Once weâve got a cave all shaped and laid out, it needs noise and debris.
âNoiseâ is the technical term for shaping the caveâs walls, ceilings and floors. Basically, itâs about taking the perfect spherical shapes of the cave framework, and crumpling those surfaces into something more interesting and rock-like. âDebrisâ refers to the process of sprinkling in assets like smaller rock formations, cobwebs, hazards, and the flora and fauna unique to the selected biome. Every biome has its own distinct patterns of noise and debris.
Robert Friis, Studio Art Director and co-founder of Ghost Ship Games (and also the voice of Mission Control) began working on different biomes just a few months into the gameâs development. As he sees it, Hoxxesâ different biomes are an essential dimension of the gameâs procedural generation.
“Firstly, they give a lot of character to the planet of Hoxxes. But it’s also a big way for us to boost the game’s replayability,â he says. âThe exact same level will look and play differently depending on which biome is then added on top. It determines the enemies and interactive hazards you’ll meet, things like fog and lighting can be completely different, even the shapes of the caves themselves will be different, and it’s then up to the player to figure out how to navigate it.â
Your selected biome tells the procedural generator how to sculpt the caveâs surfaces, and how to populate it with flora and fauna. Each biome has a distinct texture palette: Magma Core, for example, applies sharp, ridged ceilings and craggy, jagged edges to most surfaces. Sandblasted Corridors, by contrast, is appropriately smoothed, eroded, and sparse.
Nobody at Ghost Ship Games is a professional geologist, so most aesthetic choices here come down to what looks and feels cool. Hoxxesâ biomes draw from real-world caves as well as fiction. Areas like Salt Pits, Glacial Strata, or even Crystalline Caverns (see the Naica Mine) resemble something you might find here on earth â while a biome like Azure Weald reflects inspiration from the luminous landscapes of Avatar.
In essence, you could view biomes as the âfinishing touchesâ department in cave generation. If the wireframe structure decides the shape of the cave, the noise and debris are the wallpaper and furnishings.
Very early versions of the game experimented with a blockier, Minecraft-esque terrain system.
A prototype ‘debris’ test from early in development, experimenting with cave surface meshes.
New caves, tomorrow and forever
Thereâs some statistic out there about how you can connect six standard LEGO bricks in about a billion different ways.
You might think about Deep Rock Galacticâs procedural cave generator as working in a similar way. But instead of six bricks, itâs got a pool of 119 hand-crafted rooms and 10 biomes to pick from. Plus, it can warp and tweak and overlap all these elements before snapping them together.
The infinite cave engine runs around the clock, day in and day out, 365 days a year. On an average day, the cave generator produces about 150,000 new cave systems for players on Steam. Since the game launched to Early Access in 2018, Deep Rock Galactic players have generated and explored well over half a billion unique cave systems.
In some way, you could say this cave machine is the gameâs main character. In any case, itâs the playmaker and dungeon master, setting the stage for all the rest. Itâs the one to thank for the gigantic, dramatic caverns that stretch out into the darkness, as well as the idiotically narrow corridors that cost you the mission when youâre rushing to extract. Itâs with you on every mission, whether itâs your first or your millionth.
Itâll be there as long as Hoxxes has minerals to mine, knitting new caves out in the endless dark.
What was the biggest cave youâve ever come across in Deep Rock Galactic? Let us know in the comments.
Also, if thereâs another subject youâd like to learn about in the next Below Decks, weâd be happy to hear it. Thanks for reading!