promptsandmore.com

Click. Tweak. Observe. Understand.

Constraint Systems

Wave Function Collapse with entropy visualization

System Overview

Wave Function Collapse (WFC) generates patterns by collapsing possibilities based on constraints. Starting with all possibilities, it repeatedly picks the cell with lowest entropy (fewest options), collapses it to a single value, and propagates constraints to neighbors.

The entropy heatmap visualizes uncertainty: bright red = many possibilities, dark blue = few possibilities, black = collapsed. This makes the algorithm's decision-making process visible.

Why Games Use This

Key Parameters

Failure Modes

Scaling Behavior

WFC is O(n²) in worst case, but typically much better due to constraint propagation. Each collapse can trigger cascading propagations. For large grids, use chunking or hierarchical WFC.

Memory scales with grid size and tile count. Each cell stores a list of possible tiles.

Related Algorithms

Free Tools & Libraries

System-Thinking Prompts