Git Product home page Git Product logo

wfc's Introduction

Wave Function Collapse

A C++, voxel-based implementation of the WFC algorithm for a senior capstone project

Overview

A C++, voxel-based implementation of Wave Function Collapse. This algorithm takes in a tileset and some adjacency information about those tiles (which tiles can sit next to which, and in what direction) and can generate infinite configurations in an NxNxN grid using those tiles. A video presentation and demo can be found here.

Build Mode

This implementation featues a build mode, in which the user can place down starting tiles and then run the algorithm.

Iterative Mode

There is also an option to watch the algorithm run iteratively: at the start, each grid cell contains a transparent cube representing the potential tiles that can be placed in that cell. As the algorithm progresses, the number of valid tile options for a given cell decreases, and the transparent cube in that cell decreases in size until it disappears completely and is replaced by that cell's observed tile.

Tilesets

The "knots" tile set was created by the original author, while I created the other two tile sets in MagicaVoxel.

Knots Castle Buildings

Future Steps

As of writing this readme, it's been several years since I worked on this project and there are lots of things I would change! The most obvious is to instance the tile meshes, as any configuration will contain the same 10 or so tiles with different translations and rotations. In general, thinking about this project from a more data-oriented mindset would probably help a lot. It would also be interesting to add a backtracking algorithm to resolve unsolvable configurations, which can happen not infrequently depending on the tile set selected and number of user tiles placed in build mode.

wfc's People

Contributors

clach avatar clachanski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.