Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Tile Map Feedback

Discussion in '2D Experimental Preview' started by Khena_B, Aug 26, 2016.

  1. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    I'm testing the experimental build and played a bit with the Tile Map editor.

    The first thing i notice is the lack of a proper collision support, Tile Map Collider 2D just doesn't work for complex sprites, what we need is to be able to draw the collision for each sprites on the Tile Map, Tile Map Collider 2D can still be useful for simple blocky sprites but we really need another option.

    Another missing feature is a Tileset support, sometime it's just easier to draw the sprites in a Tileset inside Photoshop, import that and just slice it then paint away.

    Here is a quickly made mockup showing what would be the ideal setup in my opinion, an imported and sliced Tileset with some drawn collision, when painted, each tiles would use that collision

    TilemapMockup.jpg

    And then the result would be something like this, easy to paint with the perfect collision.

    Lastly, a 2D Character Controller would be really appreciated, it's difficult to code from scratch and Rigidbodies don't handle slopes very well.

    Keep up the good work!
     
    Last edited: Apr 1, 2017
  2. Johaness_Reuben

    Johaness_Reuben

    Unity Technologies

    Joined:
    Jan 27, 2016
    Posts:
    253
    Have you tried defining the physics shape for the tiles? - Physics Shape Editor, in the Sprite Editor.
    But thanks for the feedback, I'll try out the case you've highlighted.
     
  3. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    I wasn't aware that we could edit the physics shape, it worked perfectly!

    I'll play a bit more with the Tile Map Editor and see how it feels when level designing then post more feedback.

    Thanks.
     
  4. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    I just found out that a sprite can be set to multiple and be sliced up in the editor, then dragged on to the Tile Map Palette to have each cells loaded, i didn't expect this to work, this is exactly what i was looking for.

    But i'm having issues with the collision, it's a bit tedious to open the sprite in the editor and edit the physics shapes of each individual tiles, it also doesn't seem to work properly, my character hovers high above my sprites.

    Being able to draw polygonal shapes directly on the Tileset as demonstrated in my mockup would make this much quicker.

    Again, keep up the good work, these tools will make Unity a really powerful 2D engine!
     
  5. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    I started painting the sliced up sprite and i'm getting some artifacts between each tiles, i didn't notice it at first because the grid hid it.

     
  6. AssembledVS

    AssembledVS

    Joined:
    Feb 23, 2014
    Posts:
    248
    Those artifacts are most likely due to anti aliasing being enabled. Disable it in Edit -> Project Settings -> Quality.
     
    EurekaOW likes this.
  7. AssembledVS

    AssembledVS

    Joined:
    Feb 23, 2014
    Posts:
    248
    I'm considering the same problem that you are. What I will probably end up doing is having a separate collision tilemap. If you've ever used Tiled and Tiled2Unity, you make your colliders separate from your other tiles.

    Imagine a bunch of half-transparent red boxes and polygons of differing shapes and sizes. They each have their own collision shape and can be used in virtually every area of your map that needs collision. You "paint" them over your actual tilemap in its own collision tilemap, and when you play, you disable the collider tilemap renderer. Objects that need their own collision logic can simply be regular Unity objects with attached colliders.
     
  8. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    Disabling Antialiasing got rid of most of the lines but some remains.

    I haven't used Tiled, i've just recently switched from UE4 since they have abandoned 2D development, i saw a brighter future over on the Unity side, but i'm sure a better solution can be implemented in the Tile Map tool, i hope so, having to paint a separate collision sounds a bit tedious, i'd prefer to stick with Super Tilemap Editor and edit the collision tile by tile which is a pain but works.
     
  9. AssembledVS

    AssembledVS

    Joined:
    Feb 23, 2014
    Posts:
    248
    You can also try disabling anisotropic filtering. Also, when you test, make sure that the screen is a multiple of your reference resolution (if 640 x 360 is your minimum, then 1280 x 720 is the next one up) - these three things make it crisp for me with no lines between tiles.

    I've never heard of Super Tilemap Editor - actually looks quite robust. Maybe the Unity people can also work with its creator!

    Also, maybe you can help me here - how exactly does this "Edit Physics Shape" tool work? I edited the shapes for my tileset, but what does that do? It's doesn't seem to automatically generate colliders or anything and I can't find any documentation for it.
     
  10. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    I think the physics shape needs a Tile Map Collider 2D component to work, try it on a single sprite, it worked for me but doesn't seem to work properly when using a sliced Tileset.

    I already had Anisotropic Textures disabled, I haven't tried it at a set resolution, just in the scene view and i'm still seeing some lines at i move the screen.

    Super Tilemap Editor is a great tool but has unintuitive collision editing for complex Tilesets.
     
    AssembledVS likes this.
  11. AssembledVS

    AssembledVS

    Joined:
    Feb 23, 2014
    Posts:
    248
    Thanks, I'm asking Johaness_Reuben about this Physics Shape Editor in another thread now.

    A tilemap collider on my sprite does not seem to do anything. Perhaps I'll find out soon from the other thread.
     
    Last edited: Aug 28, 2016