Coding Challenge 171: Wave Function Collapse

preview_player
Показать описание


References:

Creative Works Featured:

Live Stream Archives:

Videos:

Related Coding Challenges:

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 asymmetry
1:12:06 First asymmetric 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

#wavefunctioncollapse #generativeart #p5js #javascript
Рекомендации по теме
Комментарии
Автор

you are truly the bob ross of programming, respect to you sir!

natyacodes
Автор

I love your newer editing so much! You've always been about making programming fun, entertaining, and accessible, so the editing is just another axis in which you express your vibrant character :)

hydra
Автор

I loved the bit at 18:14. "We're not that far away (i think) from the end here." I laughed out loud. It's been awhile since I've caught one of your videos, but the quality has only gone up. Really interesting topic too!

RaccoonEatingCacti
Автор

As a professional software developer, I can attest that the montage with the ever-increasing error counter and holding your head in your hands is very true to life.

bradb
Автор

I've also had a few failed attempts at the WFC algorithm, you've made me very excited to try again! You're an inspiration as always!

BarneyCodes
Автор

All the issues in coding this that you went through, I also went through. Its so funny to watch the same struggles come up. But you actually solved it all and I didn't . True inspiration!

SpicyMelonYT
Автор

I was watching your videos when I was a dog walker 2 months into comprehending javascript. Now it's been like 4-5 years and I'm a web dev on salary and I'm still watching your videos. Thanks for everything.

noxid
Автор

I like using bitmasks for handling binary connections 1111 becomes 15, 1110 is 14, 0111 is 7 etc 0000 is 0. These four sides create a single 4 bit number, 0-15, which covers every possible arrangement of connections on four directions. You can then simply assign your tiles their array index based on what their connections are. Blank will always be index 0 because it has 0000 connections. You ca extend it further to handle diagonals and it becomes a 0-255 number, 8 bits, a standard format, and still handles all possible types of connections.
You can extend it all the way to 32 directions this way and still use a standard int to hold the value, but I find 8 (one byte) is usually plenty for most tile based things.

Its once you start dealing with weird shaped and inconsistently sized things, like maybe rooms in a floorplan, that's where you run into... logical issues. I don't have a good solution to that which is one reason I'm here now! Maybe I'll find some insight.

sciverzero
Автор

It's worth mentioning that this algorithm is based on and nearly the same as the Model Synthesis algorithm published nearly a decade earlier in 2007.

ItsJustAstronomical
Автор

This trailer was so good!

I kinda want to watch a Coding Train movie now. 👀

Deanin
Автор

This is so weird but this video wants me to have a kid and go through coding challenges with them like this. It just seems like such a unique bonding experience.

alecgolas
Автор

This was amazing. I was thinking that this could be applied to tile games like Carcassone, where the edges are field, path or city, to create random boards. Amazing video!

MiguelArconadaManteca
Автор

That video was epic! Loved your persistence, the explanation and the editing. Funny, entertaining and I learned all sort of things about coding

andradegilmar
Автор

I wish there were videos like yours for C#. I find myself consistently watching your videos and I'm not even learning Java!! Your enthusiasm and energy are unrivalled!

burgl
Автор

A continuation of this concept would be amazing. Actually a whole series would be even better but no pressure!

SpicyMelonYT
Автор

Once I saw your original video on this I decided to make it and it is so crazy how I literally had all of the exact same problems and same reactions to them.

lucianchauvin
Автор

I never thought live(ish) coding could be entertaining and informative. You are amazing, nothing feels contrived and the editing is spot on. Really great presentation of your ideas and process. This isn't even some trivial subject matter which makes it all the more impressive. Bravo!

Jaegerminor
Автор

I can't say I have ever seen someone bring so much enthusiasm to a discussion about entropy, and I love that energy!

draeath
Автор

Thanks for making coding fun! Whenever I watch your videos I get motivated. Your positivity towards the code truly is inspirational.

DemisM
Автор

no matter what cool new idea i want to try, there is ALWAYS a coding train video. LOVE that I finally caught something relatively new.. THANK YOU LOVE YOU FOREVER

carmenhull