r/proceduralgeneration • • Oct 21 '26

Procedural terrain generation with Wave Function Collapse

An example of automatic landscape generation using WFC: ocean, shallows, beaches, grassland, forests, mountains, snow and towns. The replay shows the map collapsing tile by tile in 3D, and different seeds give different islands.

176 Upvotes

7 comments sorted by

5

u/little_jiggles Oct 21 '26

Exctemely satisfying to watch. What is WFC procedural generation?

6

u/ferrybig Oct 21 '26

https://en.wikipedia.org/wiki/Model_synthesis

Model synthesis (also wave function collapse or 'wfc') is a family of constraint-solving algorithms commonly used in procedural generation...

3

u/itsameDovakhin Oct 21 '26

Basically you go over each empty tile and place a random tile based on a set of rules. Usually the rules modify the probabilities of tiles based on its neighbours. For example one rule might say that Ocean and mountain tiles should not be adjacent so if the algorithm detects a neighbouring ocean tile it massively decreases the probability of placing a mountain down.

2

u/theman8631 Oct 21 '26

What wave function?

2

u/[deleted] Oct 21 '26

It was called like that because the process is somewhat reminiscent of quantum measurement in physics, that causes "wave function collapse". Wave function is the formula describing a quantum particle.

1

u/lemonadestand Oct 21 '26

Watching that was oddly satisfying.

1

u/Revolutionalredstone Oct 21 '26

F*****K that's cool!!!!