Wave Function Collapse
X Cave Generator

Procedural generation is one of the most powerful tools in software and game design; the ability to create structured, visually coherent output from a set of rules rather than manually authoring every detail. This project is a practical exploration of that idea, applied to pixel art world-building. The goal was to design a system where the output always looks intentional and crafted, but no two results are ever the same.

[Fun-heavy · take your time]

SUBJECT

Generative Design

TOOLS

Github
Claude Code
Adobe Indesign
Adobe Photoshop
Google Workspace

TEAM

Jasmine Shirin | Sampada Pote

First Experiment

The starting point was a coral reef. Working with a set of hand-drawn 16×16 pixel art tiles created in class, I built the first version of the engine around those assets; analyzing the actual RGB values along each tile's edges to determine which tiles could sit next to each other without breaking the visual continuity. The reef became the testing ground for every rule the engine would later depend on: the bottom-up build order, the pixel-level edge matching, the zone system that keeps sand on the seafloor and open water above. It didn't always work cleanly; some tiles had no valid neighbours under strict matching rules, which forced honest decisions about fallbacks and constraints. That friction is what made the second project better.

First Experiment

Feel free to interact

Welcome to the world of Quantum Mechanics where we simulate wave function collapse algorithm with pixel art. Enjoy the probability of possible outcomes collapsing and revealing a world with a mix of different environments and themes: Cave and Reef

IMG_5080 2
IMG_5079 2

What I did

Taking that class experiment as the foundation, I designed and built a more ambitious version independently; a Mario-style underground cave world with a fully programmatic tile set, an infinite horizontal scroll, and a tighter constraint system. Rather than working from pre-drawn images, every tile in this version is generated directly in the browser using canvas pixel operations, which gave precise control over edge colors from the start. The result is a grid that reads as a single cohesive cross-section of a world; sky above, crystalline cave in the middle, grassy earth below; seamless enough to loop continuously as a scrolling game background. The interactive version is shown below.

How I did it

The engine is built on a constraint-satisfaction algorithm inspired by Wave Function Collapse; a method that draws conceptually from quantum superposition, where every cell begins as a set of unresolved possibilities and gets locked into a final state only when its neighbours have been determined. In practical terms, every tile placed in the grid must satisfy an exact pixel-level constraint: the top edge of any new tile must match the bottom edge of the tile placed directly below it, color for color across all sixteen pixels. Tiles are placed row by row from the bottom up, left to right, so each decision cascades upward through the entire grid. The randomness exists within those constraints — the engine selects freely among all valid tiles at each position, which is what produces variation across generations. The rules are what produce the coherence.

Feel free to interact

United States
Email: sampadapote1@gmail.com

© Sampada Pote 2025

View