Search Unity

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,107
    That's no problem at all - all layers can be moved, scaled and rotated independently.
     
  2. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,699
    Sweet.
    So I can make my cells of different tileMaps different sizes? Can I make the tileMaps different sizes? And does it come with its own atlas builder? Also, how is performance on iOS? Good I guess.
     
  3. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    Yes, each layer can have a different tileset with different dimensions, and the layers can have different sizes. There's no atlas builder, but there is a tool to add padding to an existing tileset. If you purchase UniTile, send me an email and I'll send you the latest RC, which also includes much better documentation.

    Performance is quite good. I've spent a good while optimizing UniTile. Off course, if you have too many overlapping things, you will eventually hit the hardware's limitations.
     
  4. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,699
    How many things is limiting? I think that really 3 layers would be plenty for my purposes.
     
  5. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    Well, it depends on a lot of things, like how many other things are going on (sprites, ...), how much stuff you put on the layers, etc.
    In a game I'm working on, I have 3 tile layers, and a large background sprite, and it runs without any problems on both newer and older hardware.
     
  6. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,699
    Ok great.
    I have a few things to work out, but i think I will be purchasing from your site.

    Cheers!
    Ren
     
  7. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,699
    Hi Mudloop,
    I purchased your asset but have a couple of questions.
    I created a layer and want to adjust the size of the tiles. When I do, the result looks no different than the default of 32x32. Also I see no Apply button which I am supposed to select. I inserted version 1.2.2


    Thanks.
     
  8. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    Try the "Rebuild map" button instead. It's possible that I changed it and hadn't updated the documentation. That will be fixed in version 1.3 (which I'm still working on, but I can send you a release candidate if you send me a mail), as I have rewritten the documentation completely.
     
  9. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,699
    Ok,
    just messing around but I set my tile size to 3x32.
    However it shrinks the entire tileMap.
    Why would that be?
    edit. I think I just figured it out.


    edit.
    Also, do we need to supply our own atlas's? Photoshop is fine for that I would think yah.
     
    Last edited: Feb 20, 2012
  10. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    Not sure what you mean. If you send me a screenshot and/or some more details on what's happening I'll be able to help you out. info at mudloop dot com.
     
  11. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,699
    I think I am ok. I am sending you an email anyways just so you have my address etc.

    Thanks!
     
  12. MetaMythril

    MetaMythril

    Joined:
    May 5, 2010
    Posts:
    150
    I would assume it shrinks because you are using a smaller size, so you just have to increase the Layer Size to allow for more iteration of tiles. It's the same effect I had when I increased my tile size from 32x32 to 128x128 but kept the layer size at 100x50, it became huge. :)

    With your atlas question, yes, it seems you will have to develop your own atlas using any sort of image editor. I find it useful to use Photoshop and turn on the grid option, from there you can go into preferences and set the grid to the size of your tiles.
     
  13. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    Photoshop is fine, but I find that I get better results if I open the psd's in Fireworks and export the png from there - as fireworks has 32 bit png's, which have a better alpha channel.
    Note that you probably get the same results if you just use psd's in Unity directly, but if you use stuff like dropshadows, I find that Unity doesn't read that correctly. For tilesets that probably isn't an issue, but that's why I personally added Fireworks to my workflow, and I'm happy with the results.

    Also, I didn't see that you said "3x32" (I read 32x32) - so yes, GravitySpec's explanation is probably correct.
     
  14. MetaMythril

    MetaMythril

    Joined:
    May 5, 2010
    Posts:
    150
    I've found that Unity's handling of transparency with my psd file to be quite terrible. Though I'm not sure if it is just an issue with settings on my part.
     
  15. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    Well, in that case, try using Adobe Fireworks to export to png - if you have access to it. Works well for me.
     
  16. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,699
    One concern i have about your assest is how i choose my sprite from that atlas. Right nowit seems to be a free grab, no snap, no just click on image. What if a grab a portion of the sprite but am not perfect?
     
  17. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    I don't think you set the tile size correctly. This has to be the size of each individual tile in your tileset, as I explained in my mail. If you set it to low values (I see you set it to 4 in the screenshot you sent me), each individual tile will be very small.
     
  18. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,699
    Just emailed you.
    Thanks.
     
  19. MetaMythril

    MetaMythril

    Joined:
    May 5, 2010
    Posts:
    150
    Also something to bear in mind Ren.

    Making extremely small tile sets will cause you to generate a large amount of geometry as one quad is created per tile drawn which comes out to 2 triangles per tile. That by itself doesn't sound like much but if you are trying to capture fine grained areas of your texture, you may want to sacrifice some empty texture space to save on the amount of geometry created, especially if you are intending on layering said generated geometry.

    This is just my two cents, but I find it a worthwhile trade-off to give up a fairly small amount of space on the texture to ease the amount of geometry drawn on screen, but of course your mileage may vary depending on what you are wanting to accomplish.
     
  20. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,699
    Hi @all,
    I am wondering why this is the case. I have placed a UniTile Layer in as a child of a gameObject. I figured it will be easier to handle several different layers this way as each enemy will have a layer to "stand on". However, I can not see the layer in the game screen.

    Why is that? Is there a way to correct this?
     
  21. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,699

    I do not quite follow you. Are you suggesting exporting the art as "not the highest quality"?
     
  22. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    All he was saying was that using tiles that are very small (like 3x3 like you were trying) is a bad idea.
     
  23. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,699
    does he mean Output? Because I would like to use 1x1 for my tile size(output) but probably 128x128 for size itself.
     
  24. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    The output size can be anything that works for you, as long as you configure the camera accordingly. It's just the tile size that shouldn't be too small (I wouldn't recommend anything under 16x16).
     
  25. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,699
    Right.
    When each tile is placed, what is happening? Is it calling the full sheet?
     
  26. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    It creates a mesh (well, multiple meshes as it cuts the map into pieces - see the group size setting) with your material, and each tile is a quad (two triangles) in that mesh, uv-mapped so it only shows one tile. But yes, the entire tileset will be in memory - but only once off course (so it's not duplicated for every single tile if that's what you were thinking).
     
  27. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,699
    ok yes.
    That is what I was thinking. I am just trying to get a hold on how stressful it is to the engine. I guess I can only test.

    Thanks Sven.


    ::))(
     
  28. frozenoj

    frozenoj

    Joined:
    Sep 6, 2011
    Posts:
    79
    Will this generally run at 60fps on an iDevice?

    Also, UniTile only helps with tiling right? So no help with animation and such?
     
  29. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    Well, it depends on the amount of layers, and the amount of tiles that are on-screen at the same time (tile size, how many overlapping things, etc), but yes, in my own game, it's running at 60fps on a 2nd gen iPod Touch, a 4th gen iPod touch, and an iPad 1.

    And you are correct, it's only for tile-based levels. You'll need a separate sprite system.
     
  30. hutao

    hutao

    Joined:
    Jun 9, 2011
    Posts:
    8
    Hi Smag,

    Now I want to tile a so large map that can display so many players on iphone device, So I want to know if unitile can achieve,
    How large can a map be tiled without effect the performance.Is there any limitation on the textures I use?
     
  31. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    The actual limits are hard to determine, as this will depend on a lot of factors - which devices, how large the tiles are, how many layers, how many overlapping things, etc. In my game, I have a 400x100 map with 3 layers and a couple of 100 sprites (not all on screen at the same time, and I had to deactivate them when they were off-screen), and it runs quite well. I'm sure it could get bigger, but that's currently the largest that I've tried.

    Off course there is a limitation on the amount of textures you use - you are limited by the device's memory. Also, older devices may not be able to show textures that are larger than 1024x1024. If you can, try to make the textures RGBA16, but that doesn't look good with all types of art.
     
  32. hutao

    hutao

    Joined:
    Jun 9, 2011
    Posts:
    8
    OK, Thanks, I will have a try
     
  33. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    Hi,

    UniTile 1.3 has just been released (pending approval on the asset store).

    This is a big update (that's long overdue), with many new features:

    - New scene panels and keyboard shortcuts that greatly improve workflow
    - Play mode editing
    - Tiles can now be rotated and flipped - this also works for larger selections
    - Custom box collider sizes
    - Improved TexturePadder usability
    - API for changing tiles at runtime
    - Hold shift to limit tile drawing to one axis
    - Edit templates from the layer instead of the UniTile manager
    - Better documentation
    - Many bug-fixes

    If any of you have any screenshots of projects made with UniTile that you wish to share, please send them to me, along with the name of the project, any credits you want me to include, and a link if you have one. I will add those screenshots to my website, and the Unity forums thread.
    I'm interested in both screenshots of the projects in action, and the editor. I might also add these screenshots to the Asset Store. I can not include a link or credits there, so if you don't want your screenshot(s) to be used there, please let me know.
     
  34. Daxiongmao87

    Daxiongmao87

    Joined:
    Jan 7, 2010
    Posts:
    148
    Hi Mudloop, I'm having an issue with your Unitile. I am able to load the texture and everything into the Layer object, but when i select a portion of my texture to tile with, and then click on the area on the scene i want that tile to be, nothing happens. Not even an error message. Any help would be great.

    Edit: This is with version 1.3

    Edit: fixed the problem, had to set up the texture import settings for it to work.

    Edit: Still having weird bugs and stuff. I'm getting this:

     
    Last edited: Mar 2, 2012
  35. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    I see how I could solve this bug, but it would be more of a workaround, because I'm not entirely sure what's causing it in the first place. Would it be possible to send me a copy of your project so I can investigate? Thanks!
    EDIT: Did you create the layer with the UniTileManager, or did you create it by adding the TileLayer script to a new GameObject?
     
  36. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    Ok, thanks to "vancura", who sent me a repro case, I figured it out. The error only happens if the .tileset object that is generated doesn't have any data yet, which is why the testers and I didn't catch it during development. So a workaround for now would be to double-click one of the tiles in the inspector, and press "save". Then press "rebuild map" and you should be able to draw again. I'll fix this in the next update.
     
    Last edited: Mar 12, 2012
  37. Small Green Creature

    Small Green Creature

    Joined:
    Mar 18, 2012
    Posts:
    7
    Hello,

    I'm trying to make a zelda like game. I'd like to know how Unitile editor manages the map of walkable areas. How would you implemente the tile map plus walkable areas and how the player/npcs check the area for pathfinding and boundaries and stuff?
     
  38. MetaMythril

    MetaMythril

    Joined:
    May 5, 2010
    Posts:
    150
    Those are some pretty broad questions that relate more to custom uses of other systems in Unity rather than strictly UniTile.

    But hazarding a guess, I would say you could use colliders for objects that you/enemies shouldn't be able to walk through and the rest is either using Unity's physics or the CharacterController to move objects around. For pathfinding you will have to look at the resources that Unity has available to allow navigation around objects that they could collide with. I haven't personally worked with pathfinding yet so I can't be any more descriptive than that at the moment.

    I think UniTile is largely geared toward doing 2D side-scrolling games, though you should be able to do a 2D top-down game like Zelda (thinking "Link to the Past" here) with a little thought and effort.
     
  39. Small Green Creature

    Small Green Creature

    Joined:
    Mar 18, 2012
    Posts:
    7
    Can I make a suggestion?

    It seams to me that creating like, 50 maps on Unitile (or any other tool), importing the maps to Unity and after that creating some king of mesh, plans or 3d objets to control the walkable area is a lot of trouble.

    I'd like to see a Unity 3D tile map editor where i can draw the tiles and draw the walkable area in another layer of the map editor in a way that is visible where on could walk inside the editor. The editor would create that plans/objets and set them as collider objects in a way to save level design time.

    After that we could make 3D objects to control game objects, NPCs, enemies and the player. I think that would be nice for side scrollers too.

    Would Unitile developer consider such a feature request?
     
  40. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    As GravitySpec pointed out, your question is a little bit outside the scope of UniTile.
    Creating a top-down map is no problem, and UniTile can create box colliders that can be used to define non-walkable areas. However, pathfinding is something you'll have to come up with on your own (or find some existing pathfinding library).

    I'm not sure what you mean. UniTile is integrated within Unity, and you don't have to import the maps - it's all done within the scene in the Unity editor. There's an Object Layer type as well for placing objects (sprites or 3d objects).
    As for colliders, you can configure tiles to automatically generate box colliders, which are merged together when possible (for performance).
    Drawing custom shapes for colliders is currently not supported, however you can assign prefabs to tiles that are spawned automatically, which can be used for irregular colliders.
     
  41. Small Green Creature

    Small Green Creature

    Joined:
    Mar 18, 2012
    Posts:
    7
    I'm sorry. I think I didn't know how to express myself.

    It's nice to see that UniTile has the object layer and create colliders for them. I took a look at Unity pathfinding system and looks like we can use that with a navMesh. A nice feature would be to draw the mesh in the tile editor. Is that possible on UniTile?

    Sorry for asking so many beginner questions.
     
  42. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    Hi,

    I haven't used navmesh, so I'm not sure how it works, but there's nothing built in UniTile to work with it. However, you have access to the tile data through code, so one way would be to read that at the start of the scene and set up the navmesh stuff based on the tile data. You could also make an editor script (triggered by a menu item) that does this.
     
  43. hamss

    hamss

    Joined:
    Mar 16, 2012
    Posts:
    2
    I want to be able to use this in a game I am working on, but the camera I am using in that game is a orthographic set to size 5 so that everything can be pixel perfect. 1x1x1 = 64x64x64px.When I set the camera to that size in a test project everything in the tile manager was huge, how do I make it so that it will fit into a size 5 ortho camera?

    Sorry if this is a dumb question, new to unity.

    edit: I think I figured it out, was setting the wrong numbers in the tile manager.
     
    Last edited: Mar 23, 2012
  44. Small Green Creature

    Small Green Creature

    Joined:
    Mar 18, 2012
    Posts:
    7
    Does UniTile work well with Orthello or Smooth Moves animations?
     
  45. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    I haven't used those frameworks, but I see no reason why it shouldn't work. The only issue I can think of would be that the included shader could draw the tiles in front of the sprites, but in that case just switch to another shader.
    If you do run into any problems, let me know and I'll fix it.
     
  46. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    Wow, this is pretty robust. :)

    I was messing about with http://www.mapeditor.org/ and a self-written parser to use the generated maps in Unity, but I was having massive performance problems and other issues so I thought I would buy this to see if I could find any tips on how to handle texture atlases and tiles properly in your code, but man is this package good. :p

    Everything is just so slick.

    I've just been playing around with it so for all I know this feature may be in there, but is there a way to select 2 or more tiles from the tilesheet and have them display as a single animated tile?
     
  47. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    Thanks for the kind words :)

    Currently, there's no such feature. I will give it some thought and see what I can come up with.
     
    Last edited: Apr 1, 2012
  48. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    Hmm, I'm comparing this to Tiled seeing as that's a dedicated Tilemap Editor and it doesn't seem to be a way to place animated tiles there either. I've never really done any Tile based games before so I'm not sure how you go about it.

    Doing it with tile properties is perhaps the proper way to do it?

    Like for instance place a static tile, and add a property which references the tiles to use for its animation?

    Is there a way to see the tile number in the tilesheet viewer to make it easier for me to do something like that?

    Or perhaps I can ask you how you would go about using animated tiles? :)
     
  49. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    I'm not at home right now, so I can't look up the exact methods, but there are methods provided to change tiles, so you could do this yourself with the api. But you're right, the tile id isn't shown, I will look into adding that. I've got an update coming up, I probably won't be adding an animation system just yet, but I'll at least add the tile id of the selected tile in the gui somewhere.
     
  50. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    Sounds good.

    I'm fiddling with the API as we speak and this seems to work:
    Code (csharp):
    1.  
    2. private TileLayer tileLayer;
    3. private int fps = 4;
    4. private int totalCells = 3;
    5. private float nextFrame = 0.0f;
    6. private int i = 0;
    7.  
    8. void Start() {
    9.     tileLayer = GetComponent<TileLayer>();
    10. }
    11.  
    12. void Update() {
    13.     while (nextFrame < Time.time) {
    14.         if (i >= totalCells) {
    15.             i = 0;
    16.         }
    17.         tileLayer.SetTile(40, 66, i);
    18.         nextFrame += (1.0f / fps);
    19.         i++;
    20.     }
    21. }
    The only problem being that I have to find every tile I need to animate in the layer itself. There has to be a way to tell UniTile to always animate tile x with tile x, y and z wherever it's placed so I don't have to do it on a per tile basis? Or is that what you mean with an animation system? :p

    As for feature requests here are those I've gathered currently:

    - Being able to turn layer visibility on/off
    - Being able to solo/highlight the current layer
    - Being able to increase layer size to the left and up as well as down and right

    The last one is a bit important for me unless I've missed something. I'm creating a top down rpg and I've created the starting town and I'm now expanding the map, but I would like to expand it up and to the left. Currently you can only expand right and down. So I either have to try and cut paste my entire starting town or leave it in the upper left. :)

    Gave you a proper review in the Asset store as well seing as the only other one you have seems to be hogwash.