Cave Generator in Houdini (part 1)

Article / 30 December 2025

Disclaimer: All things I share in this blog post are the fruit of my own labor and separate from my professional work at Cloud Imperium Games. Master's Thesis project completed at Hamburg University of Applied Sciences (March 2024). This academic research tool was developed independently as part of my degree program, separate from any professional work.

link to 
Part 2 
link to
Part 3 

Hello there!

Here is the tl;dr version of my master's thesis. I feel bad for my past self, who worked on this and didn't get his work published. So, I decided to publish the thesis as blog posts.

I didn't write this as a tutorial of sorts, but more of a sharing of knowledge on what I found while building the tools. I try to keep the format the same as what I write in my master's thesis, but less formal and fewer words. If this can help you in the journey of learning houdini then I would consider this a big success. 

I write this as 3 part blogs. making it more digestible for a short read. hopefully.

The following are the preview of how the final cave will look



Abstract - aka tl;dr

Caves are a common and iconic setting in video game levels, but creating them can be a challenging task. So I try to make a tool that can be used for everyday Unreal Engine user without knowing houdini at all. Users just need to download the hda, download the needed data (mesh and textures), and generate the cave almost instantly. Mind you, in this time PCG wasnt really introduced at all, so my choices was either making procedural tools for houdini or for blender (using geo-nodes). My friend convinced me to choose Houdini, since it's getting popular, so I chose Houdini after that 

In this part of the article, I will discuss more on the theory behind cave generations (like L-system and Noise Algorithm), a bit cave explanations on how caves in the real world are made, and of course, some related works. The other part will focus more on implementations and testing the results.

Keywords: Cave level design, Procedural tools, Unreal Engine 5, Houdini Engine, Environment Generation.


Introduction

Caves in video games are kind of a staple: it's everywhere. but creating the cave level manually will take a lot of time, and often the developer opts for a more automatic - but customizable - approach, which uses procedural techniques. This is where the tools will come in handy: it provide simplicity and great results, customizable and most importantly, consistency

This work will use Houdini and Unreal Engine 5 as its base. Although the tools provided the default textures and mesh, users should be able to customize the look of the cave in the end


Objective

The main goal of this work is to create an easy-to-use tool for Unreal Engine developers to make a cave level using the Houdini engine. The specific objectives are as follows:

  1. Develop a tool that uses the Houdini engine and Unreal Engine to simplify the creation of cave levels in video game development.
  2. The tool should be able to create a realistic level with the natural looks and layouts.
  3. Create functionality for the user that is sufficient for creating cave levels that are comparable to manually created levels. 

The intended users of this work will range from beginner to advanced users. Users won’t need in-depth knowledge of how Houdini works, but basic knowledge of how to operate Unreal Engine 5 will be needed. Specifically, the tool can be used for a wide range of users: a game developer who wants to make a cave level with a realistic style, a level designer who only wants to have a randomized cave layout, an environment artist who wants to have a cave background, etc. Additionally, the tool is also needed to be customizable, so the user can change the generated cave in case the cave-level needs to adapt to a certain art style.


Cave Generation and Related Work 

This chapter explores the correlation between real-world caves and cave levels in video games. We delve into the diversity of real caves, their characteristics, and how they are formed, while also looking into how they can be used for creating a game level. Afterward, we discuss the theoretical framework for the common methods of making a cave-level video game along with related works.

Cave in Video Game

In his essay, Dennis Jerz discusses the correlation between caves and video games. As a non-surface space, a cave represents the unknown in the real world. Historically, caves have been used as shelter, providing a safe space at their entrances. In modern video games, a cave level represents danger, alerting the player that an enemy is lurking and thus making it a common level archetype in video games.

Cave design in video games is a balancing act of creating a space for playing while also maintaining believability. From a playability perspective, a cave level must offer traversable space, optimal lighting for guidance, a diverse layout that avoids repetition, and other essential gaming needs. On the environmental side, the cave needs to have realistic textures, believable cave formations, and elements that can be expected to be found in a cave level, such as stalactites, stalagmites, and rock formations. Of course, all this needs to be in line with the game art style, but the idea is to get the players to realize and immerse themselves, regardless of the art style of the game, that they are in a cave space.

Cave Layout in the Real World

