
The project allows the user to create organic buildings on an irregular grid that is assembled using the pieces the user provided.
It uses Wave Function Collapse (WVC) to dynamically assemble handcrafted building pieces on an irregular grid, letting users create unique structures with minimal effort.
-
Role: Programmer
-
Features:
-
Irregular generated grid
-
Wave Function Collapse building
-
-
Project Information:
-
Team size: Solo
-
Duration: 1.5 months
-
-
Tools/Language:
-
Unreal Engine 5
-
C++
-
Final Result
The project allows the user to create organic buildings on an irregular grid, that is assembled using the pieces the user provided.
The dual grid
-
The system operates on two grids: a quad-based one for Wave Function Collapse and a secondary building grid with various polygons.
-
Generates the quad grid by subdividing hexagons into triangles, randomly pairing some into quads, then further subdividing them (Fig.1 at the start).
-
Applies a two-step relaxation (Fig. 1) to make quads more square-like while maintaining an organic look.
-
The building grid (Fig. 2 red grid) is formed by connecting centers of neighboring quads, which can result in triangles, quads, pentagons or hexagons.

Fig. 2
Fig. 1
Building meshes
-
Created all building meshes (Fig. 1) from scratch due to the project’s niche nature and lack of a suitable asset pack.
-
In-engine processing detects mesh borders, assigns unique codes (Fig. 2), and checks adjacency compatibility between meshes because they need matching border vertices, requiring precise modeling.
-
To reduce manual asset creation, the system automatically generates (Fig. 3) variations by rotating and mirroring existing pieces, providing all necessary configurations for Wave Function Collapse.

Fig. 1


Fig. 2
Fig. 3
Wave Function Collapse
-
The Wave Function Collapse algorithm picks the cell with the least entropy (fewest possible options) and applies the highest-priority choice, propagating constraints to neighboring cells.
-
Valid options are determined by:
-
A Marching Cubes-based bitmask that defines which parts of a cell are hidden.
-
Border codes, ensuring seamless alignment between adjacent cells.
-
-
This repeats until each cell has a single valid option or all remaining possibilities are valid.