Search Unity

  1. 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
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

UniTile - 2d Tile-based Map Editor within Unity

Discussion in 'Assets and Asset Store' started by mudloop, Jan 6, 2011.

  1. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    UniTile is a simple to use yet powerful tile-based 2D map editor for Unity. You can use UniTile to build highly optimized 2D levels, without ever leaving Unity.

    With UniTile, you'll be making great levels for your 2D games in no time - for only $50.

    Features
    - Intuitive interface
    - Support for multiple layers
    - Object layer for placing sprites or other objects
    - Tile properties
    - Generates highly optimized maps
    - Generates colliders
    - Powerful tools and workflow
    - Automatically groups tiles for performance
    - Works well with Sprite Manager and Sprite Manager 2
    - Taps into Unity's Undo/Redo functionality
    - Supports tile borders to eliminate edge bleeding
    - Multi-tile drawing
    - Select tiles from your map with single or multi-tile picking
    - Use templates to store combinations of tiles
    - Ideal for iPhone, Android, or any other Unity target


    Available on the Asset Store, or through my website :
    http://www.mudloop.com/unitile


    Video: http://www.vimeo.com/18505893
     

    Attached Files:

    Last edited: Apr 3, 2012
  2. bigdaddio

    bigdaddio

    Joined:
    May 18, 2009
    Posts:
    218
    Holy crap I just loged in to see if anyone was working on a tilemapper, and here it is! Rocking!

    I have some questions, can I create a tilemap in code? I have written code that creates a tiled space in code, dumps it to an array and then draws it. This is not in unity however it is what I was planning to do in unity. Does your tile engine allow me to do this or is it only pre made edited tilemaps? How many draw calls does a tile map take?
     
    Last edited: Jan 6, 2011
  3. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    Right now you can do this, but only in the editor, not at runtime. If there's some interest, I could add some functions that allow you to manipulate maps at runtime though.

    It depends on the complexity of your maps. A layer has only one material, so usually it should be one drawcall per layer.
    If all your layers share the same material, they should be batched too, but I've noticed sometimes I get two drawcalls for three layers (in the editor). But I guess that is still more than acceptable.
     
  4. bigdaddio

    bigdaddio

    Joined:
    May 18, 2009
    Posts:
    218
    Thanks now I have more questions:
    How are tilemaps saved? How much space do they take? Can I save Tilemaps as prefabs? in the project I am working on I would have upwards of 100+ 20*20 tilemaps. I would like to also use 1 map and swap materials in code, this way one map can have multiple looks. Or would I have to create each map with an assigned material?
     
  5. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    Each layer has this:
    - One GameObject which contains the tile data as a multidemsional array (which you can delete if you don't need it - but the layer won't be editable anymore after you delete it
    - A number of GameObjects with a mesh, grouping a number of tiles.

    Everything is saved in your scene through Unity's serialization system. It shouldn't be a problem to make prefabs of your maps or layers.

    You should be able to swap materials by finding the groups and changing the material of the MeshRenderer objects. I might add some methods to do this in an update - right now i have no runtime functions for manipulating the maps.
     
  6. ssmchan

    ssmchan

    Joined:
    Nov 6, 2010
    Posts:
    72
    HI Smag,

    I am looking for your UniTile will be available on Asset store soon. I will buy it when available.. ( I like to use Asset Store because which is easy to integrated to Unity3D..

    On the other hand, any documentation available?

    Thanks,
    Simon.
     
  7. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    Hi Simon, thanks for your intereset. I've contacted UT about my problems with the asset store but haven't heard back from them yet. I will look into it again myself asap.
     
  8. tonyd

    tonyd

    Joined:
    Jun 2, 2009
    Posts:
    1,224
    Looks cool, I started creating something similar but never got around to finishing it.

    Does it support scrolling? If so, how big can the tile map be?
     
  9. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    Scrolling can be achieved by moving the camera. I found that Unity's frustrum culling was efficient enough for this.
    There's no actual limitation on the maps, so it will depend on the complexity and the number of layers, etc. I've made some pretty big levels and haven't encountered a problem with it yet.
     
  10. ssmchan

    ssmchan

    Joined:
    Nov 6, 2010
    Posts:
    72
    Dear Smag,

    Thx and hope to heard the good news from you soon.


     
  11. twitchfactor

    twitchfactor

    Joined:
    Mar 8, 2009
    Posts:
    351
    This looks very interesting.

    How is collision handled?
    How do you assign tiles specific attributes?
    How do you control the scroll speed of the different layers?
    I assume the tileset is a texture. Is there a max-size limit on the texture size?
     
  12. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    Right now you need to handle this yourself - you have access to an array with the tile ID's, and can construct colliders based on that. I'm thinking about what the best way to include this would be, so if you have any suggestions, I would be happy to listen.
    This is currently not supported. I have plans for this though.
    They're individiual gameobjects, and you can change their position based on the camera's position. I'm thinking of including example-code for this in a next release.
    Yes, it's a texture. The maximum size of the device applies, so 1024x1024 on older devices, and I believe 2048x2048 on newer devices.
     
  13. poka

    poka

    Joined:
    Jan 18, 2011
    Posts:
    7
    If I buy it now, will I get all the updates too?
     
  14. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    Yes. Only problem is the service I use for selling the files doesn't have an update system, but I will mail them to you directly (until I find or make a better, automated system for updates).
     
  15. poka

    poka

    Joined:
    Jan 18, 2011
    Posts:
    7
    Ok, i bought it right now. What do I need to send you to get updates garanteed?
     
  16. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    looks perfect for iPhone development.
     
  17. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    Thanks for your purchase. I have your email address on file, and I will send you any updates by mail as soon as they're ready. Might be a week or two until the next update though.
     
  18. poka

    poka

    Joined:
    Jan 18, 2011
    Posts:
    7
    Nice work, it's really nice and fast to draw your maps with it!

    A question, can I scale down the tiles (or the whole tile-set/map) in the scene, because I want my character cotroller to have height = 2 (I don't want to scale my other objects proporcional to the map, I want to scale the map to be proporcional to my other objects)?
     
  19. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    Currently, I think the map needs to be sized at (1,1,1) for the editor to work - but you can scale it through code at the start of your game.
    You can try scaling it in the editor to see if it works though. If it doesn't, I will try to ensure it's possible in the next update.
     
  20. poka

    poka

    Joined:
    Jan 18, 2011
    Posts:
    7
    Perhaps my last question was a dumb question, I could scale the maps in the editor :) (but afterwards I had strange behaviours when wanting to paint -> first make the maps, then scale down).

    Hope this question isn't dumb too. Why can't I bring my unity standard objects to the foreground, they're always rendered behind the UniTile layers (yes, I'm changing z-values)?
     
  21. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    These are not dumb questions :)
    If you want to be able to edit the maps after scaling them, you're probably better off scaling them down with a script - until UniTile supports scaled layers that is.

    Sorting is always a bit tricky. What shader do you use on the objects? Try switching it to the one that's included.
    You can probably also change the renderQueue property of the materials. I'm not a shader expert though, the shader that's included was made by Jessy (and included with permission).
     
  22. poka

    poka

    Joined:
    Jan 18, 2011
    Posts:
    7
    It would be a really great product if you could solve this with the the scalling, and when you could include physics (colliders etc.). (Because after generating maps -> scalleing -> changeing -> you need to adjust the colliders again...).
    I'm not complaining, for now it's a great product too!


    Yea, it was to the material.
     
  23. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    If you make the colliders children of the layer, they should all scale together nicely.

    Thanks :) I will definitely improve on it soon. Right now I'm still trying to decide how to handle colliders and tile properties, but I have a few ideas.
     
  24. poka

    poka

    Joined:
    Jan 18, 2011
    Posts:
    7
    Now I feel really dumb :) sure!
     
  25. melmonkey

    melmonkey

    Joined:
    Mar 31, 2009
    Posts:
    373
    Hey Sven,

    Is there any way to set the plane the Layers are drawn on? I am currently using the XZ plane for my game, and have some code written already to support this orientation.

    I suppose I could change my code to work inside the XY plane if necessary, but rotating the UniTile Layers would be far more convenient.
     
  26. poka

    poka

    Joined:
    Jan 18, 2011
    Posts:
    7
    Select Layer -> Inspector -> Rotation -> X=90?

    But first draw the map in Rotation = (0, 0, 0), afterwards rotate...
     
  27. melmonkey

    melmonkey

    Joined:
    Mar 31, 2009
    Posts:
    373
    Have you verified that works? I created a layer, than tried to rotate it and it didn't seem to rotate. This was just after the layer was created, I hadn't drawn any tile on the layer, I assumed I would see the layers bounding box rotate, but that didn't happen.
     
  28. melmonkey

    melmonkey

    Joined:
    Mar 31, 2009
    Posts:
    373
    I just tried it again, after drawing tiles into the layer, and it doesn't rotate.
     
  29. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    The bounding box doesn't rotate. This is something I draw with Unity's gizmo system, and I don't take scale and rotation into account. This is something I will look into in the (near) future.
    But I just tested, and you can draw your map, and then later rotate it, or rotate it with code right before your game starts. It's not ideal, but it should work. If it doesn't, please contact me with some more details, and I will look into it.
    Are you sure you're not trying to rotate the UniTileManager object instead of the layer?
     
  30. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    I have an updated version of UniTile which supports drawing the maps at any scale, position or rotation (and it has tile properties, and a nice grid) . This hasn't been tested enough for release yet, but if anyone (melmonkey or poka?) wants it already, just let me know.
     
  31. melmonkey

    melmonkey

    Joined:
    Mar 31, 2009
    Posts:
    373
    I'll take it! I definitely need it.
     
  32. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    Just wanted to show you guys something I'm working on.
    Check out the attached screenshot. It has some box colliders - these are created automatically (after selecting which tiles in your tileset you want to do this for), and as you can see, they are grouped for performance, as long as they share the same layer and tag.

    If you want more complex colliders, you'll be able to assign a prefab to each tile.
     

    Attached Files:

    Last edited: Jan 23, 2011
  33. melmonkey

    melmonkey

    Joined:
    Mar 31, 2009
    Posts:
    373
    I like that a lot. The ability to define a number of points, somehow that would be turned into colliders would be icing on the cake.
     
  34. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    Yeah, I've been working on that as well :) But it won't be part of the next release yet.

    Edit: I've attached a screenshot. This could be used to draw the geometry of entire levels, or just for certain tiles. But I still have to improve on it a lot.
    As you can see there's a grid (with optional snapping), which you can resize to get precise control over the points.
     

    Attached Files:

    Last edited: Jan 24, 2011
  35. Phineas Rage

    Phineas Rage

    Joined:
    Jan 27, 2011
    Posts:
    1
    Hi Smag,

    This looks like exactly what I've been looking for.

    Noobish question, does it work well with A*?

    I'm looking to use this for a game with a top down view.

    Thanks!
     
  36. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    There's no support for pathfinding included, but since you have access to the tile numbers and can add some custom properties to tiles (in the next update at least), it shouldn't be too hard to feed this data into an A* engine. I haven't tested this but I see no reason why it should be a problem.

    Topdown shouldn't be a problem - the current version has some problems with rotating the layers, but this is fixed in the current beta version. If you need this, just contact me after you order, and I'll send you the latest version. Or wait a few days unitl it's released.
     
    Last edited: Jan 27, 2011
  37. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    UniTile 1.1 has been released!

    New features:
    - Tile properties (double click a tile in your tileset)
    - Automatic instantiation of prefabs and box colliders
    - Texture padder script included to add borders around your tiles to counter edge bleeding
    - You can now edit your map at any position, rotation or scale.
     
  38. spg

    spg

    Joined:
    Aug 6, 2009
    Posts:
    79
    Do you have any plans on getting this onto the asset store? I'd much prefer to buy stuff from there with the import/update structure built into Unity..
     
  39. Cob

    Cob

    Joined:
    Dec 25, 2010
    Posts:
    11
    Do you need a pro edition to use this? Can I use it in the free Unity or Unity iPhone basic?
     
  40. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    I had plans to do this, but I keep getting (non-descriptive) errors when submitting to the asset store. I contacted UT about this but haven't heard back from them yet.

    It should work with both versions as I don't use any of the pro-only features. I tested it on my PC with the free edition a while ago, if you want me to double check the latest version I can do this this weekend.
     
    Last edited: Feb 4, 2011
  41. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    @Cob: I just tested it with the free edition of Unity again, and it works without a problem.
     
  42. cj.currie

    cj.currie

    Joined:
    Nov 27, 2008
    Posts:
    292
    Hi Smag,

    I've been using UnitTile and so far have been impressed with the results (looking forward to future updates), but I wanted to request a feature.

    My biggest problem is that when dealing with large tilesets (up to 2048 tall), the custom inspector tile picker renders the tileset as one contiguous image instead of in a ScrollView, which means that the tiles are way to dang small to pick. Because of this, I have to 'shop the tileset into a bunch of smaller files, which means a bunch of materials, which in turn means a bunch of extra layers and objects in the scene.

    In the future, can you make the picker into a scrollview so I can scroll through the image when picking tiles (and display the image at native resolution)? I've seen something like that done before, so I know it's possible.

    Thanks a bunch!

    -CJ
     
  43. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    Thanks for the suggestion. It's something I was already considering. I'll let you know when I get to it.
     
  44. any_user

    any_user

    Joined:
    Oct 19, 2008
    Posts:
    362
    Thanks for creating this great tool. I have two suggestions: it would be nice if we could rotate/flip tiles. And it would be nice to have a possiblity to select tiles by uv-coordinate rather than pixel value, then it would be easy to rescale the texture after creating a level (e.g. for performance reasons or whatever).
     
  45. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    I plan to work on an update soon, but I'm not sure if rotating/flipping will make it. It's a good suggestion though, so I'll keep it in mind.
    As for the other suggestion, the maps are actually stored as simple meshes (and an array of numbers), so you could change the texture when the level is done. I do this myself at runtime to have a lowres and hires version (old devices vs retina/ipad).
     
  46. wesllg

    wesllg

    Joined:
    Jan 8, 2011
    Posts:
    18
    Hey Smag, watch the video and this looks like something I would find very useful for a new project I am about to start. Are you still having problems getting it onto the app store? Should we just purchase through your website still?

    Cheers
     
  47. any_user

    any_user

    Joined:
    Oct 19, 2008
    Posts:
    362
    i know it's possible to change texture size for the output mesh, but after changing size it's not possible anymore to select tiles, because the selection is pixel based. So i have to change texture size back to the original value for making changes.
    from my point of view, it would make sense to select tiles in normalized (uv) space, rather than pixel based. same thing goes for the scale of the output mesh, where i'd prefer to define a unity-unit size of a tile rather than thinking about pixel sizes. i know i can scale the mesh, but 1/128=0.0078125 is not a nice value to type in.
     
  48. wesllg

    wesllg

    Joined:
    Jan 8, 2011
    Posts:
    18
    I was actually wondering if there was an easy way to delete or hide a tile at run time. I notice there's no supplied API function to do this. Given how tile layers are stored (single mesh instance) this would likely not perform too well on mobile devices. Is this correct?
     
  49. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,093
    Yeah, I gave up on the asset store for now, but will try again after the new version is finished.

    I will look into this. If I change this, it has to be in a way that doesn't break current functionality at all though.

    Well, not easily. Since I group tiles together for performance reasons, changing one tile would mean changing the entire group. The next version of UniTile will have an object-layer though, where you can easily place sprites (or other objects) in a grid. Maybe you can use that for the instances where you need to delete tiles?
     
  50. any_user

    any_user

    Joined:
    Oct 19, 2008
    Posts:
    362
    for the tile selection, there could be a simple checkbox or something to switch between uv and pixel mode. Maybe it's not a small change in the code, but from a user's perspective, it would make sense to me.

    for the output size, maybe a "scene tile size" property, which defaults to the current "tile size" property, would work. so the size would stay untouched for existing content.
     
unityunity