Search Unity

Best solution for Tilemaps

Discussion in '2D' started by SleepyDevil, Mar 28, 2016.

  1. SleepyDevil

    SleepyDevil

    Joined:
    Aug 5, 2013
    Posts:
    30
    Hello Internet,

    i am currently working on a 2D-game with top-down-view.
    I started to create my tilemaps through single gameobjects and came to the conclusion that this can´t be the way to go.
    I have considered Tiled + Tiled2Unity or the 2DToolkit for my maps.
    My problem is that I don´t know what would be the easiest to make them work with unitys new 2D features.
    I can´t just wait for the new features to come out if i don´t know when they will be realesed.

    To rework everything I made till then seems to be a lot of unnecessary work.

    Can anyone help me to choose what would be the best solution for my current situation?
     
  2. der_r

    der_r

    Joined:
    Mar 30, 2014
    Posts:
    259
    There are many solutions that are "okay" to "nice", including the ones you mentioned. I'm personally using Tiled2Unity a lot now and writing my own game-specific importers that Tiled2Unity runs automatically.

    But there isn't a perfect solution that works the Unity-way yet. There used to be a Unity team working on a native Tilemap solution, but that team has gone completely quiet ( https://bitbucket.org/Unity-Technologies/2ddemos/wiki/Home ).
     
  3. JayJennings

    JayJennings

    Joined:
    Jun 24, 2013
    Posts:
    184
    Basically, use something that works now, because waiting until Unity introduces their tiling solution may mean you wait for months and months. I've been using SpriteTile for a project and it works pretty well (for my needs). You can import Tiled maps, although it's a 1-way trip -- you can't go back and forth between the two.

    Even if Unity comes out with their solution next week I'll stick with SpriteTile for the current project -- but new projects will probably use whatever is native to Unity. (Bad news for the guys who make tiling utilities.)

    Jay
     
  4. SleepyDevil

    SleepyDevil

    Joined:
    Aug 5, 2013
    Posts:
    30
    First off i´d like to thank you for the fast replys.
    I think i have to settle for Tiled+Tiled2Unity. After looking trough 2DToolkit´s features it seems like total overkill for my needs. SpriteTile look fantastic, I dont like it how it exports maps to some weird SpriteTile-fileformat, with .tmx maps i think there will be a small chance to integrate them into future Unity versions. ( 5.5 maybe...? *wink* )

    Besides being a third-party-tool, the only thing that really bothers me about Tiled2Unity is how i am bound to this filestructure. I will have a whole bunch of different maps. And in the end i am gonna have a single "Textures"-folder with thousands of sprites insides. ( I dont see a way to have different folders for different maps and still have everything automated.)
     
  5. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    Tile Tool 2D
    https://www.assetstore.unity3d.com/en/#!/content/51590

    I cannot recommend it enough. We're using it for an in-production game.

    It's future proof too. So if Unity ever do release a tilemapper, you'll be good. It draws your tiles as prefabs, then even if you delete the entire plugin, you retain your maps.

    TMX is good for huge maps, but I haven't found any plugin that will work with Unity natively (build sprites and prefabs as tiles then - go away - VS a drawcall optimised mesh or custom object, which is not always what you want) and at the end of the day the most important thing is future proofing yourself, not relying on some plugin to stick around or keep up to date with Unity.

    I can't vouch for spritetile but seems good. I would be weary of it's custom editor though, as you will be locked in.
     
    Last edited: Mar 29, 2016
    der_r likes this.
  6. der_r

    der_r

    Joined:
    Mar 30, 2014
    Posts:
    259
    That's interesting, I haven't heard of this one before. How does it handle colliders? Does each prefab get its own collision box or does it generate a map collider like Tiled2Unity? Still looking for a nice tile map solution myself.

    Also, after writing my post yesterday I looked around Twitter and it seems the 2D team is on it again, which is great. :) https://twitter.com/JuhaKiili/status/707595304460296192
     
    rraallvv likes this.
  7. SleepyDevil

    SleepyDevil

    Joined:
    Aug 5, 2013
    Posts:
    30
    I have to say , Tile Tool 2D does seem like an interesting solution.
    I´d also love to hear some more in-depth feedback on this. :)

    Glad to hear that, altough i would still love to hear some feedback if we can hope for some sweet 2D features for Unity 5.5, or if we have to wait till 2017. I think it is kind of awkward so few people even noticed that the new 2D features got delayed, the Unity 2D crowd isn´t very demanding i guess. :confused:
     
  8. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    Currently it works by generating one collider per tile, this is so it can dynamically choose the right tiles based on your shape. I wrote a custom script that takes all the colliders and merges them, I'd put it on GitHub but it's pretty dumb script and doesn't account for boolean shapes.

    This can also be turned off, be switched to turn off at run time or use a custom collider from any attached prefab.

    2DToolKit generates a collider, but it's a edge collider only! Which is fine if you're using raycasting for collision. I'm not so I wrote a script that will convert that output to polygon colliders: https://github.com/HawkenKing/Edge-collider2D-to-Polygon-collider-2D

    If you're interested in anything specific, I'd sure the guys from Unluck-software would be happy to answer. https://twitter.com/unlucksoftware
     
    Last edited: Apr 7, 2016
    eses likes this.
  9. Seanba

    Seanba

    Joined:
    Nov 17, 2012
    Posts:
    33
    Hi SleepyDevil, if the textures you reference in Tiled are already in your Unity project (in some folder outside of Tiled2Unity) then they will not be copied into the Tiled2Unity/Textures folder. In other words, the exporter will respect the folder placement you are already using.
     
  10. datahead8888

    datahead8888

    Joined:
    Nov 5, 2015
    Posts:
    55
    I chose Tiled2Unity because it works through conversion scripts (and can be extended with additional import scripts that implement an interface). This could potentially let you convert everything you did in Tiled to any new 2D features Unity introduces, which is important, as I've heard Unity is going to add tile map support.

    Where did you hear 2D features were delayed? I would like to learn more about this.
     
  11. awang

    awang

    Joined:
    Jul 11, 2013
    Posts:
    13
    Does "Tile Tool 2D" based on sprite renderer per tile?
    I'm afraid that too many gameobjects and sprites will cause the performace issue.
    And does it contain source code ?
     
    Last edited: Jun 20, 2016
  12. SleepyDevil

    SleepyDevil

    Joined:
    Aug 5, 2013
    Posts:
    30
    With TileTool2D you will have individual game objects for every tile.
    I am using TileTool2D and that was exactly my problem, BUT after writing with one of the dev´s of unluck software, he implemented a feature to combine all of your tiles into one big mesh, which gives a huge performance boost and gets rid of my biggest issue I had so far wih TileTool2D.

    I can only recommend TileTool2D now! Works great, it is easy to implement and the support is amazing!
     
    awang likes this.
  13. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    I was having this exact same problem recently, is it in a custom version? I could use this.
     
  14. larrydevs

    larrydevs

    Joined:
    Jun 7, 2015
    Posts:
    5
    Bump! Interested in hearing the same.
     
  15. rraallvv

    rraallvv

    Joined:
    Jul 30, 2013
    Posts:
    16
    Hi @der_r,

    Do you know of any official channels to keep track of those 2d experimental features? I have Unity 5.5.0b1, is it already supported in this version?

    Regards.
     
    Last edited: Sep 7, 2016
  16. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    There's a whole subforum for it here: https://forum.unity3d.com/forums/2d-experimental-preview.104/

    And you can also download the Experimental Preview 2, which includes Unity's own tilemap support, from http://beta.unity3d.com/download/aa029c928062/UnityDownloadAssistant-5.5.0a6.exe

    Note that the Experimental Preview 3 is due in the next few weeks.
     
  17. rraallvv

    rraallvv

    Joined:
    Jul 30, 2013
    Posts:
    16
  18. Comolokko

    Comolokko

    Joined:
    Jul 24, 2014
    Posts:
    28
  19. MoctezumaDev

    MoctezumaDev

    Joined:
    Aug 14, 2013
    Posts:
    53
  20. piggybank1974

    piggybank1974

    Joined:
    Dec 15, 2015
    Posts:
    621
    @Leoniciux

    Are your the very guy I want to talk to how did you import the colliders into unity you made, I don't read xaml, this is for my own Map Editor
     
    MoctezumaDev likes this.
  21. MoctezumaDev

    MoctezumaDev

    Joined:
    Aug 14, 2013
    Posts:
    53
    what do you mean?
     
  22. piggybank1974

    piggybank1974

    Joined:
    Dec 15, 2015
    Posts:
    621
    You created the program Tiled4Unity does the program create the colliders for the tiles on the fly?