| I work with this algorithm quite a bit in a personal project. (I've changed from calling it WFC to Model Synthesis; Paul Merrell earned the naming rights, unless we discover an even earlier description.) I mentally divide it into two important components: 1. Cross-correlation (the 'wave function') 2. Label selection (choosing where the 'collapse' occurs) The "cross-correlation" is exactly what it sounds like - given an incomplete model and a set of example patterns, this data structure represents the cross-correlation of every place that any of the patterns would individually fit in the incomplete model. I think this is the most useful structure in the algorithm, and is a form of iterative 'feature detection' over the incomplete model. I think there are many interesting things which can be done with this which aren't in the basic algorithm, such as: - Having larger indivisible 'patterns' and collapsing such patterns all at once. Although example patterns are always broken down into discrete cells, larger patterns can exist where each cell gets a unique label and very limited transition set. The cross-correlation will detect where they can be placed, and if one is chosen the entire pattern could be chosen at once. - Partial seeding of labels, e.g. selecting portions of the incomplete model and artificially limiting the available labels in that area, without collapsing it. - Addition of information to labels which aren't easily expressed in an example pattern, such as rudimentary counting of distances. The 'label selection' portion (in WFC terms, this is the algorithm used to choose which space to 'collapse') is where all of the random generation comes into play. If using Model Synthesis for full world generation, this is what should be focused on for generating more interesting types of environments. However, given the common label selection algorithms I've seen and used, I think that Model Synthesis excels mostly at adding small-scale, largely self-similar patterns onto constraints provided by a larger structure. I think that other proc-gen methods better lend themselves to generating large-scale structures. A combination of the two - generating a large-scale structure to serve as a constraint, and allowing model synthesis to fill in interesting detail - seems like a good path to explore. |
It seems like you if you had this, you could do some really interesting things with multi-scale collapse. For example, you could first use collapse to lay out biomes (e.g. beach needs to border sea, desert needs to border mountains, etc.) and then use those as constraints for the next scale level, which decides the details within those biomes, and the next level for cities and towns within those environments, etc.