Expand description

Wave Function Collapse

Provides an implementation of the wave function collapse algorithm.

Wave function collapse works by iteratively “collapsing” a collecion of cells (such as a square grid) from all possible states to only the states possible with a given ruleset, selecting randomly where ambiguous.

Modules

Traits

Describes states which have a known “All-possibilities” state

Collapse rules define the relationships between a cell’s possible state based on it’s neighbors.

Represents coordinate deltas which have an inverse - the delta which undoes the change represented by this delta.

Represents set-like states

Defines the space or “world” to run WFC on.

Cell state - represents all possible states a cell can take on

Functions

Perform the wave function collapse algorithm on a given state-space with the provided collapse rule.