Skip to content

Wavefunction Collapse algorithm on tiled grids using C++ and raylib

License

Notifications You must be signed in to change notification settings

daniel-meilak/Wavefunction-Collapse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wave Function Collapse using C++ and raylib

This repo is an implementation of a tiled wave function collapse algorithm. It is inspired by the work of Maxim Gumin.

The program includes hand made controls for changing the speed of the simulation, as well as swapping out the tilesets.

Building:

If built using Makefiles, this project requires raylib to be preinstalled (with a working C++ compiler). In the Makefile, make sure RAYLIB_PATH and COMPILER_PATH are set correctly.

Alternatively, CMake can be used to build this project and will download and compile raylib automatically. Requires a C++ compiler and OpenGl.

Both options have been tested on Windows, using Mingw or MSVC, and WSL using g++.

Demo:

There is a playable version (compiled using emscripten) on Itch.io!

Itch.io Thumbnail

Details:

The C++ code is written using modern C++, and requires C++20 support to compile.

The tilesets included in the tilesets/ folder are from Maxim Gumin and Guy Walker's websites, with minor tweaks when required (such as changing all tiles to be 32x32).

The data.txt files included with each texture are in a custom format. I may change it to json/xml/yaml in the future to improve readability.

Screenshots:

Circuit building animation

Screenshot of knot tileset and tile menu

Screenshot of pipe tileset and control menu

About

Wavefunction Collapse algorithm on tiled grids using C++ and raylib

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published