Search Unity

Tilemap Palette, needs better ways to populate

Discussion in '2D' started by castor76, Jun 30, 2020.

  1. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    When you drag a whole tiles that are generated by say a sprite sheet, you would generally want to keep the formation in which the original sprites were drawn as. So for example, if you had 32x32 tile in 512x512 map, then you would want to keep 16x16 tiles formations just as if it was drawn originally in palette. But when you drag them into the palette, it creates like 17x16 sets making the tiles to be put in offset to what was originally drawn for. This is very awkward and not very friendly to work with, as you have tried to organize the original sprite so that it is easier to work with.

    My question is,

    1. Why does it do this?
    2. Can this some how be improved so that it tries to keep the original formation?

    Putting the tile one by one in palette is just not an option.
     
  2. JoshWindsor

    JoshWindsor

    Joined:
    Jun 2, 2018
    Posts:
    24
    Try setting a custom size when slicing the tileset in the sprite editor. Perhaps its set to automatic which isn't correcting selecting the tile sizes.

    upload_2020-6-30_12-52-15.png

    Good luck!
     
  3. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Unfortunately, this is not the case, I am slicing the sprite correctly. I can even see all the tiles in the palette, it is just that their formation is just not good. I cant understand the logic behind how and why Unity place them like this way.
     
  4. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    1. This is likely a bug. I can confirm that it creates a 17x16 layout when dragging in a group of Sprites, even though there are exactly enough Sprites to fill in a 16x16 space.
    2. Ideally, you should drag in the Texture containing all the Sprites. This will keep the 16x16 layout as set in the texture. When dragging in a group of Sprites, they may not all come from the same Texture, so it is difficult to keep the layout when they do not share one.

    This was tested with Unity 2019.4. Could you check if you have the right layout when you drag in the Texture asset instead of the individual Sprites? Thanks!
     
  5. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Right, so dragging texture asset does indeed work as expected. This is some what not very clear that you need to do this, because when you drag the texture for the first time, you will need to split them, and after splitting them, I thought dragging individual sprites split into the palette in order to create the tile assets. After creating tile assets I thought dragging them into the palette is going to work. Never thought about dragging the texture asset, because well, it is texture... not sprite. (because I thought in order to create tile assets I need to drag the sprite , not texture)

    I think many of us are confused at this. If this information is not documented, then it should be. I don't know if it has already and I didn't know about it...

    thanks.
     
  6. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Also even if tile assets were dragged in, if it seems like it can do exactly 16x16 or so, then it should try default to fit that instead of doing weird 17x16. Defaulting to 17x16 when it can do 16x16 exact is just beyond anyone's understanding....
     
  7. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    I agree. This will be fixed! In the meantime, the workaround would be to drag the Texture asset in.
     
    castor76 likes this.