In the real world, there are many cave archetypes, such as littoral caves, primary caves, solution caves, and many more. Sometimes cave types also mix and blend together as a result of years of natural work and geological formation. Although it's exciting to explore multiple types of caves, to maintain the focus of this thesis, I have chosen to concentrate on only one cave archetype: rock caves. Game developers often choose rock caves when creating their first cave level, mostly because they can be seamlessly integrated and built into various in-game environments. The rock cave can be found in lush tropical forests, in snowy mountains hidden behind glaciers, or in dry tundra biomes.


Figure 1: References of rock caves that will serve as inspiration for this work. Photos by Alex Beddows (used within permission)

    On a larger scale, real-world cave formation results from various processes, including chemical reactions between water and limestone, weathering, erosion through water or wind, and the movement of rock plates that create hollow underground spaces [3][4]. Simulating these complex and naturally occurring cave formations within a computer is not plausible in game development. This is because a) the strength of commercially available computers is not enough to simulate naturally created caves, and b) players prioritize more on whether the cave looks believable and less on how the cave was built. So, game developers use techniques and methods that achieve the layout of the cave level that replicates real patterns.

That being said, we can learn about the common patterns of caves in the real world and create a layout that follows those patterns to enhance player immersion. The illustration below shows the common cave formation patterns found in reality:

Figure 2. Common cave patterns observed in the world [5]


Among the patterns above, the “Branchwork” and “Anastomotic” patterns will be used mainly in this work. This is because these patterns have the most chance and potential of creating a unique experience for the player, and also are the most common patterns used in adventure-like games.


Theoretical Framework

In video game design, there are numerous methods for creating cave layouts. In the following section, we will be discussing the techniques that are commonly used for developing a cave level for video games procedurally.

Cellular Automata

Cellular Automata is a mathematical model with many uses in different fields such as cryptography, biology, physics, and geography [6]. These models start with a grid of cells with finite states (e.g., as “on” and “off”), and an input with initial states on the grid. Over time, each cell’s state changes based on its information about the state of the cells in itself and the states of its neighbors.

Below is a simple variation of a popular cellular automaton, “Conway’s Game of Life”.

  • The grid is two-dimensional, and each cell can be in one of two states: “on” or “off”.
  • The neighborhood of each cell consists of its eight immediate neighbors.
  • The rule is as follows: if a cell has two or three live neighbors, it becomes “alive” in the next generation; otherwise, it becomes “dead”.

Figure 3. Example of how cellular automata work. t=0 is the initial state and the input, while t=1
and t=2 illustrate the grid evolution over time. Created using Google Sheets


    

In t=0, the initial input is a grid of 5x5 with an “alive” state on cells (2,2), (3,3), and (4,3). According to the rules, every cell will change its state from “alive” to “dead” based on its neighbor count. For instance, in “t=1”, the cell (2,2) changes its state to “dead” because its immediate neighbor count is only 1, while the cell (3,2) turns “alive” because it has 3 live neighbors. This process will continue until “t=5”, resulting in a grid filled with “alive” cells.

When it comes to cave generation, the cellular automata method is often used to create a procedural cave layout. By providing a grid (which can be even three-dimensional) with randomized initial states and applying rules with enough iterations, a randomized cave layout is achieved. An example of this method can be observed in Sebastian League’s demonstration of how to create a Dungeon level in Unity on his YouTube channel . Users can change the width and height of the input grids and alsothe  seeds for the controls of creating randomized starting input states. His works, although implemented in Unity, are still possible to do in Houdini, and gave me much inspiration on how to implement cellular automata. Johnson et al. [8] have also published a paper on creating a procedural cave using cellular automata in video games. Their algorithm is efficient and suitable for real-time scenarios. Although their focus is more on the playability of the cave, their work gives me insight on how to use an effective cellular automaton to create cave levels.

Figure 4. Example of how cellular automata work to create a cave-like pattern [6]



L-System

The L-System, or Lindenmayer system, is a mathematical framework used to create natural and complex structures that follow certain rules. It was originally developed by biologist Astrid Lindenmayer in 1968 [9][10]. This system was originally used in the biology field (for example, to simulate growing plants), but it can be used in computer graphics and other fields to create complex structures.

There are many variations of the L-system, but the one relevant to this work is the model designed by Lindenmayer to simulate plant growth. This L-System includes functionality to define branches. Similar to the cellular automata framework, it requires an initial input and has to follow rules on each iteration. The structures will grow into more complex systems in a recursive nature that builds on top of the result from the previous iteration. The model is represented with a string and has the initial input string called “Axiom.” The string itself can have “variables” which can transform into a new sequence of strings based on rules, and “constants” which remain unaltered. 

