Skip to content

I Made Procedural Dungeons That Don't Suck (demo available)

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.

Answers

Questions about this video

What is wave function collapse in the context of dungeon generation?

Wave function collapse is an algorithm that generates dungeons by placing tiles based on adjacency constraints, collapsing options starting from the most constrained grid squares.

How does the demo app help in dungeon design?

The demo app allows users to generate dungeons, place tiles, and adjust settings like lighting and clutter, enabling quick testing and iteration of procedural generation.

Why is having many tile options important for wave function collapse?

A large variety of tiles ensures more varied and interesting dungeon layouts, preventing repetitive or dead-end designs by providing diverse adjacency possibilities.

Full Transcript — Download SRT & Markdown

00:04
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.
00:15
Speaker A
Create some tiles. I pre-rendered them in four rotations with Blender and labeled their sockets. For example, floor, wall, canal.
00:23
Speaker A
This lets the algorithm know which tiles can and can't connect to each other. Now, consider this 4x4 grid.
00:30
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.
00:40
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.
00:50
Speaker A
We then find the next square with the smallest number of tile options and pick a legal tile.
00:55
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
01:07
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.
01:15
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.
01:23
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.
01:30
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
01:44
Speaker A
demo app I made, which shows you the dungeon style my upcoming game Seeing Eyes Wishlist now.
01:49
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.
02:00
Speaker A
You can also generate around your placed tiles. This is useful if you want a specific feature in your dungeon.
02:06
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.
02:19
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
02:32
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.
02:43
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

Get More with the SozAI App

Transcribe recordings, audio files, and YouTube videos — with AI summaries, speaker detection, and unlimited transcriptions.

Or transcribe another YouTube video here →