WFCFunctions

WFCFunctions

Choose your operating system:

Windows

macOS

Linux

On this page

Actions

Collapse

Solve a grid using a WFC model. If successful, spawn an actor.

Target is Wave Function Collapse Subsystem

Derive Grid from Transform Bounds

Derive grid from the bounds of an array of transforms Assumptions: -Transforms can only represent a single grid -Sets empty starter option if there is a valid grid position with no transform -Orientation is determined by the yaw of the first transform in the array

Target is Wave Function Collapse Subsystem

Derive Grid from Transforms

Derive grid from an array of transforms Assumptions: -Every transform represents the center point of a tile position -Sets empty starter option if there is a valid grid position with no transform -Orientation is determined by the yaw of the first transform in the array

Target is Wave Function Collapse Subsystem

Initialize WFC

Initialize WFC process which sets up Tiles and RemainingTiles arrays Pre-populates Tiles with StarterOptions, BorderOptions and InitialTiles

Target is Wave Function Collapse Subsystem

Observation Propagation

Recursive Observation and Propagation cycle

Target is Wave Function Collapse Subsystem

Observe

Observation phase: This process randomly selects one tile from minimum entropy tiles then randomly selects a valid option for that tile

Target is Wave Function Collapse Subsystem

Propagate

Propagation phase: This process checks if the selection made during the observation is valid by checking constraint validity with neighboring tiles. Neighboring tiles may reduce their remaining options to include only valid options. If the remaining options of a tile were modified, the neighboring tiles of the modified tile will be added to a queue. During this process, if any contradiction (a tile with zero remaining options) is encountered, the current solve will fail.

Target is Wave Function Collapse Subsystem