Wave Function Collpase GML Demo

What's this?

This is a demo of the simple tiled model of the Wave Function Collapse algorithm by Maxim Gumin, implemented in GML for GameMaker Studio 2. The original releases can be found here.

The algorithm generates a random tilemap that is internally consistent (i.e. no discontinuities between tiles) with a given tileset and accompanying constraint data that determines each tile's legal neighbours. You can think of it as your computer playing a game of TetraVex or Carcassonne by itself with an unlimited number of tiles.

This GML implementation of the algorithm can be used for procedurally generating tile-based levels and maps in GameMaker Studio 2, though it its current state, it is not production-ready yet.

How to Use

  1. Select a tileset with the ← and → buttons,
  2. Press the Start button. 
  3. Enter the seed you wish to use in the popup that appears or leave it as it is.
  4. Press OK to begin the generating the tilemap, or Cancel to go back and re-select a tileset.

Art Credits

  • Pipes, 2-Corner Wang Tiles - M.S.T.O.P.
  • Circuit Board - M.S.T.O.P., based on the circuit board tileset from the original WFC repo by Maxim Gumin
  • Abstract Platform, Roads, Monochrome RPGKenney

Leave a comment

Log in with itch.io to leave a comment.