ArticleslgStudy

biology

Model synthesis

Model synthesis is a biology topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Model synthesis rather than just read about it. In short: Model synthesis (also wave function collapse or 'wfc') is a family of constraint-solving algorithms commonly used in procedural generation, especially in the video game industry. Some video games known to have utilized variants of the algorithm include Bad North, Townscaper, and Caves of Qud.

Model synthesis — main illustration
Model synthesis — illustration

Key takeaways

  • Model synthesis belongs to biology; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Model synthesis to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Model synthesis from memory before moving on to harder problems.

Reference excerpt

Model synthesis (also wave function collapse or 'wfc') is a family of constraint-solving algorithms commonly used in procedural generation, especially in the video game industry.

Some video games known to have utilized variants of the algorithm include Bad North, Townscaper, and Caves of Qud. The first example of this type of algorithm was described by Paul Merrell, who termed it 'model synthesis' first in his 2007 i3D paper and also presented at the 2008 SIGGRAPH conference and his 2009 PhD thesis. The name 'wave function collapse' later became the popular name for a variant of that algorithm, after an implementation by Maxim Gumin was published in 2016 on a GitHub repository with that name. Gumin's implementation significantly popularised this style of algorithm, with it becoming widely adopted and adapted by technical artists and game developers over the following years. There were a number of inspirations to Gumin's implementation, including Merrell's PhD dissertation, and convolutional neural network style transfer. The popular name for the algorithm, 'wave function collapse', is from an analogy drawn between the algorithm's method and the concept of superposition and observation in quantum mechanics. Some innovations present in Gumin's implementation included the usage of overlapping patterns, allowing a single image to be used as an input to the algorithm. Some have speculated that the reason Gumin's implementation proved more popular than Merrell's, may have been due to the 'model synthesis' implementation's lower accessibility, its 3D focus, or perhaps the general public's computing constraints at the time. One of the differences between Merrell & Gumin's implementation and 'wave function collapse' lies in the decision of which cell to 'collapse' next. Merrell's implementation uses a scanline approach, whereas Gumin's always selects as next cell the one with the lowest entropy.

Description The WFC or 'model synthesis' algorithm has some variants. Gumin and Merrell's implementations are described below, and other variants are noted:

Gumin's implementation The input bitmap is read, and the patterns present within the bitmap are counted. An array is created with the dimensions of the output desired. Each cell of the array is initialized in an 'unobserved' state The following steps are repeated: The cell with the lowest number of possible output states is located 'Collapse' this cell into one of its possible states according to the rules Check that all cells are still valid and follow the rules Once all cells are 'collapsed' into a definite state, return the output. If the output is illegal, discard it, and repeat the process until legal.

Merrell's implementation Merrell's earlier implementation is substantially the same as Gumin's with some minor differences. (1) In Merrell's version, there is no requirement to select the cell with the lowest number of possible output states for collapse. Instead, a scanline approach is adopted. According to Merrell, this results in a lower failure rate of the model without any negative effect on quality. Some commentators have noted however that the scanline approach to 'collapse' tends to result in directional artifacts. (2) Merrell's approach performs the algorithm in chunks, rather than all-at-once. This approach greatly reduces the failure rate for many large complex models; especially in a 3D space.

Developments In April 2023 Shaad Alaka and Rafael Bidarra of Delft University proposed 'Hierarchical Semantic wave function collapse'. Essentially, the algorithm is modified to work beyond simple, unstructured sets of tiles. Prior to their work, all WFC algorithm variants operated on a flat set of tile choices per cell. Their generalised approach organizes tile-sets into a hierarchy, consisting of abstract nodes called 'meta-tiles', and terminating nodes called 'leaf tiles'. For example, on the first pass, WFC might make a certain tile a meta-tile of 'castle' type; which on a second pass will be collapsed into other tiles based on a rule, e.g. a 'wall' or 'grass' tile.

References

External links https://github.com/mxgmn/WaveFunctionCollapse

Illustrations

Model synthesis: An example texture created using WFC.
An example texture created using WFC.

Worked examples

Example 1 — a first encounter with Model synthesis

Start with the simplest possible case. Write down what Model synthesis claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In biology, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Model synthesis before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Model synthesis ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Model synthesis

In research
Model synthesis appears in biology research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Model synthesis in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Model synthesis is common in secondary-school and first-year university syllabi. It links to neighbouring topics Combinatorial algorithms, Constraint programming, Procedural generation, so understanding it makes those chapters shorter.
In everyday life
Look for Model synthesis outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Model synthesis in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Model synthesis means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Model synthesis out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Model synthesis in simple terms?

Model synthesis (also wave function collapse or 'wfc') is a family of constraint-solving algorithms commonly used in procedural generation, especially in the video game industry. Some video games known to have utilized variants of the algorithm include Bad North, Townscaper, and Caves of Qud.

Why does Model synthesis matter?

Because it connects several biology ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Model synthesis?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Model synthesis.

Tags

  • Combinatorial algorithms
  • Constraint programming
  • Procedural generation

Keep exploring