A simple example of one of the L-Systems: 

  • Axiom: X
  • Constant: + - [ ]
  • Variable: X F
  • Rules: X=F[-X][+X], F= FF

Which produces:

  • t= 0: X
  • t= 1: F[-X][+X]
  • t= 2: FF[-F[-X][+X]][+F[-X][+X]]
  • t= 3: FFFF[-FF[-F[-X][+X]][+F[-X][+X]]][+FF[-F[-X][+X]][+F[-X][+X]]]

In the example above, we see the string quickly grows into a complex set of strings. Translating this result sequence into graphical rules, we can get the model of a plant: for every ‘F’ and ‘X’, draw a line. Everything inside the square brackets (“[” and “]”) represents a new branch, while the plus-minus symbol (‘+-’) is a 20-degree rotation to the left (-) and right (+). Each iteration produces the model represented in Figure 5. a:

Figure 5. a) results of the L-system based on the previous rules. b) cave network that can be
created with L-System [11]


Based on the simple example above, the L-system can also be used to create a cave pattern, specifically the “Branchwork” pattern. With customized rules and enough iteration, a procedural but organic tree-like pattern can be achieved (Figure 5. b). In regards to this work, the L-System is a good addition for creating the procedural layout of caves with minimal inputs.

Noise Algorithm

One of the common methods in video game development to create a cave level is to use a noise algorithm to create a cave. Some sandbox games, such as Terraria and Minecraft, utilize this method in creating cave levels [12][13]. The idea is to create a randomized pattern that can be found on the chosen noise to give the base cave layout. For example, Perlin noise with an increase in contrast can yield the following result that has a resemblance to a cave structure:

Figure 6. Processed Perlin noise that creates a cave-like structure. Created in Substance Designer
[25]

This method works effectively when the noise is combined, for example, by multiplying or subtracting it with other noises in order to mimic the intricate details of caves in the real world. However, the drawback of this method is that the generated result is often unpredictable. The user needs to be able to contain the generated result in some way and follow the guidelines provided by the user. In other words, there's a need to balance the randomness created through this method with the user’s custom-defined inputs.


Related Works

In the world of procedural cave generation for video games, several notable works have contributed to this field. To provide an overview, we will briefly discuss a few works that have influenced the development of this thesis.

Procedural Generation of 3D Caves for Games on the GPU

In their publication, Mark et al. [14] created a procedural tool that builds a cave system in the Unity game engine. Their work includes using an L-system for creating a base layout, followed by using a noise algorithm to carve the cave structure. Lastly, they processed their generated voxel data into a mesh and further shaped it using shader programming. Their methods also use cellular automata to populate the cave network with objects. While this paper has similarities to this work, their result is focused more on creating cave shapes instead of other factors in video games such as playability or environment. The resulting cave, although resembling cave shapes in nature, feels empty and quite repetitive. The lighting in the cave was also not considered in the result. This gave me a lot of inspiration to implement a tool that not only has the playability part but also keeps its focus on believability by integrating non repetitive textures and lighting.

Mathias Thossen’s Cave Generator

Mathias Thossen, a VFX artist at nDreams, created a cave generator using Houdini. His tool uses the L-system to create many branching layouts of the cave and generates spheres along the network with a random scale attribute, later adding stalactites and stalagmites. In his breakdown of the tool, he also researched the main method of creating a cave-like layout before focusing only on using the L-system. The result is a cave tool that works with a landscape. His breakdown article provided many insights into what to look for when creating a cave system in Houdini.

Emily Fung’s Tutorial on scattering rocks in Houdini

Emily Fung, a VFX Artist and a former intern at SideFx, shared a tutorial video on YouTube, where she discusses her methods of creating rock procedurally, efficient rock scattering, and rendering techniques using Houdini’s renderer, Karma. Although her tutorial focuses mostly on rendering in Houdini, her methods of creating rock procedurally and her way of using and creating masks for scattering rocks provided inspiration and valuable insight for this thesis. Especially her method of better scattering rocks based on size is excellent for achieving a realistic rock formation when scattering 3D meshes in Houdini.

John Kunz’s Cave Layout in Houdini

John Kunz also created a cave layout in Houdini. His creation is more for use in Houdini only and not in video games, but he created a quite detailed cave using Houdini with the use of a noise algorithm on volume functions that Houdini provides. The layout resulting from his method shows a successful, detailed cave layout. 

These related works mentioned above provide valuable insights and techniques, yet they may not fully address the challenges and objectives of this work.

next part