In this dungeon lesson, the WaveFunctionCollapse algorithm is used to define the base shapes of a game level then a Houdini Digital Asset is built to generate a variety of different dungeons in UE4. WFC technology can enhance your procedural level design by letting you drive the final output using a control setup to spawn a larger solution for your level. This control can be a bitmap image or attributes on points and both methods will be used in this lesson.
You can learn how to create some of the Dungeon Props in the following Tutorial
NOTE: These lessons use the SideFX Labs tools. Make sure the latest release (non production build) is installed before doing this lesson.
The project files used for this lesson were created with Unreal 4.24
To start you will take a look at the completed asset in UE4 and explore some of its capabilities. You will then review how the tool is setup in Houdini to understand the techniques that will be taught in the following four lessons.
PART 1 | Wave Function Collapse Nodes
In this lesson, you will take a look at the WFC nodes available in SideFX Labs and how they work together to create patterns that can be used to generate a level. You will then use the Wang Tiles Sample node from SideFX Labs to populate the grid and create the basic shape of a finished level.
PART 2 | Basic Layout using WFC
Now that you have the points and can see the level taking shape, the next step is to start assigning references to geometry in UE4 so that the points can be populated with assets. This will involve tools such as the Attribute Value Replace node which allows you to more easily assign Blueprint references.
PART 3 | Add Walls and Cliffs
Because of their sideways orientation, the walls and cliff faces require a special setup. This involves creating points that have their normals aimed the right way and ensuring that these walls can be procedurally generated from the WFC level design.
PART 4 | Decorate the Rooms
To populate the level with columns, crates, debris and enemies, you will use the existing geometry and layer in a secondary WFC setup to procedurally generate the decorations. This demonstrates how WFC can be used in many different ways to create rich game levels that are ready for gameplay.