Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Rule Tile Inverted corners?

Discussion in '2D' started by ewanchurchill, Mar 19, 2020.

  1. ewanchurchill

    ewanchurchill

    Joined:
    Oct 10, 2018
    Posts:
    20
    I'm making a 2D RPG and have just started using rule tiles for my roads however, I cant find a way to add inverted corners and work properly. If someone can help or send me links to YT videos that would be a great help.

    I have attached screen shots as to what I mean the bottom line is without the inverted corners using the rule tile. The top line is manually placing each tile with the inverted corners added.

    Rule tile 1.JPG Rule tile 2.JPG
     
  2. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,039
    @ewanchurchill

    Which ones of the rules you have created are supposed to be for "inverted corners"?
     
  3. ewanchurchill

    ewanchurchill

    Joined:
    Oct 10, 2018
    Posts:
    20
    I haven't yet added the rules for them as i can't figure out the correct set up
     
    Last edited: Mar 19, 2020
  4. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,039
    I don't have a Tilemap project available right now but wouldn't it be something like this:

    For L-shaped corner - tile up, tile right, no tile up right?

    And then there was (IIRC) option to allow pattern match rotate the defined rule, to avoid duplicate rules.

    More specific rules should be first in the list IIRC.
     
  5. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    3,662
    You need to add the tiles that have the inverted corners, then try different rules for them until you find which works best. I kinda remember that you must select the corners themselves and the borders immediately near these corners. It's been a long time I haven't set a rule tile, sorry. :)
     
  6. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    281
    Taking the grey texture as an example:
    • wouldn't the leftmost inverted corner require "This" for down, right, down-right? "NotThis" as the opposite.
    • wouldn't the rightmost inverted corner require "This" for left, down, left-down? "NotThis" as the opposite.
    Both would be listed after the first rule for the "surrounded by This" sprite. I could be a bit off.

    Generally, it's most helpful when constructing these things to draw the different shapes that you want with the tile in a testing scene. My process is to draw (on a test tilemap) all conceivable situations (all corners, surrounded, up down sides, left right sides, etc). At this point, I've typically only drawn a single situation's art (e.g. "surrounded"), so it all appears very wrong. Only once I've done this do I produce most of the art. Then take your best guess at what the rule ought to be (that's what my bullet points above do). Then adjust because sometimes it's tricky because your best guess forgot a "This" or "NotThis" somewhere or added too many. Sometimes at this point I realize I need more art than originally planned if it's something complicated. But because you have all of the different situations down in your test scene, you can see the effect of not only adjusting this or that rule, but reordering the rules because sometimes that's important. Hope that helps.
     
    Last edited: Mar 20, 2020
  7. ewanchurchill

    ewanchurchill

    Joined:
    Oct 10, 2018
    Posts:
    20
    Okay thank you I'll keep trying
     
  8. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,039
    "Okay thank you I'll keep trying"

    I thought you hadn't yet created a rule - so just add this one, and another for T-shape, and see if it works or not.
     
  9. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    535
    Right now, your inverted corners are matching this Rule:

    upload_2020-3-20_11-18-22.png

    You will need to check the diagonals to be able to detect for inverted corners.
     
unityunity