subdgtl / WFC

Prototype tools for playing with Wave Function Collapse
The Unlicense
5 stars 1 forks source link

Weighted Rules #31

Open janper opened 1 year ago

janper commented 1 year ago

What about making weighted Rules?

During an observation, a Slot would look at its neighbors and rank the Module placement options based on its neighbors' desires (weights of Rules).

yanchith commented 1 year ago

Could you expand on this? Weighted rules globally? Per-slot? What is it you'd like to achieve here?

In any case, this is so different from how it works today, I'd probably be experimenting with it in a completely new codebase.

janper commented 1 year ago

From the user point of view, Monoceros (and our implementation of WFC) operates on local relations, rather than global ones. Setting a weight of a Module within a Slot is a static top-down approach - the designer needs to know where to place certain Modules. That is quite okay for certain use cases (such as the informed space heatmaps).

That being said, the user cares (and should care) more about local relations, in other words, which module should appear next to another, regardless where is such couple located within the envelope. That may result in different weights of a module not based on the global location but rather on the context around it. It is also very easy to use: "if this, then prefer that".

I'd start with globally weighted Rules, as distributing rule weights throughout the envelope (per-slot) would be too difficult to design (although I can imagine that as well).

Not sure about this WFC core, but MonocerosPro is fairly ready for such feature. Therefore I cannot tell if a new codebase would be needed.