Issue 001 · May 2026 · ArticleTech · 14 May 2026
Tech · 14 May 2026

Procedural Generation, Small Canvas

Random-with-constraints versus generative-with-verification. The two algorithms behind our content, why they fit in 50 lines, and the difficulty curve problem.

Nine of the twenty-five games in Hage Game generate their content procedurally rather than loading it from pre-made data. Path Find generates a guaranteed-solvable maze; Code Crack generates the secret code; Pixel Mirror generates the pattern; Sound Match generates the tone set; and so on. Procedural generation is what makes these games infinitely replayable without storing infinite content. This article is about how it works in practice — and what it cannot do.

The two kinds of procedural generation

There are two genuinely different approaches to procedural generation, and the right one depends on what you need.

The first kind is random with constraints. The game picks random values within rules and accepts the result. Sound Match uses this: pick eight random frequencies from a musical scale, assign them to tiles, done. The constraints (scale notes, pair count) ensure the result is always playable; the randomness ensures it is always different.

The second kind is generative-with-verification. The game generates a candidate, checks whether it meets a stricter criterion, and retries if not. Path Find uses this: generate a random Hamiltonian path with backtracking DFS, and the resulting board is guaranteed to be solvable because we constructed it from a solution. Drop Match's starting board uses something similar — pre-test boards for "interesting" cascade potential before serving them.

The first kind is cheap and works for symmetric problems where any output is good. The second kind is more expensive but necessary for problems where some random outputs are unplayable. The choice is mostly about whether the space of legal outputs is dense (use random) or sparse (use verification).

Why our generators are small

A common assumption is that procedural generation requires complex algorithms. It does not, in practice, for browser-scale games. Most of our generators fit in 50 lines of JavaScript. Path Find's solvability-guaranteed maze generator is one of the longest — and it is under 80 lines, including the backtracking. Sound Match's tone generator is closer to 20 lines, picking frequencies from an array, assigning them to a shuffled position array, and pairing them up.

The shortness comes from limited scope. We are not generating open worlds, dungeons with thematic coherence, or quest lines. We are generating a single board for a single play session. The combinatorial space we need to cover is small enough that simple algorithms exhaust it; sophisticated techniques would be wasted.

The difficulty curve problem

Pure random generation has one persistent problem: the difficulty of the result is itself random. Some Sound Match boards are harder than others because some random tone sets are perceptually farther apart than others; some Path Find boards are easier because the random Hamiltonian path happened to follow obvious paths. We tolerate this in most of our games because the variance is small enough not to break player experience.

Where we could not tolerate it, we added a difficulty parameter. Maze Spin generates harder mazes at higher levels by increasing the wall density. Echo Tap grows the sequence length deterministically. Path Find grows the grid size by level. These are not generative innovations; they are simple monotonic adjustments to generator parameters. They are enough.

What procedural generation cannot do

The fundamental limit of procedural generation is that it cannot produce intentional content. A hand-crafted level can have a moment that a designer put there for a reason — a surprise, a callback, a twist. A procedural level has no such moments, only structural regularities. This is fine for games whose appeal is mastering a mechanic; it is fatal for games whose appeal is being surprised by a designer.

Our games are all in the first category, by design. We chose mechanics that reward mastery over surprise, partly because we are a small team and partly because mechanics scale across infinite play sessions in a way that hand-crafted content does not. A different team with different goals would have made different choices. We chose generation because it fit what we wanted to build.


Published · 14 May 2026 · Written and signed by Bill


Published · 14 May 2026 · Written and signed by Bill