Closed TwistedPorkchop closed 8 months ago
Hi. I didn't test this addon with isometric tiles (and don't have any significant experience working with isometric tiles in general). But I can assume that tileset layout is the issue here. If I get it right, then by default coordinate axes in isometric tilemaps are aligned with X and Y axes. So, when WFC looks for neighbours of a cell in map it will look at cells below/above it or to left/right of it. To work properly it should look at cells that share an edge with current cells. Try using a tileset with "diamond" layout. In this casee coordinate axes will be aligned along cell edges. But generated regions will also have a diamond shape.
if I place a tile by itself on the negative sample example will that be understood that that tile should never be placed, or will it understand that I mean to say that that tile should never be alone?
A single tile will be just ignored. The algorithm looks at combinations of tiles in negative sample.
Also, negative sample is ignored when complete_matrices
is set to false
, since it is meant to remove combinations introduced by that "completions".
Thank you for your answer, I will try and use the diamond layout instead and see if there is an improvement.
I have a couple more questions about the Negative tile sets. I believe I understand that the WFC generator takes into consideration directionality. As in combination, AB and BA are different, is that correct? Also on that topic, in a 2d example if I put the combination AB or ABA in the negative sample would the combination of
A A
B or B
A
Be considered a possible correct combination, or would the generator infer that as something not to generate? Basically I'm wondering how much I have to spoon feed the generator with possible "illegal" shapes for it not to generate. Like if I don't want to see a T formation of tiles do I have to draw all the orientations in the negative sample? Also how can we avoid tiles being by themselves or in a X pattern? like:
ABB
BAB
BBA
Do I have to draw those in the negative as well?
As in combination, AB and BA are different, is that correct?
Yes, that's indeed correct.
Also how can we avoid tiles being by themselves or in a X pattern?
The generator looks at pairs of cells and its neighbours, one pair at once and checks what tiles are allowed by tiles that cell's neighbour may have.
So it's not possible to add rules like "tile A should have at least one neighbour of type A" (if I got you right, that's what you mean by "avoid tiles being by themselves") without some complicated rules customization. Same goes for patterns like
A*A
*A*
A*A
and alike. It's possible to forbid
A*
*A
by adding additional axes (assuming standard axes are horizontal and vertical). But that will also forbid patterns like
AA
AA
It seems to me that wave function collapse algorithm may be not what you really need for your project. Wave function collapse works well when you need to enforce some very local rules to make tiles fit their neighbours. You are trying to generate some global structure consisting of lots of tiles. Rules for such structures will be difficult (if possible at all) to implement using WFC. It may make more sense to use a different algorithm to generate a global structure. And then, maybe, use WFC to decide on specific tiles to use. For example, if there are multiple building part tiles to combine them into consistent buildings. But that step may be unnecessary, depending on your actual tileset.
Hello, I've just started a project and was really curious on using your WFC generator to help generate my isometric world map. I was reading through another Docs request about good samples, and I'm trying to understand exactly how to make good Positive samples and Good negative samples. Currently, I am trying to generate a city scape using the WFC, but the generator seems to generate a lot of combinations that were either not given in the positive sample or it would generate combinations that were normally regarded as bad from the negative sample.
It would be useful to have some visual examples of how the generation logic is supposed to function so that we can work around it. For example, if I place a tile by itself on the negative sample example will that be understood that that tile should never be placed, or will it understand that I mean to say that that tile should never be alone? As in, it should always have at least 1 neighbouring tile.
Here I have what I'm using currently, and I have complete matrices = false added to the base code.
In case you want some context on the blocks, they're just for visual reference I know it looks nothing like a city lol But the tiles should represent: grey = exterior tiles, black = road tiles, green = wall tiles, red = interior tiles, orange = door tiles, blue = end of road tiles
Prositive Sample Negative Sample Result (Long Road is prebuilt by me)