Enhancing Wave Function Collapse Algorithm using Bitwise Operations

Yash Punia, Priyanka Priyanka, T.P Sharma · 2023

The wave function collapse algorithm is a method for generating procedural content in the field of computer graphics and video games introduced in 2016. In this algorithm, a large number of potential outcomes are represented as a wave function, and as the algorithm progresses, the wave function collapses into a single, definite state that represents the final output. Over the years there have been advances in improving design constraints, automatic rule writing and applying Wave Function Collapse in other domains like navigation etc. This paper aims to improve the runtime and size of the Wave Function Collapse algorithm by modifying its implementation using a Bitwise Grid and bitwise operations. A terrain is generated using 4 states. The constraints or rules are defined using a new constraint matrix according to which many random terrains are generated quickly. After various tests and iterations, we can conclude that Bitwise Grid implementation can produce 8000 terrains in approximately 1 second whereas the original implementation took 8 seconds.

Read the paper · More papers on PaperTik