Collapse

Generate Procedural Worlds With Wave-Function Collapse

Collapse Settings


Collapse Inverval (ms)

1

Collapse Leniency

0.5

Display Settings


World Settings


World Width

200

World Height

100

Wave-function collapse is a procedural generation technique very loosely inspired by wave-function collapse in quantum mechanics.

Imagine that we have grass tiles, sand tiles, and water tiles.

Let the constraints be as follows:

Grass can only be adjacent to coast.

Sand can be adjacent to both grass and water.

Water can only be adjacent to sand.

In the beginning, every tile can be anything. Force a tile to collapse to select a possibility at random. This reduces the possible adjacent tiles. Repeat this until all tiles are filled.

Created with help from: https://robertheaton.com/2018/12/17/wavefunction-collapse-algorithm/ and https://www.boristhebrave.com/2020/04/13/wave-function-collapse-explained/