Superpositions, Sudoku, the Wave Function Collapse algorithm.

  Рет қаралды 706,487

Martin Donald

Martin Donald

Күн бұрын

Пікірлер
@tonogram
@tonogram 2 жыл бұрын
With a name like Wave Function Collapse, I was expecting some really advanced mathematics, but this is actually beautifully simple and intuitive.
@aarondewindt
@aarondewindt 2 жыл бұрын
A lot of things in mathematics are beautifully simple and intuitive. It's just that mathematicians are really bad at explaining things. Or to be more exact, they are really good at explaining things to other mathematicians.
@jessiejanson1528
@jessiejanson1528 2 жыл бұрын
i dont know about beautiful, but simple for sure.
@Piotrek7654321
@Piotrek7654321 2 жыл бұрын
Just like the Universe.
@rawallon
@rawallon 2 жыл бұрын
@@Piotrek7654321 i dont know about Universe, but you for sure.
@Piotrek7654321
@Piotrek7654321 2 жыл бұрын
@@rawallon A stranger on the Internet just called me beautiful? Aww, thank you
@morganlak4337
@morganlak4337 3 жыл бұрын
Never thought about comparing it to sudoku, that's such a smart way of describing it!
@m4rt_
@m4rt_ 2 жыл бұрын
I thought of the game carcasone.
@ocaly
@ocaly 2 жыл бұрын
@@m4rt_ 2D representation for something that looks complicated in 3D. Nice!
@lucadeacha
@lucadeacha 2 жыл бұрын
@@ocaly Yes but interestingly, you can also see the sudoku as a 3d problem. You have an X and Y axis, but given that any number from 0 to 9 can be on the same space at the same time you can also represent this as a Z axis.
@ocaly
@ocaly 2 жыл бұрын
@@lucadeacha you could look at it from that way and there are many sudoku variants even using that (f.e. "skyscraper sudokus").
@ocaly
@ocaly 2 жыл бұрын
@@lucadeacha or cubedoku's which is precisely what you're describing. but skyscraper sudokus is more well-known example among the online sudoku peers.
@martinbecker2164
@martinbecker2164 2 жыл бұрын
This is literally the best explanation for how this algorithm works.
@OMGclueless
@OMGclueless 2 жыл бұрын
Well, the explanation is super simple because it completely glosses over/ignores what happens when the constraint propagation fails and you need to backtrack or start over. There is a split second at 12:04 where two big pink exclamation points show a failed propagation -- what to do with that is not explained at all, and in fact is the most difficult part of designing a WFC algorithm that doesn't run for hours or fail 99% of the time.
@martinbecker2164
@martinbecker2164 2 жыл бұрын
@@OMGclueless Well, Ok that's a fair point & I did notice that but didn't quite understand what they meant, but for an explanation on how it generally works, I've found a lot of other explanations to be super complex or not very intuitive, especially when compaired to this explanation.
@kenhaley4
@kenhaley4 2 жыл бұрын
@@OMGclueless Agreed. I was just about to reply with this same question.
@mrmartinwatson1
@mrmartinwatson1 2 жыл бұрын
I see Martin, i like
@kyousouka
@kyousouka 2 жыл бұрын
@@OMGclueless Backtracking is not part of WFC itself and is thus probably just outside this video's scope - the original WFC implementation quits when it encounters a contradiction. Backtracking just happens to be a very helpful addition to WFC :] That said, the fundamentals of backtracking are fairly simple to explain and probably could've been mentioned - you push every collapse and the pre-collapse state onto a stack, and if the collapse causes a contradiction, you pop that collapse and remove that candidate from that cell's candidate list and propagate that. If that removal also causes a contradiction, you pop yet another collapse off the stack, and so on. The difficulty comes from storing the pre-collapse state in such a way that it won't eat all your memory or require recalculating most of the state at each Undo, and that's definitely beyond this video's scope.
@iankaranja7765
@iankaranja7765 4 жыл бұрын
This is one of the most well-presented videos, on a technical subject, that I have ever watched on youtube. Great work, looking forward to more content.
@cohan000
@cohan000 2 жыл бұрын
Normally my brain hurts when I try to grasp new concepts, but that just didn't happen now. You have a way of explaining things making the concepts very easy to understand
@scottcourtney8878
@scottcourtney8878 2 жыл бұрын
Terrific explanation! I recently finished reading "Doors of Eden" (by Adrian Tchaikovsky), a novel in which wave function collapse influences the plot outcome significantly. I'm going to share the link for this video with my wife and a friend who've also recently read the book but who are both humanities scholars rather than techies, because if they simply stop at the beginning of the programming section, they will get an extremely lucid and approachable explanation of the theory. Well done, and thanks for sharing.
@Sergeeeek
@Sergeeeek 2 жыл бұрын
This is super useful for generating levels with a set number of points of interest. You add whatever things you want to have in a level at random points and maybe add roads between them and after that you can make this algorithm do its magic to fill in the details. Very nice!
@jessiejanson1528
@jessiejanson1528 2 жыл бұрын
though it would be different for every user unless you have some way to define what goes where specifically by the coordinate.
@Lumegrin
@Lumegrin 2 жыл бұрын
@@jessiejanson1528 as long as your pseudorandom selection process is consistent then it shouldn't be an issue
@Ziboo30
@Ziboo30 4 жыл бұрын
Best WFC explanation I've watch. Thanks !
@fearian
@fearian 4 жыл бұрын
It really is! And even provides links to all the further reading you want. Great video.
@alejmc
@alejmc 4 жыл бұрын
Agreed. Definitely brings this ‘WFC’ that we have been seeing from the likes of Oskar Stalberg since some years now to humanly possible understandable levels. The Sudoku explanation is quite straightforward to grasp the concept, at least for me. Deserves the patron support hands down.
@persistent-programmer
@persistent-programmer 6 ай бұрын
I could never wrap my mind around Wave Function Collapse until I saw this. Thank you
@noamrtd-g4f
@noamrtd-g4f 7 ай бұрын
Watched more than 3 hours of implementations and explanations about wave function collapse, Can confirm that this one was the best from every aspect, Thank you!.
@3nertia
@3nertia 2 жыл бұрын
That was mind-bending! Really some food for thought! And you've convinced me to take up Sudoku! I really love that you relate Sudoku to wave function collapse in this way! Really helped something *click* in my brain; thank you!
@abraxas2658
@abraxas2658 2 жыл бұрын
This is honestly not only extremely well explained, but also beautiful too
@vast634
@vast634 2 жыл бұрын
The idea to just analyze an example level to determine valid sockets is great. I did not even think about that. Makes it much easier to create complex rules and have the computer imitate the style of a human Level Designer.
@TeamUnpro
@TeamUnpro 2 жыл бұрын
the amount of math and editing required for this video is insanely impressive
@oncedidactic
@oncedidactic 2 жыл бұрын
Nicely presented! I thought you were going to talk about physics but I watched the whole video because this algo idea is so fun, and all the info was a good mix of visual demo and technical details, perfect for morning coffee :D
@luck3949
@luck3949 2 жыл бұрын
If you add recursive backtracking to this algorithm, you'll end up with a classic algorithm for SAT solving, called DPLL. Also, DPLL is very old and outdated, so if your constraints are too complex to find a solution with it, consider taking inspiration from CDCL algorithm, or just use the off the shelf SAT/SMT solver, like Z3.
@sweetcornwhiskey
@sweetcornwhiskey 2 жыл бұрын
I'm working on creating a complex sudoku solver for variant sudoku rules, and my current algorithm that I came up with seems to reduce to DPLL. Do you know of some elementary resources where I could learn some more about CDCL to make my algorithm faster? I got a minor in comp sci, but most of the resources that I've seen are borderline graduate CS level.
@luck3949
@luck3949 2 жыл бұрын
@@sweetcornwhiskey I learned about that algorithms from presentations of Emina Torlak from her Washington University course, you can google that course. Once you get through the notation, that should be understandable.
@luck3949
@luck3949 2 жыл бұрын
@@sweetcornwhiskey CSE 507
@sweetcornwhiskey
@sweetcornwhiskey 2 жыл бұрын
@@luck3949 Thanks!
@notjnsz
@notjnsz 2 жыл бұрын
@@sweetcornwhiskey there's been a SAT competition for the past 20 years: see SAT RACE / SAT COMP. You will find an assortment of different solvers source codes to look at/reference. A lot of the content is dense/state of the art, but the assorted info over the years is probably the best resource for speeding up SAT solving. You might find a PhD dissertation/Survey or two where the "preliminaries" or "background” section explain completely the ideas, reasoning behind it, etc. before jumping into what is likely more difficult.
@thequarkchronicles2486
@thequarkchronicles2486 Жыл бұрын
I’m a nuclear physicist who misread the title & assumed this was about quantum wavefunctuions… don’t think I’ll ever do anything with this information, but got interested & stuck around anyways. Incredibly engaging & high-quality video, & an excellent explanation even for someone who doesn’t do much with algorithms! :)
@technopoptart
@technopoptart Жыл бұрын
heck, you explained wave function collapse so beautifully in just two minutes. i am sticking around for the rest of the video of course but even so i had to compliment you on being so succinct
@cintron3d
@cintron3d 4 жыл бұрын
Wow, this was amazing. So well organized, articulated, and indeed respectful of my time. You sir have earned a sub + bell. Thank you for this I'm sure I'll end up referring back to this one day.
@abdullahx8118
@abdullahx8118 2 жыл бұрын
holy shit this makes it make so much sense, i wouldnt have known this comparison would work so well! Good discovery!
@MujjMujj
@MujjMujj 4 жыл бұрын
Man you're so good! cant believe this channel is so small :O really helped me out with my next project :)
@alexandrupostolache6704
@alexandrupostolache6704 4 жыл бұрын
Excellent video! Thanks for sharing! Also, you are the reason I created a Patreon and you're the first person I'm sponsoring! :) Great job!
@MartinDonald
@MartinDonald 4 жыл бұрын
Thank you so much!
@dameck9570
@dameck9570 2 жыл бұрын
When i saw this title i realized, i have implemented WFC for Sudoku without realizing it. Amazing :)
@Gogglesofkrome
@Gogglesofkrome 2 жыл бұрын
The way you break down the software is perfect for learning key concepts on a functional level. In my eyes, you are the gold standard. You can bet that I will be watching everything you'd ever made over the upcoming days
@RemyDrijkoningen
@RemyDrijkoningen 4 жыл бұрын
This is by far the clearest and most detailed explanation i saw on the subject, thanx a lot ! I was wondering, just like for sudoku, is it possible that the algirithm runs into a dead end by selecting a combination of tiles that doesn't allow a suitable neighbour in some cases? Is there a strategy for the algorithm to backtrack and correct that, or is it better to start over again or carefully craft a tileset that allows every possible combinations?
@MartinDonald
@MartinDonald 4 жыл бұрын
This can absolutely happen. Backtracking is a good option definitely, but I never got around to implementing anything like that. My implementation just starts the whole process again if any cell ends up completely empty of options. Making sure your tileset covers all bases definitely helps avoid contradictions.
@j.j.maverick9252
@j.j.maverick9252 2 жыл бұрын
I was thinking that for each axis we might store a growing list of changes, so more recent changes are at the end. Then we could do a targeted backtrack looking only at the values which directly constrain a given location. I haven’t worked out how that would fit with the required propagation steps yet… it wouldn’t be as clean as a simple backtrack everything (breadth first search) but it feels like it should be hugely faster.
@abraxas2658
@abraxas2658 2 жыл бұрын
@@j.j.maverick9252 If you only remove selected changes, there could be issues where the algorithm would prefer certain patterns of cells to be faaar more used than other patterns. Especially if a constraint is quite old, it would have influenced the choices for a lot of other cells. You could absolutely consider this intended behavior, but a small change in your tiles could cause quite large repercussions on the average outcome.
@jessiejanson1528
@jessiejanson1528 2 жыл бұрын
seems like the best solution is just to solve it in a circular pattern going around the starting point. i cant imagine it would ever get stuck.
@sabata2
@sabata2 2 жыл бұрын
@@jessiejanson1528 It absolutely can get stuck. You're talking about a FIFO Stack (First In First Out) for cell determination which is what this video shows, so long as you are leveraging squares (as in this example) you can run into impossible scenarios. In example, look at your number pad, take 2, 4, 6, and 8 to be South, West, East, and North respectively. You pick a determinate cell for North. You're now acting on East (clockwise), and just like North you have all the same options. Fast forward a bit and now deal with "North East" Your cell now has 2 restrictions applying to it to which you may have contradictory rules (See the example at 5:35). This is just hypothesis at the point of writing this but I suspect that one of three things can help mitigate this: 1) Hexagonal Cylinders (making all surrounding cells directly relate to an immediately previously set cell's face) 2) Writing an algo to parse your "tile set" and make sure you have Tile Sets that fulfil all iterable conditions (so assuming outwards propagation, 2 faces for a 2d square tileset, 3 faces for a 2d hexagon tileset and, atleast 3 faces for a 3d tileset) 3) Making sure no Tile Face Socket exists only twice. (for the same reason as #2, if a face only has one possible match you're significantly more likely to enter a dead end.
@drummerman883
@drummerman883 11 ай бұрын
That was just enough information to be able to write it and not be lost. Thank you for not over or under explaining it like most videos do.
@CodingCircle
@CodingCircle 2 жыл бұрын
Best WFC Explanation never thought of comparing it to Sudoku. Nice Vid!!
@lupin2232
@lupin2232 2 жыл бұрын
v0_0 is how my face looks when looking at the astonishing amount of informative data in this video. Kudos on how well presented this is too!
@evilplantosavetheworld
@evilplantosavetheworld 3 жыл бұрын
I've been reading about wave function collapse for a few days, and four minutes into your video I already understand it better than everything else I've seen combined. Fantastic job
@albingrahn5576
@albingrahn5576 2 жыл бұрын
this is awesome, you explained the concept so well that it just intuitively clicked for me. i feel like the number of tools in my mental toolbox as a programmer has increased after watching this video
@slackstation
@slackstation 3 жыл бұрын
This may be one of the best videos on this topic I've ever seen. Its explanatory power is breathtaking. This just shows the principle so well with so little wasted effort.
@Nightstick24
@Nightstick24 Жыл бұрын
Wow, comparing it to sudoku was smart. That made it so much easier to wrap my head around!
@minleyfox5231
@minleyfox5231 2 жыл бұрын
This is the best explanation video on WFC I have found! Alone with the example at the beginning I could conceptualize the algorithm. great work!
@thinhhb8117
@thinhhb8117 2 жыл бұрын
you're the master of making difficult-to-understand things become much easier ones.
@HighlandHellboy
@HighlandHellboy Жыл бұрын
I’m from the complete other side of the spectrum, I’m a physics student in their penultimate year of their undergraduate and I know and understand superposition and collapsing a wavefunction in quantum mechanics, but have never seen it used for mapping. That’s awesome!
@noxabellus
@noxabellus Жыл бұрын
This is the best wave function collapse video out there. By far. 10/10
@PhilipBlyth
@PhilipBlyth Жыл бұрын
By far the best introduction to and explanation of WFC I've come across...! Thank you for taking the time to make this.
@jashanbhullar3384
@jashanbhullar3384 2 жыл бұрын
I really appreciate the effort you put in to explain what I once thought was a really difficult algorithm to understand. Great Job!
@jessef3462
@jessef3462 2 жыл бұрын
Thank You! This video helped it all make sense! I love your "wax on, wax off" trick about teaching us Wave Function Collapse through sudoku! Right when I'm like wait, I want to learn about Wave Function Collapse, you have already tricked me into learning it! I knew karate the whole time.
@ItsHaldun
@ItsHaldun Жыл бұрын
While the algorithm itself is also really cool, whoever named it "Wave Function Collapse" should pat themselves on the back because that's one of the coolest sounding algorithms ever. For some reason saying "wave function has been collapsed" makes you feel powerful :D
@rosva4331
@rosva4331 2 жыл бұрын
Of all the videos that I watched on wave function collapse, yours is by far the best at explaining it.
@Gdquest
@Gdquest 4 жыл бұрын
Excellent! I'll be eagerly watching your future videos. Are you also using Doom Emacs with the gdscript layer? If you have any suggestions for improvements they're welcome on the repository.
@MartinDonald
@MartinDonald 4 жыл бұрын
I'm actually using pycharm but I can see why you'd think that, the colour schemes are almost identical. I'll definitely look into it though.
@kingsleylangston1959
@kingsleylangston1959 3 жыл бұрын
I guess im asking the wrong place but does anyone know a tool to get back into an Instagram account..? I was stupid lost the password. I would love any tips you can offer me
@kingsleylangston1959
@kingsleylangston1959 3 жыл бұрын
@Sylas Casey i really appreciate your reply. I got to the site on google and I'm trying it out atm. Looks like it's gonna take a while so I will get back to you later when my account password hopefully is recovered.
@kingsleylangston1959
@kingsleylangston1959 3 жыл бұрын
@Sylas Casey it did the trick and I actually got access to my account again. I am so happy! Thank you so much you saved my account !
@sylascasey3828
@sylascasey3828 3 жыл бұрын
@Kingsley Langston no problem :)
@gharren
@gharren Жыл бұрын
Hands down the best explanation for WFC I've ever seen. Kudos!
@asadplatypus3940
@asadplatypus3940 Жыл бұрын
As someone looking to do a wave function collapse implementation the really helped me understand
@xomvoid_akaluchiru_987
@xomvoid_akaluchiru_987 8 ай бұрын
I saw the Bad North inspired island generation in the thumbnail :) Love the game! I can understand why Oskar is so stuck on the idea (He keeps going back to it on Twitter)
@chrisbovington9607
@chrisbovington9607 2 жыл бұрын
This is a great example of how failing to explain some incidental details, which are not relevant to the topic but which have been arbitrarily chosen for illustration, leaves the audience confounded and unable to fully engage with what otherwise seems like a clear explanation of the topic. I mean, what the hell are these tile maps? What am I looking at? What am I supposed to intuit from these images? I don't understand the relation between the various tile images, so I am unable to recognise the patterns that are supposed to be illustrative. Not only does this fail to illustrate the explanation, it confounds it. I can't process the audio while my brain is trying to decode the impossible visual. But the Sudoku was such a perfect illustration that I understood that part instantly. Cheers.
@sabata2
@sabata2 2 жыл бұрын
I believe that description is done at 4:33, but is slightly poor as it doesn't expressly point out the incongruity of the "negative space" the "isn't" tile creates.
@maybenat
@maybenat 3 жыл бұрын
This channel is ridiculously underrated wow
@Darfk
@Darfk 3 жыл бұрын
dude, this video is so good, I've looked at explanations on WFC for ages and this one really made me understand it
@custom_name854
@custom_name854 2 жыл бұрын
Very nice and compact video, makes me want to program my own implementation from scratch. Also, the comparison of the wave function collapse to sudoku was what made it click for me, very well done :)
@itToxic
@itToxic 2 жыл бұрын
Absolutely loved this video, especially love how in the beginning you compared it to something that everyone can understand before going more in-depth.
@PinikRahman
@PinikRahman 4 жыл бұрын
wow.. this is the most amazing explanation ever.. Please Please keep making high quality videos like this.
@sirpaleet9144
@sirpaleet9144 2 жыл бұрын
Our teacher added this as our study material on a course lol. Very informative!
@MartinDonald
@MartinDonald 2 жыл бұрын
This makes me unreasonably proud, thank you for sharing! 🙏
@sirpaleet9144
@sirpaleet9144 2 жыл бұрын
@@MartinDonald You should!
@AntEr3Bu5
@AntEr3Bu5 2 жыл бұрын
good video! haven't found many good channels like this explaining algorithms or CS concepts, have subbed!
@iruns1246
@iruns1246 2 жыл бұрын
Not sure why there's a need for super fancy names for this. Superposition and wave function collapse? It's just constraints, options removal from constraints, and then options picking. It's a great explanation (and I know that the video maker didn't name them) but the naming still baffles me. Has that feeling of how Hollywood and alternative med (mis)use the word "quantum".
@erikm9768
@erikm9768 3 жыл бұрын
marian42 is such a champ for making that repository available for free ;-)
@howardjones543
@howardjones543 2 жыл бұрын
This is the best explanation I've seen for WFC - it's got me thinking about where I can apply it, and I don't write games. I also accidentally watched all your back-catalogue. Pity there aren't more - they're all really well explained!
@g4fly4ever8
@g4fly4ever8 2 жыл бұрын
I entered with no expectations and I didn't even know what are you going to talk about. But i was impressed by the video so to the next video we go
@dotvhs
@dotvhs Жыл бұрын
Holy crap, I just stumbled upon this channel randomly and I'm stunned. Amazing content, thank you for this.
@OodldoodlNoodlesocks
@OodldoodlNoodlesocks 2 жыл бұрын
I have never watched any video related to wave function collapse but youtube really wants me to watch a whole bunch of videos on wave function collapse lately.
@allgreatfictions
@allgreatfictions 2 жыл бұрын
I love that "Usually, a sudoku grid doesn't start off blank". There's some really great puzzles that have been made in the past few years that start with blank grids, and they're amazing. Sure, they've got extra constraints, but it's still sudoku, and it definitely counts.
@qwertyuuytrewq825
@qwertyuuytrewq825 3 жыл бұрын
Wow! Thank you for a great explanation and for mentioning all these references! I realized that when developing something like a tile engine I can avoid making an editor to create test levels (at least at the beginning) and use WFC to generate levels automatically.
@vyzirT09
@vyzirT09 2 жыл бұрын
just got my own implementation working in unity, this video was a massive help!
@SethPentolope
@SethPentolope 7 ай бұрын
As you mentioned, adding weights is important for a more practical usage. You can go a different direction if you really lean into depending on weights. You can have cells that are not adjacent weigh in on what cell type a cell should be. This can help limit behavior like too many house cells or never having a large ocean, since you can have ocean cells make other ocean cells very likely to be chosen if they are nearby or in certain land/ocean patterns. You could even add a property to your ocean cells indicating the depth, which affects the probability of other cells (no land cells within X cells of a X-hundred foot deep ocean cell).
@SkylorBeck
@SkylorBeck Жыл бұрын
Hey thanks for this video. I just spent the better part of my day creating a Tilemap generator using the knowledge gained from this video.
@devwolph3019
@devwolph3019 4 жыл бұрын
Thank you! I'm trying to make my own game featured infinite level generation, This will help me a lot !! Your explanation is so well, even a none English speaker like me can understand :D
@quantumsoul3495
@quantumsoul3495 4 жыл бұрын
I thought it was a 50k subs channel. Those animations are awesome !
@MartinDonald
@MartinDonald 4 жыл бұрын
Don't worry, we'll get there!
@quantumsoul3495
@quantumsoul3495 4 жыл бұрын
@@MartinDonald Nice
@jasperkennis8499
@jasperkennis8499 2 жыл бұрын
First explanation of WFC that I actually understood, thanks!
@azeews1368
@azeews1368 4 жыл бұрын
I'm so glad I found your channel. You really remind me of Sebastian Lague! Your content is phenomenal, I really hope your channel picks up more traction soon. Cheers!
@NathanielWyatt
@NathanielWyatt 2 жыл бұрын
Thanks for this high density video! Beautiful masterpiece, you earned my subscription!
@DariusKazemi
@DariusKazemi 4 жыл бұрын
WOW, this is an incredibly well-made video. You've done such a good job teaching and choosing your metaphors.
@remotestar
@remotestar 4 жыл бұрын
Wow, very well explained! So, the constraints of reality lead to the collapse of wave function.
@EdNieThePianoGuy
@EdNieThePianoGuy 2 жыл бұрын
Explaining wave function theory is usually quite the challenge, but you managed to do it really nicely by using Sudoku! I'm definitely gonna use this analogy next time I find myself talking about quantum mechanics (whenever that happens, haha).
@anothercastle17
@anothercastle17 Жыл бұрын
Very informative, thank you. I’ve been considering implementing wfc in music composition, and this explanation helps me grasp it. Have a pleasant day.
@clockworkkirlia7475
@clockworkkirlia7475 Жыл бұрын
Brilliant, concise, informative and fun! A truly exquisite piece of education.
@willlacey7621
@willlacey7621 2 жыл бұрын
AWESOME video! Thank you so much for the extremely detailed overview of this algorithm! I definitely feel like I have a grasp on how to implement and modify it. Thanks again!
@TheDarkOne629
@TheDarkOne629 Жыл бұрын
Just 50 minutes ago, I accidentally set my sudoku game to the highest difficulty (I usually play on easy). While playing, I thought to myself: "I need to write an algorithm to solve these fucking games for me. I have to read up on previous work first though." And now, just after finally finishing the stupid game, YT suggests this to me. This really weirded me out. Rant over. Nice video! :)
@drtristanbehrens
@drtristanbehrens 4 жыл бұрын
This is so great! The presentation is excellent! Will share on LinkedIn soon.
@JanezKrnc-San
@JanezKrnc-San 2 жыл бұрын
Looked at some of your other videos as well. Brilliant content! Subbed.
@crazydave6787
@crazydave6787 Жыл бұрын
This is a fantastic video. I'm half asleep and still understood what was going on. Going to implement something similar in my next game. Honestly kinda weird that this showed up on my front page 🧐
@alextasarov1341
@alextasarov1341 Жыл бұрын
I spent time trying to find a fast Sudoku solving algorithm, and I never realized that I was using this exact function! Lol
@bilalakil
@bilalakil 4 жыл бұрын
Thank you for the fantastically clear, intuitive, and well-articulated explanation 🙂 Much appreciated ❤️
@MrPooleish
@MrPooleish 2 жыл бұрын
It took me longer than I'd like to admit to realize this wasn't about Thomas Young's double slit experiment.
@folkusonme
@folkusonme 2 жыл бұрын
(honestly I don't think I've pressed subscribe this quickly before) amazing video ♥️
@VictorGordan
@VictorGordan 2 жыл бұрын
Really nice explanation and visuals!
@among-us-99999
@among-us-99999 4 жыл бұрын
Oh damn why didn’t I use that approach at 3:02. every tile containing the whole input... Would have made my approach maybe not more efficient but a lot more elegant Edit: or the sockets... why didn’t i find this video sooner 😭 Edit 2: forget it, every part of this video is brilliant
@evviaccia
@evviaccia 2 жыл бұрын
Thanks Martin, as a Unity developer, It's also useful to me :)
@jefflhama
@jefflhama 4 жыл бұрын
Woah, I'll have to do a tier in your patreon, this is so well explained
@MinecraftEpicPlayer
@MinecraftEpicPlayer 4 жыл бұрын
That explanation of sudoku could be a video all of its own. Very clear and precise! It didn't just explain the rules; it highlighted both how you should play, what you should pay attention to, and why it's the way it is in just two minutes.
@addmix
@addmix 2 жыл бұрын
Really kinda surprised this channel isnt bigger
@romajimamulo
@romajimamulo 2 жыл бұрын
Despite this not being a video on quantum mechanics like I thought, it was still quite enjoyable
@frechjo
@frechjo 4 жыл бұрын
Besides the name, what is it that makes "wave function collapse" different from general constraint propagation? Or is it just a name for a particular way to propagate constraints?
@egodreas
@egodreas 2 жыл бұрын
I was thinking the same thing. I'm quite accustomed to quantum mechanics, so the terminology is perfectly intuitive for me, but I don't see how making this analogy would be all that helpful for the average game developer. Seem like an unnecessary abstraction. I'm guessing the main purpose is to make you sound like you're doing something more clever and complicated than you really are.
@tylisirn
@tylisirn 2 жыл бұрын
@@egodreas It's very possible that it is a reinvention of the wheel with a different name. Game development can be somewhat disconnected from a lot of "traditional" computer science, especially for the more sciency parts of CS.
@michaelrenper796
@michaelrenper796 2 жыл бұрын
The analogy becomes a bit clearer once you add more additional constraints. Entropy (number of allowable states) and coupling constants (weights). E.g. Entropy can be a somewhat non local constraint. Yes, this is all JUST constraint propagation (as all of physical is JUST mathematics) but the analogy is more natural. We don't choose arbitrary constraints, but such constraints that mimic behavior of physical system and by which, by experience, create more "natural looking" results.
@frechjo
@frechjo 2 жыл бұрын
@@michaelrenper796 After making that comment, I went ahead and looked a bit more what this was about. It's as much about constraints, as it is about random generation (if my memory serves me right). I think it makes sense for it to have its own name. Maybe not so much for the way it's done. More for the fact that it's applied with a specific purpose, and thought of as a specific technique for that.
@emilybjoerk
@emilybjoerk 2 жыл бұрын
@@frechjo "constrained level generation" sounds more apt to be
@sabata2
@sabata2 2 жыл бұрын
I guess that's more useful for people looking for coding help from this video instead of people looking for a simplified explanation but... The bulk tileset shown at 8:10 can be reduced *drastically* if your algorithm takes rotation into account. You can see that the 4 closest rows are the same geometry just rotated anywhere between 90 and 270 degrees. Their "Match Sockets" never differ compared to the geometry. You can also include overhangs, and cave-like systems with additional rotational checks in your algorithm. Lastly, you don't need to process these checks over and over again for each tile placement. You only need to iterate over your whole tileset once and store the available mappings (Tile Option + any rotation [axis + degree] required). You can even export this data so that instead of a "running process" it becomes a Constant Configuration Variable and *completely separate* from the rest of the game you're coding. Basically, separating out the "map relational code" into it's own product that is run only when the map tileset is updated. Allowing reuse between game projects.
@jeanahollings
@jeanahollings 2 жыл бұрын
this was brilliant! come back, make more, please!!
@qwsafirkmc9093
@qwsafirkmc9093 2 жыл бұрын
I came out with this algorithm and a friend of mine linked me this video, why are all great ideas already discovered
@KakoriGames
@KakoriGames 2 жыл бұрын
This algorithm reminds me a lot of differential equations, where you are trying to find a function that satisfy a set of rules laid out by the equation, while also satisfying some boundary conditions. In fact, I wonder if a approach similar to differential equations, using some interpolation techniques, can be use to procedurally generate terrain in a way that doesn't use tiles as a alternative to terrains generated by perlin noise. This could also be potentially used to generate non-repeating textures I'd imagine. If you wanted to have more agency over what's generated you could also implement some additional boundary conditions. Maybe set a few tiles from the start (like having all the outer tiles be walls, for instance), or even make that some coordinates are not allowed to be certain tiles. You could for instance force a river to pass through the middle of the level by forcing a river start and a river end to exist in the right and left edges of the screen, while disallowing any tiles too far away from the center from being river tiles and disallowing any other tiles to river ends. Of course, the more complex the boundary conditions, higher the chance of generating a invalid solution, which may introduce some problems if these thing need to be generated on the fly, so applying some backtracking and doing some manual optimizations may be required. This could also be modified to work with a seed, allowing certain levels to be replayed. This could be used in the final product like Minecraft does, or even just for testing purposes. I'm not a game dev, by the way, but I do know a good amount of programming and find game dev topics fascinating.
@peterellisjones1870
@peterellisjones1870 2 жыл бұрын
Very interesting, thanks Martin. An extension to this would be to add a fourth dimension of time and use the algorithm to create valid random transitions along the dimension of time. Examples could be the creation of rivers via erosion, houses decaying, new constructions appearing in empty lots etc. Since the algorithm doesn't care about the direction of the dimension you could do some crazy stuff like simulate erosion _in reverse_, or a decayed destroyed city turning into a beautiful ancient metropolis as time travels backwards.
@Forummaker
@Forummaker 3 жыл бұрын
Thank you for creating quality content that appreciates our time.
@awesomegamedev
@awesomegamedev 3 жыл бұрын
Wow! This is great explanation and video I rarely subscribe after watching just one video, but this one is very good and your other video topics also seem interesting, so this time I did:)
@liam2317
@liam2317 3 жыл бұрын
You did a fantastic job of explaining this concept. Thank you so much!
@yonatanchapal7800
@yonatanchapal7800 2 жыл бұрын
What a great way to explain this! Wonderful video
How to turn a few Numbers into Worlds (Fractal Perlin Noise)
15:24
The Taylor Series
Рет қаралды 197 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
The Beauty of Bézier Curves
24:26
Freya Holmér
Рет қаралды 2 МЛН
I Made a Wave Function Collapse Castle Generator in Godot
25:30
RachelfTech
Рет қаралды 80 М.
A new way to generate worlds (stitched WFC)
10:51
Watt
Рет қаралды 548 М.
Is The Wave Function The Building Block of Reality?
20:16
PBS Space Time
Рет қаралды 1,4 МЛН
Coding Challenge 171: Wave Function Collapse
1:18:37
The Coding Train
Рет қаралды 558 М.
The Problem With Procedural Generation
17:57
Acerola
Рет қаралды 263 М.
It Takes Two, lava lamps, Raymarching in Godot 4.1.
12:42
Martin Donald
Рет қаралды 53 М.
I'm Coding an Entire Physics Engine from Scratch
9:19
Gonkee
Рет қаралды 1,7 МЛН
Do Quantum Wavefunctions Actually Collapse?
11:13
Science Discussed
Рет қаралды 57 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН