Skip to content

CodingTrain/Wave-Function-Collapse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wave-Function-Collapse

Straight out of quantum mechanics, Wave Function Collapse (WFC) is an algorithm for procedural generation of images. This repository features two approaches to the WFC: the Tiled Model (Coding Challenge 171) and the Overlapping Model (Coding Challenge #186). Both implementations are available in JavaScript (p5.js) and ported to Processing (Java).

GIF animation of the tiled WFC algorithm GIF animation of the overlapping WFC algorithm

Coding Challenges

Archived Raw Footage

Overview

Wave Function Collapse is a constraint-satisfaction algorithm inspired by quantum mechanics. At a high level, you have:

  1. Tiles (or “patterns”) that can appear in each cell.
  2. Adjacency rules describing which tiles can appear next to each other.
  3. Entropy that helps decide which cell to collapse (choose a tile for) next.
  4. Propagation to eliminate invalid tiles from neighbors as constraints tighten.

Completed

  • Implementation of Tile Model (Challenge 171)
  • Implementation of Overlapping Model (Challenge 186)
  • Processing (Java) ports for both models

Corrections / Additional Features

  • Additional edge cases for tiles 4 and 5 (Tiled Model).
  • Computed Property Names (Tiled Model) Issue #35
  • Backtracking for conflict resolution.

Key Resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published