HackerTube.dev

Superpositions, Sudoku, the Wave Function Collapse algorithm.

Martin Donald · 764.5K views · 2020-07-31 · 14:28

Open on YouTube ↗

If playback is restricted in your region, try opening the original video. Use Mark watched to add it to your marked videos.

Overview

Martin Donald explains the Wave Function Collapse algorithm using Sudoku-like constraint solving and shows how he implemented it with Blender and Godot. It links demos and reference articles.

On Hacker News

Commenters recommend it as the clearest way to understand WFC, especially in threads about Townscaper and tiled content generation.

Recommended by 3 HN people across 3 months · HN mentions 2021–2022

Topics

Search by tags

What people said

V__ · 2022-06 · Strong recommendation

I didn't know about wave collapse functions before stumbling about Townscaper. Still, I found them hard to understand until I found this video by Martin Donald: [VIDEO] Now, I'm just looking for a use-case to implement them myself sometime.

Read the original HN comment ↗
orls · 2022-05 · Recommendation

Not OP, but I happened to see a good video on this recently: [VIDEO] In short, it’s an algorithm for procedural generation of tiled content, like 2d/3d game maps.

Read the original HN comment ↗
t8y · 2021-12 · Recommendation

This uses the "wave function collapse" algorithm. Oskar Stalberg also made a great demo of how it works[0], but it might not make sense just from that. Martin Donald made a really nice youtube video on how it works[1]. The name "wave function collapse" can be off putting but it's pretty straightforward, and an algorithm that can come in handy for many uses both in game development and just general software development. I'm actually procrastinating on HN from working on a GPU parallelised version that can generate millions of positions every frame. In Townscaper you can actually see that the algorithm runs quite slow and lags behind the players input, there's just a bunch of animation to hide it. I'm hoping to eventually get a version that can run in log2(mapsize) time. [0] [LINK] [1] [VIDEO]

Read the original HN comment ↗

Sources

Video by Martin Donald, played through YouTube.

Data and selection notes

HN summaries and labels may contain AI errors. HN dates refer to discussions, not video publication.

HN Library: HackerTube export (2026-10-31) and open-index/hacker-news. Upstream summaries and classifications may contain AI errors.

Views, duration and playback status refresh separately from the published catalog. When an update fails, existing data remains visible.

Selection checks
  • SaaS & AI candidates: Topic keywords do not match
  • Editor-approved picks: Editorial review is required

Rule matches identify candidates. They do not guarantee video quality or financial results.

About the library and its sources