Big confusion time on the algorithm name, like many other I was also coming in expecting this to be some sort of visualization of the concept of wave function collapse from quantum physics: https://en.wikipedia.org/wiki/Wave_function_collapse
Oh, thanks. I clicked on that and saw a patch of grass and some water and was wondering what the heck that had to do with wave function collapse (in the quantum physics sense). Kind of waited to see if there was some animation, maybe some particles would hit the grass or water or something... but it was static.
Hi everyone, I finally got around to implement my version on the wave function collapse algorithm. WFC uses rules to define what tiles can be placed around each other. In order to achieve this rules, I wrote I simple tool that helped me to visualize every tile and all the tiles that can be placed around it (top, right, bottom and left sides).
My code is very simple, I haven't looked at the original WFC code at all, I just "learned" the concepts.
So, first I place a random tile at a random position, from that I grow the map chosing the neighbor with the lowest entropy (smallest number of possible tiles).
May I suggest that you add this comment, and perhaps also some of the links that have been given in these comments, to the readme? Apparently I am not the only person for whom 'wave function collapse' means we're talking about quantum mechanics.
Man I hate that name. It's a Markov chain where the input is the neighbors to the tile being generated. "Wave function collapse" makes it sound like there's something much more complicated going on.
I think the name is the main reason it's gotten as much attention as it has. It's really a basic technique and idea but I'm seeing people all over the place overhype it.
It isn't, its a constraint solver, a closer analogue would be sudoku solving.
The name arises because you start by population all grid squares with all possible tiles, and use the constraints to progressively eliminate tiles until there is only one for each grid square.
Sometimes you need to make a random choice between equally valid tiles, so in a sense you start with a superposition of possible tilings, and reduce to a single one, hence the name.
I did my doctoral work in the area of quantum dynamics, and wavefunction collapse does have a well-known definition and context.
While it might (now) apply to the generation of terrain imagery as well, it's hardly related to the accepted definition and meaning in quantum mechanics.
Perhaps a better title would be "Procedural Terrain Generation."
> I did my doctoral work in the area of quantum dynamics
Then why would you have any understanding of terms of art from outside of that field? I understand the confusion, but there's no need to imply that the OP is objectively wrong just because you don't like that (someone else) named their algorithm wave function collapse.
It's not just about terrain and the original version is seeded with a prototype image that the algorithm learns a pattern from that it then replicates with variations.
It's not described that way but it is a one-shot pattern learning algorithm that is much more interesting than just a procedural generation algorithm, or even a constraint solver as others have said.
See the link to the creator of the original version given by platz in the sister comment. There's more going on than just "procedural terrain generation".
Everyone, I was monitoring this thread a while back and it got no traction. I only now seeing the comments (we really do need a notification system for HN) I'll try to answer them all right now.
This is referring to a Procedural Generation algorithm named the Wave Function Collapse algorithm: https://github.com/mxgmn/WaveFunctionCollapse