Skip to content
0:00 / 0:00

#wavefunctioncollapse#proceduralgeneration#badnorth

EPC2018 | Wave Function Collapse in Bad North | Oskar Stalberg

BUas Games

3.7K subscribers • 1 video on Hallway

YouTube
  • Recommended by 4 people: 4 on Hacker News.
  • A classic. People kept recommending it from 2020 to 2023.
  • Presented by Oskar Stålberg, creator of Townscaper
  • May be out of date. Uploaded 8 years ago, in an area where tools change fast.

Intermediate. Assumes working knowledge.

176K views8 years ago4 recommendations

Game developmentGraphics and audioGame programmingAlgorithms

Oskar Stålberg explains how he implemented the Wave Function Collapse algorithm for procedural island generation in the game Bad North.

Bad North is a procedurally generated strategy game about fighting Vikings. Oskar Stalberg will talk about how the Wave Function Collapse algorithm is employed to magically assemble idyllic island dioramas from handcrafted tilesets. You'll learn about the theory behind WFC, its implementation and further development in Bad North, as well as the tools and pipeline surrounding it. Lastly, Oskar will cover how he approaches the integration of art and tech aesthetically. Everything Procedural is a yearly conference organised by the Games programmes of Breda University of Applied Sciences (BUas). The conference brings together experts and developers in the field of procedural generation and focuses on procedural game content and its application in AAA or innovative games. everythingprocedural.com/ buas.nl/en/programmes/creative-media-and-game-technologies buas.nl/en/programmes/master-game-technology

Why it's here

4 people recommend this

What people say. Highly recommended as a clear and practical explanation of Wave Function Collapse in game development.

btownon Hacker News • Recommends

On “WaveFunctionCollapse: Generates bitmaps that are locally similar to the input”

The creator Oskar Stålberg has a great overview talk of Wave Function Collapse and how he applied it to his previous game Bad North - it’s absolutely worth a watch! link to this video

pdoubon Hacker News • Recommends

On “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: link to this video

btownon Hacker News • Recommends

On “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: link to this video

symmetricsauruson Hacker News • Recommends

On “The Wavefunction Collapse Algorithm explained clearly”

Oskar Stålberg has famously used WFC in Bad North and Townscaper. Here's a nice presentation from him explaining it: link to this video

Cognitronon Hacker News • Recommends

On “CityDreamer: Compositional Generative Model of Unbounded 3D Cities”

Oskar Stålberg has some great talks on YouTube about how the systems in Bad North and Townscaper work. link to this video link link link

bschneon Hacker News • Mentions

On “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" ( link to this video ) - Müller et al, 2006 - "Procedural Modeling of Buildings" ( link )

detaroon Hacker News • Mentions

On “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: link to this video link

hesdeadjimon Hacker News • Mentions

On “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. link to this video

nicoon Hacker News • Mentions

On “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: link to this video

PythagoRascalon Hacker News • Mentions

On “Tiny Glade 'built' its way to >600k sold in a month”

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 this1. You can also find more if you google his name and "wave-function collapse". 1: link to this video