Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Wave Function Collapse

Coding Train via YouTube

Overview

Dive into the fascinating world of procedural generation with this comprehensive video tutorial on the Wave Function Collapse algorithm. Learn how to implement this quantum mechanics-inspired technique for creating complex, rule-based patterns in JavaScript using p5.js. Follow along as the instructor breaks down the algorithm, starting with basic concepts like entropy and progressing to more advanced topics such as handling asymmetrical tiles. Explore practical applications, refactor code for efficiency, and gain insights into solving common challenges. By the end of this 1-hour 19-minute session, you'll have a solid understanding of Wave Function Collapse and be ready to apply it to your own creative coding projects.

Syllabus

Day 1! Wave Function Collapse!.
Entropy in Sudoku..
Comparing Sudoku to WFC.
Starting to code..
Collapsing cells..
Evaluating entropy..
Updating entropy after collapse..
Data structure for rules..
Implementing rules for next collapse..
Explaining the rules..
Day 2! Refactoring the code..
Create a Tile class.
Generate the rules from Tile objects..
Using new circuit board tileset..
Day 3! Dealing with asymmetrical tiles.
Assigning index values to edges..
Incorporating edges into code..
Change adjacency for assymetry.
First assymetric WFC image!.
Restart if no valid cell found..
Next steps!.
Thanks for watching!.

Taught by

The Coding Train

Reviews

Start your review of Wave Function Collapse

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.