mxgmn / WaveFunctionCollapse

Bitmap & tilemap generation from a single example with the help of ideas from quantum mechanics
Other
23.05k stars 1.23k forks source link

What is the best way to enforce some tiles (simple tiled model) to not be rotated? #86

Open karimdjemai opened 1 year ago

karimdjemai commented 1 year ago

Hi!

I am trying to generate a picture where some tiles may only be in the original rotation. But I still want to be able to define adjecency relations on all 4 sides of those tiles? How is this possible?

When using Symmety "X", it won't rotate, but then I can't define which tiles are allowed to be below or above (I think?).

Is there a way to do this? Are there any workarounds? What would need to be modified in the code for this to work? I might do it, if it is feasable!

Thank you in advance!

mxgmn commented 1 year ago

Hi! I'm afraid my code can't be easily modified to allow this.

  1. The straightforward way would be to write your own SimpleTiledModel constructor (and you only need to modify the constructor, nothing else). For example, in my tilesets only the left/right neighbors can be defined, and up/down are inferred from left/right. But it seems like you want to specify custom up/down neighbors.
  2. A workaround is to allow tile rotations (use any symmetry type but X), but then ban unwanted rotations in code, similar to how I ban unwanted tiles when constraining the ground level.