Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 752 Bytes

README.md

File metadata and controls

28 lines (18 loc) · 752 Bytes

WaveFunctionCollapse

Procedural generation with constraints based on Wave Function Collapse algorithm.

1D

For an input string generates string of similar structure, respecting all constrains in an input string.

INPUT: "AAXBBX", N=2, cellnum=8:
OUTPUT: "XAAAXBXBXBBBXAAA"

INPUT: "DOG", N=3, cellnum=5
OUTPUT: "OGDOGDOGDOGDOGD"

2D

For an input:

here is an output:

Remember:

  • Not all inputs are viable
  • Input should be small and simple
  • Big input will add a lot of constraints and it may take ages to complete
  • Often it does have a "deadlock" meaning it is unsolvable, script will end without an output