WaveFunctionCollapse icon indicating copy to clipboard operation
WaveFunctionCollapse copied to clipboard

some issues about the neighbor rule

Open Alex-skiler opened this issue 1 year ago • 3 comments

when I write my neighbor part(in the sample.xml),I found i couldn't define upper or below neighbor rule. As an example, there is 'T',I want 'T' below neighbor a 'I'. How can i do it?

Alex-skiler avatar Oct 05 '24 11:10 Alex-skiler

Indeed, it is only possible to specify left and right neighbors in the xml file. But you still can specify arbitrary adjacencies, because you can rotate the tiles. For example,

<neighbor left="cliff 1" right="road 3"/>

means that the cliff tile rotated 1*90 degrees can be adjacent from the left to the road tile rotated 3*90 degrees. So it is possible to specify vertical adjacencies using tile rotations.

mxgmn avatar Oct 06 '24 22:10 mxgmn

I found these code seem to decide the "upper or below" rules int L = action[firstOccurrence[left[0]]][left.Length == 1 ? 0 : int.Parse(left[1])], D = action[L][1]; int R = action[firstOccurrence[right[0]]][right.Length == 1 ? 0 : int.Parse(right[1])], U = action[R][1]; why the D and U directly use '1' as the second number in the action[][]?

Alex-skiler avatar Oct 07 '24 09:10 Alex-skiler

Because Down and Up correspond to Left and Right by rotating 1*90 degrees.

mxgmn avatar Oct 07 '24 17:10 mxgmn