Discover how wave function collapse generates procedural dungeons with varied tiles, lighting, and a demo app for Seeing Eyes game.
Ask about this video. Answers come from its transcript only — with the timestamp, so you can check them.
Generated from the transcript and can be wrong — check the timestamp.
Key Takeaways
- Wave function collapse is an effective and simple method for procedural dungeon generation.
- Tile variety and well-defined adjacency rules are crucial for creating interesting dungeons.
- Visual enhancements like normal maps and clutter improve dungeon realism.
- Interactive demo tools accelerate development and fine-tuning of procedural generation.
- The approach scales to dungeons of any size and shape, offering flexibility for game design.
What the video covers
- The video explains procedural dungeon generation using the wave function collapse (WFC) algorithm.
- Tiles are pre-rendered in Blender with labeled sockets to define valid connections.
- WFC places tiles by collapsing options starting from the square with the fewest possibilities.
- Constraints like walls and corners reduce tile placement options, ensuring logical dungeon layouts.
- A large variety of tiles is essential for diverse and interesting dungeon results.
- Normal maps and clutter passes enhance lighting and visual detail in the dungeons.
- The algorithm supports arbitrary dungeon sizes and shapes.
- A web demo app allows users to generate dungeons, place tiles, and customize features like lighting and clutter.
- The demo includes an auto-solve feature and a perturb option to swap tiles while maintaining adjacency rules.
- The tool helps speed up design iteration by quickly testing new seeds and adjusting tile sets and algorithm weights.
Chapters
- 00:00Introduction to Procedural Dungeon Generation
- 00:15Tile Creation and Labeling with Blender
- 00:23Tile Connection Rules and Constraints
- 00:40Wave Function Collapse Algorithm Explained
- 01:55Importance of Tile Variety
- 02:03Lighting and Clutter Enhancements
- 02:10Demo App Overview and Features
- 03:39Using the Tool for Design Iteration
- 04:23Closing Remarks and Call to Action
Full Transcript — Download SRT & Markdown
Speaker A
These are some dungeons for my upcoming game. They were not hand-placed. Rather, they were generated with a simple algorithm called wave function collapse, which is a lot simpler than it sounds. Here's how it works.
Speaker A
Create some tiles. I pre-rendered them in four rotations with Blender and labeled their sockets. For example, floor, wall, canal.
Speaker A
This lets the algorithm know which tiles can and can't connect to each other. Now, consider this 4x4 grid.
Speaker A
With zero constraints, we can place any of our 286 tiles in any place on the grid. However, adding wall and corner constraints cuts our tile options down dramatically.
Speaker A
We start by placing a tile in the square with the smallest number of possible options, which is a corner square. We have collapsed the wave function for that square by picking one tile.
Speaker A
We then find the next square with the smallest number of tile options and pick a legal tile.
Speaker A
We continue doing this for every square until we have no more empty places. Notice how by the time we get to the end, some spaces have very few tile options, like this square that has one possible solution. It needs a canal
Speaker A
joint here and a wall here. The canal cannot bend right because it would dead end without an end cap, and so it must bend left and exit the wall.
Speaker A
This highlights an important point regarding WFC, which is that if you want varied and interesting results, you need a lot of tiles.
Speaker A
To create more realistic lighting, we use normal maps, which we can bake from Blender. And we also add a clutter pass to give the dungeon more detail.
Speaker A
As you will have guessed, wave function collapse extends to arbitrary size and shape. I'm not quite ready to release a demo for the real game where you can play through these dungeons. However, you can test this algorithm yourself on this
Speaker A
demo app I made, which shows you the dungeon style my upcoming game Seeing Eyes Wishlist now.
Speaker A
will use. In the web app, you can generate dungeons, place your own tiles. With auto solve enabled, this will change surrounding tiles to fit. Disable this if you want to break adjacency rules.
Speaker A
You can also generate around your placed tiles. This is useful if you want a specific feature in your dungeon.
Speaker A
You can control dungeon size and shape and adjust lighting and clutter. And perturb, a feature I really like, which swaps any tile for a random tile and auto solves the connecting pieces.
Speaker A
If you love a dungeon overall, but dislike one area, this feature is useful. Using this tool has been foundational in tweaking the algorithm I use in the real game. Only by generating new seeds and observing the results quickly can I see
Speaker A
which tiles need adding and which algorithm weights need changing, substantially speeding up the rate of design iteration. I'll be dropping a bigger update soon on my trials and tribulations over the last few months.
Speaker A
Thanks for listening. Please remember to subscribe, wishlist, and play with the demo.
Topics:procedural generationwave function collapsedungeon generationgame developmentBlendernormal mapstile adjacencySeeing Eyesdemo appalgorithm











