Skip to Content
PGF
Session 4

4.2Tiles across the grid

A simplistic 2D WFC algorithm implementation in practice

For the first exercise, we will examine a simplistic 2D WFC algorithm, inspired by Robert Heathon’s example Wave Function Collapse Algorithm, where he implemented a sea, coast, land WFC. In our case we will use another tile for the forest. Below is an example of the output of the algorithm in Grasshopper.

You can get started by opening the Grasshopper file below:

Ensure you have Rhino 8+ installed, there are no Third party dependencies.


One cell at a time

The algorithm works one cell at a time. The first cell is the top left corner. The algorithm then looks at the cell to the right and the cell below. It then collapses the cell to the tile that fits the best. This process is repeated for each cell in the grid.

On this page