Рет қаралды 521,929
Straight out of quantum mechanics, Wave Function Collapse is an algorithm for procedural generation of images. In this video (recorded over 3 live streams) I attempt the tiled model and explore a variety of solutions to the algorithm in JavaScript with p5.js. Also, check out WFC's predecessor: Model Synthesis (more info below). Code: thecodingtrain.com/challenges...
🚀 Watch this video ad-free on Nebula nebula.tv/videos/codingtrain-...
💻 Github Repo: github.com/CodingTrain/Wave-F...
🕹️ p5.js Web Editor Sketch: editor.p5js.org/codingtrain/s...
🎥 Previous: • Coding Challenge 170: ...
🎥 Next: • Coding Challenge 172: ...
🎥 All: • Coding Challenges
References:
💡 WFC Challenge Suggestion: github.com/CodingTrain/Sugges...
🗄 Wave Function Collapse Algorithm: github.com/mxgmn/WaveFunction...
🗄 Model Synthesis: paulmerrell.org/model-synthesis/
📣 Wave Collapse Function algorithm in Processing: discourse.processing.org/t/wa...
🗄 Array.prototype.filter(): developer.mozilla.org/en-US/d...
🐞 Encoding tiles symmetry and rotation #14: github.com/CodingTrain/Wave-F...
🐞 The issue with asymmetric tiles and an easy solution #16: github.com/CodingTrain/Wave-F...
🗄 Array.prototype.reverse(): developer.mozilla.org/en-US/d...
Creative Works Featured:
🎨 Oisín: Wave Function Collapse for poetry: github.com/mewo2/oisin
🎨 Townscaper: www.townscapergame.com/
🎨 unity-wave-function-collapse: selfsame.itch.io/unitywfc
🎨 Zelda WFC: observablehq.com/@makio135/ze...
🎨 Wave Function Collapse Demonstration: oskarstalberg.com/game/wave/w...
🎨 Infinite procedurally generated city: marian42.de/article/wfc/
🎨 Generating stairy scenes: exutumno/status/8...
Live Stream Archives:
🔴 Day 1: • Wave Function Collapse...
🔴 Day 2: • Wave Function Collapse...
🔴 Day 3: • Wave Function Collapse...
Videos:
🎥 Solving Wordle with Information Theory: • Solving Wordle using i...
🎥 Pixel Array: • 11.3: The Pixel Array ...
🎥 Arrow Function: • 16.3: ES6 Arrow Functi...
🎥 Higher Order Array Functions: • 16.5: Higher Order Fun...
🚂 Matrix Transformations: thecodingtrain.com/tracks/tra...
🎥 Oskar Stalberg - Wave Function Collapse in Bad North: • EPC2018 - Oskar Stalbe...
Related Coding Challenges:
🚂 10 Maze Generator: • Coding Challenge #10.1...
🚂 162 Self Avoiding Walk: • Coding Challenge 162: ...
🚂 165 Slide Puzzle: • Coding Challenge 165: ...
Timestamps:
0:00 Day 1! Wave Function Collapse!
2:00 Entropy in Sudoku.
5:41 Comparing Sudoku to WFC
9:24 Starting to code.
11:05 Collapsing cells.
13:30 Evaluating entropy.
18:47 Updating entropy after collapse.
22:45 Data structure for rules.
24:50 Implementing rules for next collapse.
36:28 Explaining the rules.
38:45 Day 2! Refactoring the code.
39:26 Create a Tile class
44:57 Generate the rules from Tile objects.
55:40 Using new circuit board tileset.
1:00:40 Day 3! Dealing with asymmetrical tiles
1:01:56 Assigning index values to edges.
1:06:53 Incorporating edges into code.
1:10:05 Change adjacency for assymetry
1:12:06 First assymetric WFC image!
1:12:40 Restart if no valid cell found.
1:15:48 Next steps!
1:18:05 Thanks for watching!
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
🚂 Website: thecodingtrain.com/
👾 Share Your Creation! thecodingtrain.com/guides/pas...
🚩 Suggest Topics: github.com/CodingTrain/Sugges...
💡 GitHub: github.com/CodingTrain
💬 Discord: thecodingtrain.com/discord
💖 Membership: kzbin.infojoin
🛒 Store: standard.tv/codingtrain
🖋️ Twitter: / thecodingtrain
📸 Instagram: / the.coding.train
🎥 Coding Challenges: • Coding Challenges
🎥 Intro to Programming: • Start learning here!
🔗 p5.js: p5js.org
🔗 p5.js Web Editor: editor.p5js.org/
🔗 Processing: processing.org
📄 Code of Conduct: github.com/CodingTrain/Code-o...
This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecod...
#wavefunctioncollapse #generativeart #p5js #javascript