-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Docs] How to make a good sample? #6
Comments
That's indeed a worth thing to document. We can start by collecting some of specific questions users have, so let's keep them in tis issue for now. I will try to answer questions here and will collect them into a dedicated document later. How add ground tiles? When there is a single type of "ground" tiles (let's call it
to add a second tile type
The algorithm will be able to infer that combinations like
are also valid - but only if
When there are more interchangable cell types and
I'm not sure, what does it mean, what you're trying to achieve in this case. |
Thanks, I learned a lot with this answer 👍 By multiple kind of biomes, I mean more something like, being able to make it learn every possible transition but also the ones that cannot exist, alongside with making the solver learn that for instance, a grass patch must be at least X tiles by X tiles for consistency. I've also been trying to create global rules (like no more than X times a given tile for instance) and I feel like having more explanations on how to implement a proper problem would be nice. Extending |
I don't quite get what this means, but seems like this may be related to how learns possible tile combinations. The algorithm may learn some combinations that are not represented in the sample. For example, when there are cells However, sometimes, the algorithm may lern some combinations that aren't really valid or just don't look right aesthetically. In such cases, there are two possible ways to resolve this:
I'm afraid, that won't be possible with standard rules. When deciding, what tile can be placed in given cell, the solver looks only at limited number of other cells - by default it's neighbours along X and Y axes, but it can be changed using
That's a complicated topic, and Also I did leave a description of an alternative approach that may replace global constraints there - you can limit what tiles are placed in some cells before WFC starts. In fact, there is a more flexible version of that approach available in another branch, see WFC2DPrecondition. It allows user to define custom initial constraints in a more flexible way than strictly setting what tile should be placed at given coordinates. There is currently a dungeon generator that has customizable settings of what tiles are considered walls and roads. Generating different biomes may be another use case for preconditions - user may create few subsets of tiles for different biomes and precondition will use value of a noise texture to choose which biome each cell belongs to. |
I feel like all this boils down to two issues (no offence, I'm trying to find good ways to help with the lib because I love it ^^):
|
I'd say that the issue is rather lack of proper API/extension points for some kinds of modifications. The fact that the code is decomposed the way that solver does not depend on specific kind of problem shouldn't be an issue itself.
Licence of that specific tile set does not allow redistribution. So if we use it in examples (examples are distributed along with the addon), everyone who wants to check them out will have to pay for their own copy of a tileset. This doesn't sound like a good idea to me 😆. But that may be just a misinterpretation of the license. Anyway, I'd prefer to not mess with any proprietary assets. However, it totally makes sense to use a larger tileset - both to test and show how the addon works at larger scale and to test and show future feature with biome preconditions.
Perhaps, a textual documentation will be enough for that. Since we're collecting Q&A here: Why some rules stop the generator from using multiple threads or make it produce invalid results? When deciding to use multithreading or not, the solver uses parameter of rule set named influence range. Influence range is the minimal distance from a cell at which change of it's domain (i.e. set of tiles that can be placed in a cell) never changes domains of other cells. Example of influence range computation in 1-d caseLet's consider the following single-dimensional example:
To compute influence range, the algorithm will consider every tile:
Then the same is done for right-to-left direction 'cause result for some rule sets may be different in different directions. But in this example it's still 2. The final influence range for this rule set is also 2. The generator uses approximated influence range value to decide how to split work among multiple threads: the lower the influence range is - the smaller chunks and the more threads will be efficiently used.
Infinite influence rangeA minimal example of a rule set with infinite influence range would be one with two tile types Another example is set of rules that allows combinations A more trivial example is set of rules with combinations
nothing can be placed on top or to the left from tile
When using
will be printed, along with full rule matrices. In cases when algorithm could detect infinite influence range, at least one of numbers will be 2147483647. Undetectable infinite influence rangeCurrent implementation can not detect influence of a tile if it is not propagated directly along one axis. For example let's consider a set of rules with floor tiles
With these rules, when Best solution in situations like this would be to have dead-end tiles (e.g. |
After using the addon I feel like I'm still struggling with the same thing: creating a proper sample.
Trying to imitate the one in the example scene will quickly hit limits, like when you have multiple types of ground tiles or you want to create different kind of biomes.
I feel like this might be a nice priority to have for the docs, feel free to close if that's not the case tho.
The text was updated successfully, but these errors were encountered: