HackerTubewatch
Surprise me
Frame from EPC2018 | Wave Function Collapse in Bad North | Oskar Stalberg Plays via YouTube's privacy-enhanced embed

EPC2018 | Wave Function Collapse in Bad North | Oskar Stalberg

BUas Games
Talks
YouTube
4 HN users recommended this talk5 months2020–2024 score 5.5
Years with an HN recommendation, 2007–2026

The go-to talk whenever Wave Function Collapse, Townscaper or tile-based procedural generation comes up.

Oskar Stalberg explains how Wave Function Collapse assembles island dioramas from handcrafted tilesets in Bad North. He covers the theory, implementation, tooling, and how he blends art and technology.

“has some great talks on YouTube about how the systems in Bad North and Townscaper work.” (HN, 2023)

1 strong recommendations · 4 recommendations · 5 citations · Talks · intermediate

10 Hacker News comments

From the HN archive; up to 20 kept per video, favoring different commenters. Recommendations first.

@pdoub Jul 2020 Recommends
on HN thread Brick Block (2016)
Please note that this is an old demo that has since grown into a full-blown game: [link] (Says Windows-only, but has a working Beta for Mac) Here's a talk by Oskar on how generating such worlds work: [this video]
Creator explains how generating such worlds works.
@btown Dec 2021 Recommends
on HN thread Townscaper Running in the Browser
And here's another, slightly more technical talk from him about the "wave function collapse" algorithm he uses for procedural generation in his games: [this video]
More technical talk on the wave function collapse algorithm.

Citations, criticism and jokes

@bschne Jul 2020 Cites it
on HN thread Townscaper – A building game inspired by the design of Scandinavian cities
Not sure what of this was actually used in townscaper, but someone in another discussion of the game (can't remember where unfortunately) referred to these two sources: - Oskar Stålberg's 2018 Talk "Wave Function Collapse in Bad North" ( [this video] ) - Müller et al, 2006 - "Procedural Modeling of Buildings" ( [link] )
Cited as a source on the technique behind Townscaper.
@detaro Jun 2021 Cites it
on HN thread How to create a game like Townscaper?
Its creator has a bunch of details on their Twitter ( [link] , although digging through long Twitter history is of course a pain) and given some talks: [this video] [link]
Creator's talks give details on Townscaper-style generation.
@hesdeadjim Jul 2021 Cites it
on HN thread WaveFunctionCollapse: Generates bitmaps that are locally similar to the input
I played around a lot with this library: [link] Fun stuff, but I struggled to get a lot of value out of using it for level gen. You get cool patterns, but levels need structure and intent to be interesting. Adding constraints to the algorithm becomes a big-oh nightmare and you end up with frequently unsolvable paths as the algorithm recurses. The game Bad North used it to good effect, so depending on the game it may be a very useful tool in the toolbelt. [this video]
Shows Wave Function Collapse used in the game Bad North.
@nico Mar 2024 Cites it
on HN thread Tiny bitfield based text renderer (2022)
Yes, it is probably its main usage The author of the GitHub repo is a pretty successful game author and has used it many times for his games Here’s a talk by him talking about procedural generation using wave function collapse: [this video]
Talk on procedural generation using wave function collapse by a successful game author.
@PythagoRascal Nov 2024 Cites it
on HN thread Tiny Glade 'built' its way to >600k sold in a month
Read more
As far as I know they are using a customised variant of the "wave-function collapse" technique, used and popularised by Oskar Stalberg in his games "Bad North" and "Townscaper". The technique boils down to hand-crafting tons of tiles with adjacency rules about which tiles can slot together. When the user adds/removes a tile the algorithm iteratively tries to find fitting tiles and, if needed, changes neighbouring tiles for ones with the best transitions. He gave a talk where he goes into detail about this[1]. You can also find more if you google his name and "wave-function collapse". [1]: [this video]
Detailed talk on the tile-adjacency wave-function-collapse technique behind Bad North.

Video list and Hacker News comment labels from HackerTube (prompted by @karpathy), released under ODC-By 1.0, built on the open-index/hacker-news archive. Hacker News data is provided by Y Combinator; comments remain the work of their authors. Video titles, channel names and thumbnails belong to their creators and are shown via YouTube. HackerTube Watch is an unofficial edition. Data export of 2026-10-31.

Keyboard shortcuts

/
Search
j k
Next / previous video
r
Surprise me
l
Like (video page)
w
Watch later (video page)
?
This help
Esc
Close