Help with 2d-Extras Tile Rule

Hello. I am new to Unity and just started trying to figure out the 2-D extras package (I’m using Unity 2020). I would like to create a Tile rule but I am having a hard time figuring out the rules for how to order the tiles and assign their rules. My tiles look like this:
6653671--760240--upload_2020-12-23_12-28-14.png

I would like to create a rule tile that would allow me to click and drag to create a room. In my brush editor, I added all 9 tiles but I cannot figure out how to order them so they create the right shape. Here is the rules I defined:

And this is the output:

6653671--760258--upload_2020-12-23_12-43-16.png

I’ve tried different combinations but nothing that ends up looking right. I don’t know if I’m using the wrong kind of tiles? Or i just don’t understand how to set up the rules? Or both? Anyone have experience with this who can advise?

Try putting the more complex rules at the top and the least complex rules at the bottom. That usually works most of the time and you can tweak from there for special cases. In case it’s not clear, by “complex” I mean “having a large # of neighbors with arrow or X.”

Also several of your rules could be improved. Unless dealing with a special case, normally it’s best to define a rule by an arrow rather than an X. For example, your final-listed corner piece should be defined by having neighbors (arrow) up, up-right, and right. That’s basically an inversion of how its defined right now. Use Xs when arrows alone won’t work.

Thank you. Is there documentation on how rules and the X’s and Arrows work? What I have found is sparse.

Here ya go! :slight_smile: 2d-extras/Documentation~/RuleTile.md at master · Unity-Technologies/2d-extras · GitHub

1 Like

thank you!

@DreamDelerium

I wonder if you did a search in YouTube.

Unity has at least one or two official rule tile tutorial videos…

Yikes. That got dark fast. But, the video Eses posted really wasn’t helpful. I did watch the video before posting and it is too high level to address the specifics of how to use the rules to create the rule tile set.

try this logic

btw, with your 9 tiles you cannot create any other shape than a rectangle

if you try to do curves it wont work because you dont have curved tiles

Thanks for this. Yes, I recognized I would also need corner pieces, so I have been trying to figure out those rules, and that’s where I’m stuck at now. I added these images. Would I need to add any other?
6675238--764629--upload_2020-12-31_11-20-17.png

6675238--764626--upload_2020-12-31_11-19-6.png

yes u need these 3 extra

6675343--764641--upload_2020-12-31_11-19-6.png

This is what I ended up with. I think it works. I have seen any issues yet. But, I wanted to post back here, in case anyone finds it helpful. Thank you for your help raarc and lorenzo!

@DreamDelerium

“But, the video Eses posted really wasn’t helpful”

I fail to grasp what part was unclear for you in that video I posted…

2:15 → shows how you can set the rules and what x and direction arrows mean… and they also mention that you can order the rules by moving them up and down in list.