Superpositions, Sudoku, the Wave Function Collapse algorithm.

764K views · 6 years ago · explainer · evergreen

Martin Donald explains the Wave Function Collapse algorithm, using Sudoku and the idea of superposition to show how it generates tiled content. It is the technique behind procedural maps and images in games like Townscaper.

HN recommends it as the clearest starting point for anyone puzzled by wave function collapse.

“I found them hard to understand until I found this video by Martin Donald”

9 comments from Hacker News

b
@burgerrito2023 · in “Superpositions, Sudoku, the Wave Function Collapse Algorithm (2020) [video]”
Submitted the video to Hacker News.
RecommendsView on HN
a
@anthony_romeo2022 · in “Superpositions, Sudoku, the Wave Function Collapse Algorithm”
Submitted the video to Hacker News.
RecommendsView on HN
c
@caxco932022 · in “Superpositions, Sudoku, the Wave Function Collapse Algorithm (2020) [video]”
Submitted the video to Hacker News.
RecommendsView on HN
V
@V__2022 · in “How Townscaper Works: A Story Four Games in the Making”
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: ▶ this video Now, I'm just looking for a use-case to implement them myself sometime.
RecommendsView on HN
s
@speps2022 · in “Show HN: Simple Wave Function Collapse”
A great explanation of Wave Function Collapse: ▶ this video
RecommendsView on HN
o
@orls2022 · in “Show HN: Simple Wave Function Collapse”
Not OP, but I happened to see a good video on this recently: ▶ this video In short, it’s an algorithm for procedural generation of tiled content, like 2d/3d game maps.
RecommendsView on HN
t
@t8y2021 · in “Townscaper Running in the Browser”
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]▶ this video
RecommendsView on HN
d
@dwd2021 · in “WaveFunctionCollapse: Generates bitmaps that are locally similar to the input”
I would highly recommend this video as a good starter ▶ this video
RecommendsView on HN
I
@ItsMonkk2022 · in “Aaron Swartz: How to Save the World, Part 1”
I was inspired by Nicky Case[0], but independently recently reached the same conclusion as you have here. In March of 2020 when the pandemic was first hitting the US, before there was an official lock-down, and before any company wide announcement, and without any communication, my entire team had come in on a Friday, and my entire team had stayed home on the Monday. In essence, there was enough information that occurred over the weekend for the wave function to collapse[1]. That's what we're after - if you can illuminate the future in such a way that any other option is no longer an option. I've got no game-dev experience, so the journey will be long, but I think we're on the right track. [0]: link [1]: ▶ this video
CitesView on HN