Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

[RELEASED] Super Tilemap Editor

Discussion in 'Assets and Asset Store' started by CreativeSpore, Feb 21, 2016.

  1. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    You are welcome! If you don't want to wait until next release, add these lines after
    Code (CSharp):
    1. EditorGUILayout.PropertyField(serializedObject.FindProperty("AnimFPS"));
    in AnimBrushEditor.cs:
    Code (CSharp):
    1.  
    2. TileSelection tileSelection = ((TilesetBrush)target).Tileset.TileSelection;
    3. if (tileSelection != null)
    4. {
    5.     if( GUILayout.Button("Add tile selection as animation frames") )
    6.     {
    7.         ((AnimBrush)target).AnimFrames.AddRange(tileSelection.tileIds.Select(x => new AnimBrush.TileAnimFrame() { tileId = x }));
    8.     }
    9. }
    10.  
    Also add "using System.Linq;" on top of the file.
     
    zwickarr likes this.
  2. Async0x42

    Async0x42

    Joined:
    Mar 3, 2015
    Posts:
    104
    Sorry, I had a misunderstanding regarding the collision layer since you can set them in the inspector (I didn't realize newly created collisions would inherit from the root object)

    For the multi-size prefab stamping, it does seem more complicated than I was originally thinking, to fit in well with the tile system, thanks for the alternate solution though!

    About the various 2D collider options, for me personally, I'd like to be able to generate colliders as 2D Box Colliders, there's certain areas where I boxcast in a specific spot (scaled down, say to 0.9 of a unit), and having these as EdgeColliders makes the BoxCast totally miss the collision.

    Edit: For example, certain tiles could be say.... water tiles that are fishable, allowing a random-distance based raycast to see if it lands in it (rather than hitting an edge collider). Auto-optimizing this into a combined polygon collision instead of an edge collider would be good as an additional option.

    Thanks for the copy/paste support for tile properties (long-term though, multi-editing will still be a valuable feature, since copy/paste helps, mass-updating will still be easier if we can multi-edit values)
     
    Last edited: Mar 23, 2016
  3. zwickarr

    zwickarr

    Joined:
    Nov 20, 2012
    Posts:
    28
    that worked!

    But, how do you multi select tiles that don't fill out an entire row? I can only draw selections as a square/rectangle, shown here:
    upload_2016-3-22_20-36-23.png

    then when i press the "Add tile selection as animation frames" it will add in those extra tiles like so:
    upload_2016-3-22_20-37-53.png

    its not a huge deal, i can just remove these blank tiles using the minus button, its just an annoyance.

    thanks!
     
  4. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    About the BoxCollider2D for water tiles, for example, you can remove set the water tile collider to none, and set instead a prefab with a box2DCollider (you could event have a different layer type for this collider like Water). Anyway, are you sure BoxCast is not detecting them? I didn't try but the Unity Wiki said it check collisions against any collider.
    About using Polygon collider instead Edge, it could be perfectly possible, but does it have a real improvement?
     
  5. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    I thought really carefully about removing or not empty tiles. I decided not to remove them because it would keep the tileset structure but also because one thing you can do at any time is changing a tileset texture for another and the tilemap will be changed accordingly, so you can have different versions of the same tileset. Unity Sprite Editor would remove empty tiles but it means the tileset texture cannot do something like removing a tile, like a snow blocking tile, for example, that should be transparent in summer tileset.

    So I guess your only option here would be select a row, then the other, change the Tile Row Length on top of the tile palette to wrap tiles so they are all in a rect, or create a tile view with them, set the tile row length to 1.
    All of them are longer than just removing the empty tiles or placing them in a row in the tileset texture.
     
  6. Async0x42

    Async0x42

    Joined:
    Mar 3, 2015
    Posts:
    104
    That would work, but spawning a prefab for the boxcolliders seems like a bad way to get around it (Really though, after thinking about it, I don't know why I'd need a BoxCollider2D vs a polygon, which would resolve all situations)

    It can detect Edge colliders, the problem is the tiles are 1 unit wide/high. So tiles that are directly beside an edgecollider get flagged as collisions, even though he's in the 'open' area. If the boxcast is modified to only check 0.9x0.9 of a unit, it misses it completed because the edge collider wraps the tile, but isn't inside it. (polygon collider would solve this)

    The boxcast isn't being used from point a -> point b, in this situation it's boxcasting straight down point a -> point a, that's why it won't catch the edge collider when scaled to 0.9. (a -> b won't work for a few situations, such as the fishing example).

    Aside from using polygon colliders to fix my issues above, I recall there are some assets on the store that work nicely with polygon collisions, but don't handle edge colliders (Here is one for 2D navigation but needs polygons, for example: https://www.assetstore.unity3d.com/en/#!/content/14718 )
     
  7. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    Hi there,

    I've been making some research before trying to change the edge collider for polygon colliders and it looks like this was discussed before in other forum http://2dtoolkit.com/forum/index.php?topic=3159.0 and it looks like it give some problems.
    And also here https://www.reddit.com/r/Unity2D/comments/3n1i0k/when_should_i_use_polygoncollider2d_and/
    According to this, for static geometry, edge colliders should be used. In your case for the water, in Smart Platform Collider I use a box2D for the water. Of course you need to add this box in all areas where you want the player to swim, but right now is the best solution. I will think about this and try to find a better solution for this case though.

    Anyway if you still want to try PolygonColliders go to TilemapChunk,cs and rename EdgeCollider2D to PolygonCollider2D.
    To remove first all EdgeColliders before this change be sure the tilemap has no colliders or set 3D colliders ( this will remove the EdgeCollider2D of all tilechunks ). Then rename EdgeCollider2D to PolygonCollider2D and set the colliders to 2D.
    If it's working fine and you don't have any problems at all, I will think about adding this option to the tool.
     
  8. Async0x42

    Async0x42

    Joined:
    Mar 3, 2015
    Posts:
    104
    I replaced them all, and I haven't run into any issues yet, collision is working without any problems! If I run into something in the future I'll let you know, but so far so good.

    Also, for the posts you linked before, I think EdgeColliders are just fine in most cases where people are actually casting from point A -> B, the main problem is that if you're casting in a specific location (A -> A, not A -> B), then the cast won't pass through the edge collider (unless it's a cast that overlaps the edges)
     
  9. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    Well, anyway it's something I could easily add. It cost nothing but changing one for the other. If you don't find any issues I will add an option to specify the type of colliders for 2D.
     
  10. Async0x42

    Async0x42

    Joined:
    Mar 3, 2015
    Posts:
    104
    That'd be great, thanks!
     
  11. zwickarr

    zwickarr

    Joined:
    Nov 20, 2012
    Posts:
    28
    Is it possible to have a "create prefab from selected tile" tool? I have a ladder tile that needs a custom script assigned to it. From what I see, i need to assign a prefab (with said script) to the tile properties of a tile. So I need to create a new sprite from my tileset, add collision (needs to be of trigger type), add the script, then assign this prefab to the original ladder tile.
    Is this the correct way to go about this?

    seems like there could be a more automated way by just having the tile selected in the Tilemap inspector and run a tool to automatically convert the tile into a prefab and use the collision that is already used by the tile and even auto assign the new prefab to itself (as an option)
     
    Last edited: Mar 27, 2016
  12. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    New version of Super Tilemap Editor will be available soon!
    It comes with lots of new features and requested changes.

    The launch price will be over and final price will be 35$

    Super Tilemap Editor v1.2.0 Changelog:

    • updated manual
    • changed collider enum popup for a selection grid
    • added brush reorderable list view mode
    • added option to display tiles when a prefab is attached to it
    • added option to add all selected tiles as frames in animated brush
    • added more control in map bounds allowing custom size, disable painting outside the map bounds and shrink bounds to fit painted area
    • added TileData class as a friendly way to work with tile data values (usage included in manual, final section)
    • added TilemapUtils class to contain useful methods to work with tilemaps, like GetGridWorldPos
    • fixed bug using animated brushes and tiles with prefabs
    • fixed and improved sorting layer property drawer used to change tilemaps sorting layer
    • fixed update tile properties when selecting a tile from palette
    • fixed refresh tile prefab changes when pressing Refresh Map button
    Check the updated manual to see more information about the changes:
    Manual v1.2.0

     
    zwickarr likes this.
  13. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    I will check this to see if I can include something like that in next release.
     
  14. zwickarr

    zwickarr

    Joined:
    Nov 20, 2012
    Posts:
    28
    Thanks! I really appreciate the support you have for your tools and how quickly you respond.
     
  15. Mijago

    Mijago

    Joined:
    Mar 27, 2016
    Posts:
    11
    I really enjoy this editor. Really nice work!
    I just had problems with the Carpet Brush, but nothing i could fix by writing my own Brush.

    But I have a few problems with the Factory Brush:
    * When I draw the tiles with 1 space between them, everything works fine. Even a line is not a problem. IF there are not two tiles next each other at x=0 and x =59 (or whatever is beneath 0, in my tests it was 59), because then the concurrent Object just moves to the left. (or it gets created again, because there is no new Object created in the List).

    * When I Click on a Tile with the Factory Brush where is already a Object of this Brush, the Object gets deleted and clicking again does not create a new Object.

    This is how it looks when I draw a Block (per hand, not fill tool):


    So for me it looks like everything around zero is a bit.. buggy :s

    Pleace do not sentence my english skills.. ;)
     
  16. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    Hi there,

    Thanks for your commentaries ;)

    I have found the problem and I will fix it for next release. Anyway, it's better if you attach the prefabs to the tile instead of creating a new prefab factory.
    You can do that by selecting a tile with the Tile Property window open (Window->SuperTilemapEditor->Tile Properties Window) and attach the prefab in the prefab section.
    I left the Factory Brush for special behaviour, but this other way would be always better. Leave the Factory Brush as a way to customize the way you place a prefab, like checking neighbors first to select a different prefab or making a random prefab brush, for example.

    EDIT: after having a look into this again, I've found a problem in creating prefabs using a brush.
    What happens is, the brush set the tile data for neighbours to activate the update flag ( used for the autotiling to say the neighbour tiles they should be refreshed on next UpdateMesh )
    If neighbour tile has a prefab created by a brush, but the tileId is empty (because a factory brush is not setting any tile), then, it is like setting a tile with no prefab attached and the prefab is then removed.
    So it's not a good idea managing the tile prefabs from two different sides. The right way of creating autotile prefabs is attaching them to the tile, then using a brush to select the right tile according to the neighbours ( what it is already done by CarpetBrush or RoadBrush ) and leaving the tile to draw the right prefab.
    So I have decided to remove the FactoryBrush in next version, unless someone see a reason for not doing that, I think it is the best choice.
     
    Last edited: Mar 28, 2016
  17. KezzB

    KezzB

    Joined:
    Nov 16, 2013
    Posts:
    25
    Great asset, just what I needed, thanks!

    I'd like to be able to change the material used under the "Renderer" tab but I can't get it to accept changes. I've tried on Windows and Mac, and via dragging a material onto the field or browsing for another material.

    Is this possible, or could it be made possible?
     
  18. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    Hi,

    I found the problem in TilemapEditor.cs line 165:
    Change:
    serializedObject.Update();
    For:
    serializedObject.ApplyModifiedProperties();

    I will add this fix in next version.
     
  19. KezzB

    KezzB

    Joined:
    Nov 16, 2013
    Posts:
    25
    Perfect, thank very much for checking that out. Again, top notch asset!
     
    CreativeSpore likes this.
  20. Mijago

    Mijago

    Joined:
    Mar 27, 2016
    Posts:
    11
    And a few things I would find useful:
    * linkable brushes, so you can create two brushes that just different in the tileset-position (like different Themen for the map). ATM they just do not react together. I created this for myself with a Custom Brush but maybe some other people could have a use for sth like this too.
    * Possibility to create one 'giant' tileset from multiple spritesheets / tilesets. That would really be great!

    I think I'll find some other ideas - I'll let you know :D
     
  21. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    Can you explain the linkable brushes? I am not sure what you mean.
    About create giant tilesets. I am already thinking about the best way to do this in future updates.

    Thanks for your ideas ;)
     
  22. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    New update of Super Tilemap Editor v1.2.2 has been released!

    Change Log:
    • Fixed tile colliders when the tile is flipped and/or rotated
    • Fixed changing of tilemap material
    • Fixed double click issue when painting (double click is a fill action) and in the brush palette ( double click is for selecting the brush asset )
    • Fixed Carpet Brush autotiling
    • Tile collider type is now selected using a selection grid instead of a popup
     
  23. spaceJASE

    spaceJASE

    Joined:
    Jul 29, 2014
    Posts:
    5
    @CreativeSpore - Thanks for creating this tool - I missed the initial lower price but already feel it's worth the full price I paid.

    I was working on setting my camera bounds by using the tilemap bounds (*BIG* thanks for setting that up so I don't have to figure it out) and I noticed that the min/max numbers may be off by one in the inspector. When I grab the numbers in code it works as expected so it's fine but I wanted to direct your attention to the inspector readout. Or I could be mistaken/missing something. :) I am using 1.2.2
     
  24. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    Hi there,

    Thanks for your commentaries, I'm glad you like this tool ;)

    About your question with the tilemap bounds in the inspector, it is because in the inspector the bounds are displayed in tiles.
    When you take the bounds by code, it is returned in units. This way, if you change the cell size later, the bounds will change accordingly. Also you have two ways of taking the map bounds:
    • Tilemap.MapBounds: return the bounds of the tilemap in units.
    • Tilemap.MinGridX, Tilemap.MaxGridX, Tilemap.MinGridY, Tilemap.MaxGridY, Tilemap.GridWidth, Tilemap.GridHeight: return the bounds in tiles.
     
  25. Async0x42

    Async0x42

    Joined:
    Mar 3, 2015
    Posts:
    104
    The currently selected tile/brush is serialized into the tileset asset, which triggers a git file change anytime there is a save. Unless it's critical for something, could this be changed so that it's not saving the selected item each time?

    All the changes you've made so far have been great by the way, thanks! Any idea when the polygon support will be added? I haven't noticed it in the recent updates yet (I still need to change all edge colliders to polygons)
     
    Last edited: Apr 10, 2016
  26. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    Hi there,

    I was testing the polygon colliders and I saw some problems like sometimes it creates a connection between two vertices outside of the polygon shape. Did you have similar issues testing it?
    Anyway I am still on it for a clean implementation.

    About the serialized tile/brush, I will try to move it to user preferences data, so it is not saved with the tileset.
     
  27. Async0x42

    Async0x42

    Joined:
    Mar 3, 2015
    Posts:
    104
    I haven't run into any issues, but I'm using for really basic rectangular shapes, so that's probably why it's working fine for me. Thanks for looking into the serialization!

    Edit: Another idea, is either by default or an option, don't paint the preview tile where the mouse is, if the position is outside of the map bounds and painting out of bounds is turned off.

    Also, for tile properties -> prefab, I think the prefab should be spawned during load/runtime (optional), rather than immediately when you place the tile (like a placeholder). If you later want to change the prefab that tile is associated with, it won't change all them. Unless I'm missing something about this process of course.

    I noticed that if you remove the prefab, and paint one time on the map, then the tile is drawn on all positions where the prefabs are, but the prefabs aren't removed.
     
    Last edited: Apr 10, 2016
  28. zwickarr

    zwickarr

    Joined:
    Nov 20, 2012
    Posts:
    28
    @CreativeSpore can we get the option of selecting multiple tiles in the scene view then adding those to a "TileView"?
    I'm trying to select many tiles that form a "T" shape In my tileset but I am limited to the "1 box" only selection.
     
  29. RV101

    RV101

    Joined:
    Apr 10, 2016
    Posts:
    3
    @CreativeSpore hey there, thanks for this amazing plugin, I'm really liking it so far! I did run into a small problem however. In my game I want a gameobject to make its way to the position of a mouse click while evading obstacles. I was wondering if you know of any pathfinding techniques that could use the colliders of the tilemaps. Alternatively, would you know any plugins / assets that can make use of the tilemap colliders out of the box?
     
  30. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    That's your these ideas.

    Hide the tiles of the brush that are out of the map bound would be difficult to achieve because the brush is like another hidden tilemap, and is not easy to hide/unhide tiles in real time. Unless there is a very important reason to do that, It's better to draw all the brush even if you are outside of the map.
    What I could do is give some feedback like tint it red of something, but I thinks it depends on user likes.

    About spawning the prefab during load/runtime because you could change it later. You can change any property of the prefab data of a tile, like the prefab offset or the prefab created used by that tile and press the "Map/Refresh Map" button and changes will be applied, including changing the created tile objects using the new prefab.

    This is why after removing the prefab you have to "Refesh Map" to make these changes happen.
     
  31. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    Hi there,

    I've been working on it before answering and I have added the option to create a tileview from a tilemap selection.
    Also, I am going to change also painting empty tiles of the brush, so you can select a rectangle of tiles, like the T shape and paint it later without erasing the the tiles that are not part of the T shape.
    Next release will have this new feature.
     
    zwickarr likes this.
  32. Mijago

    Mijago

    Joined:
    Mar 27, 2016
    Posts:
    11
    Imagine you create a 2d Runner and you have 2 Themes - Snow and Dirt. And you want to create the transition smoothly..
    Then you have 2 Border-parts because currently the brushes only search for themself and not for other brushes :/
    So I mean you can link 2 or more Brushes together so they recognize the other brushes in the list and handle like there is the same brush...

    Hmmmmm Sorry I do not know how to explain thus correctly.. But you can try to do it with the 2d runner example :D
     
  33. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    I get you! You want to specify something like what brushes are 'friends' of this brush.
    I will think about this. I could be easy to achieve for the next release.
     
  34. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    I've been making some research on this and it looks like Unity create a navigation mesh based on scene meshes but not MeshColliders, what I create for map collisions. I will try to add some support to create a navigation mesh, but it will take a while.

    Other option would be using simple path finding solution based on the map grid using this script to check if a world position is passable or not based on the tile collider information.

    Code (CSharp):
    1.  
    2. Vector3 vWorldPos = transform.position;
    3. uint rawTileData = tilemap.GetTileData(vWorldPos); // if you know the character position use this
    4. //rawTileData = tilemap.GetTileData(10, 20); // if you know the grid position use this (for example for gridX = 10 and gridY = 20)
    5.  
    6. TileData tileData = new TileData(rawTileData);
    7. bool isTilePassable =
    8.     tileData.tileId != Tileset.k_TileId_Empty? // is the tileId empty? it means there is an empty tile here, like an alpha color in an image
    9.     tilemap.Tileset.Tiles[tileData.tileId].collData.type == eTileCollider.None
    10.     :
    11.     false;          
    12.  
    This code will set the isTilePassable to true if the tile in the specified position ( in world units or grid units ) has a tile with no colliders on it. This way you can check if a position is passable or not.

    I know there are some assets in the store for path finding, but I didn't try them so I can not tell you if they will work.
    But technically, any asset able to create a nav mesh from a mesh collider should work with Super Tilemap Editor.
     
    RV101 likes this.
  35. RV101

    RV101

    Joined:
    Apr 10, 2016
    Posts:
    3
    @CreativeSpore wow, thats a quick reply! I will take a look at your script and the other possible solutions, thanks for the help! The main problem is that I want the gameObject to move freely through the world and not be constrained to the grid.

    One solution I found is giving a tile a prefab which has a mesh in the shape of the tile collider, but I'm not sure how great that would be performance wise. Of course the prefabs could be removed after the navmesh has been baked, but that would be a hassle if the tilemap needs to be changed late in development.

    If the tilemap would work with the unity navmesh then that would be fantastic, but I can understand that developing such a feature might take a very long time or be impractical for you to spend development time on.
     
  36. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,208
    I want to create a carpet brush. i have left, buttom and buttom corners. if i can rotate the left sprite i can get the right sprite. is it possible to use rotated versions when creating carpet brush?
     
  37. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    Not right now, but I am working on some improvements in brushes for next release and I will add this option as well.
     
  38. Async0x42

    Async0x42

    Joined:
    Mar 3, 2015
    Posts:
    104
    For me at least, the red tint would work (that was my second idea actually, as a last resort).

    About the prefabs, thanks, I didn't realize that's what the button was for. As an alternative we have an option to auto-refresh prefabs on a change then? I think that'd make it a bit more intuitive.
     
  39. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    I thought about the auto-refresh, the problem is, for small maps it could be ok, but for big maps it could be a performance killer. But I will think a good solution for this.
     
    Async0x42 likes this.
  40. Async0x42

    Async0x42

    Joined:
    Mar 3, 2015
    Posts:
    104
    I did end up having issues with the Polygon Collider workaround, as seen here:



    I can't move onto the X if the polygon colliders are complete at the top. If I remove the O tile collider, then I can move onto the X. Removing any other single collider doesn't allow me to move onto the X, only removing the O allows me to.

    I reworked things to just use raycasts for now, but wanted to confirm that I did end up having some sort of issue with it!
     
  41. MetaMythril

    MetaMythril

    Joined:
    May 5, 2010
    Posts:
    150
    @CreativeSpore Interesting tool you have here! Definitely looking at grabbing it but I have a concern. You mention "optimization for mobile", can you explain in what way it is optimized? My main concern is with creating a large map and having the whole map being rendered by Unity constantly. What steps does your tool take to reduce draw call overhead at runtime for large maps?
     
  42. Mijago

    Mijago

    Joined:
    Mar 27, 2016
    Posts:
    11
    One, easy-to-do-thing is adding a simple int-field to every brush and then you can check whether the int of the other brush is the same as the int of the current brush..

    Another idea would be adding Brush-Groups.. But that is far more complicated for that i guess.

    Edit #1
    Oh and i just got an issue with Lighting..
    In my tests the TileMaps can only be lit from behind and that is a bit weird oô

    Edit #2
    Okay, I got around this by simply rotate the map(s) by 180 degrees.
    But now this happens if I use a directional light. If I use a point light, everything is Ok
    Only Directional Light:

    Only Point Light:

    Point and Directional Light:
     
    Last edited: Apr 17, 2016
  43. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    Thanks for telling me. I will check that to see if there is any solution.
     
  44. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    Hi there,

    The asset is optimized in several ways:
    First, the tile data (what tile is in each cell, the rotation and flipX or flipY attributes and the brush used to draw the tile is all stored in a single integer of 32bits)
    It means, the size of the maps are really small and there is a very good performance in all operations with tiles.
    For mobile it is also important using few draw calls and for this, the tilemap is divided in chunks what means a single draw call for each rendered chunk of 60x60 tiles but you can change this value (this is a safe value to make sure you never have more than 65535 vertices, 4 vertices per tile ~127x127 maximum).
    Unity will render only the chunks inside the camera frustum and some management like updating animated tiles will be updated only for rendered chunks.
    The creation of colliders 2D or 3D is also optimized to be created in real time and only for chunks affected by the modification.
    Think in each chunk of tiles like a small tilemap with auto management improving the performance by using a small amount of memory data in tile operations (60x60(tiles)x4bytes(tileData) = 14400bytes) what reduces cache misses and improve the performance.
     
    MetaMythril likes this.
  45. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    I found the problem with lights. This will be fixed in next release but it's easy to fix.
    Go to TilemapChunk.cs and change the order of the triangles vertices for these ones in method _AddTileToMesh:
    Code (CSharp):
    1.  
    2. m_triangles.Add(vertexIdx + 2);
    3. m_triangles.Add(vertexIdx + 0);
    4. m_triangles.Add(vertexIdx + 1);
    5. m_triangles.Add(vertexIdx + 0);
    6. m_triangles.Add(vertexIdx + 2);
    7. m_triangles.Add(vertexIdx + 3);
    8.  
    EDIT: also add mesh.RecalculateNormals(); in method UpdateMesh():
    Code (CSharp):
    1. if (m_needsRebuildMesh)
    2. {
    3.     m_needsRebuildMesh = false;
    4.     if (FillMeshData())
    5.     {
    6.         Mesh mesh = m_meshFilter.sharedMesh;
    7.         mesh.Clear();
    8.         mesh.vertices = m_vertices.ToArray();
    9.         mesh.uv = m_uv.ToArray();
    10.         mesh.triangles = m_triangles.ToArray();
    11.         mesh.RecalculateNormals();
    12.     }
    13.     else
    14.     {
    15.         return false;
    16.     }
    17. }
     
    Last edited: Apr 18, 2016
    Mijago likes this.
  46. MetaMythril

    MetaMythril

    Joined:
    May 5, 2010
    Posts:
    150
    Thanks! That sounds perfect!
     
  47. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    I am preparing a big update for next version of Super Tilemap Editor.

    Here there is an advance of some of the new features:

    Tilemap Groups

    Same as a tilemap with layers, I use instead an object to manage a group of tilemaps the same as if they were layers.
    You can add and remove layers and change the name or any property directly though the reorderable list.
    upload_2016-4-23_16-4-33.png

    Add brush selection to a tileview to create tile prefabs

    upload_2016-4-23_16-12-17.png


    Brush groups for advanced autotiling:
    • Autotiling Modes: self, other and group
    • Brush group autotiling mask (similar to physics collision mask but with brush groups)
    Default autoling mode will be self ( autotiling with neighbor tiles of the same type ).
    But you can choose other to allow autotiling with any not empty tile.
    And/or group autotiling and set what groups autile between them.
    These modes can be activated independently.

    upload_2016-4-23_16-53-9.png

    You will be able to set flags for flipping or rotating brush tiles and also set a linked brush, to make other brush, like a random brush, to draw a tile from another brush, like a carpet or road brush


    So you can now select another brush to draw a carpet or road brush tile, for example, to create a road with random corner tiles, or random middle tiles in carpet brushes. And flip or rotate the tiles to create more variety of tiles.
    demoCarpetRandomBrush.gif
    upload_2016-4-23_16-32-44.png
     
    zwickarr and Async0x42 like this.
  48. Klyntoc

    Klyntoc

    Joined:
    Apr 17, 2016
    Posts:
    5
    @CreativeSpore hey there, so far the tool is great but I have a question about using the colliders. Before getting this tool I was using a 2D polygon collider for the level with a Surface Effector 2D component to handle friction so my player doesn't get stuck on the walls. However, since the Tilemap object doesn't have a 2D collider component I don't see a way to use this method.

    Is it possible to allow adding components to the collider?

    Thanks
     
  49. Async0x42

    Async0x42

    Joined:
    Mar 3, 2015
    Posts:
    104
    Could a quick way to access a tile property be added? i.e. for configuring colliders, it'd be nice to right-click a tile in the tileset view, then open the tile property window instead of going through the main Unity menu.

    The upcoming update looks great!

    Edit: Also, for multi-tile selection when editing colliders, currently it shrinks the tile size when multiple are selected, but I think it should display all of the tiles you have selected (shrunken, so that they fit)
     
  50. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,193
    Hi there,

    I am working on adding polygon collider support for 2D colliders. But right, when you use 2D colliders, the colliders generated ar Edge colliders. You can change it until I add support for that by changing the few EdgeCollider2D references to PolygonCollider2D.

    About adding a surface effector. I will try to explain how a tilemap is made.
    The tilemap is divided in chunks of 60x60 tiles (a gameobject as children of tilemap gameobject). This is made like this because there is a limit of vertices in a mesh, so all tiles can't be in the same mesh. Also for performance reasons, it's faster split the tilemap in chunks.
    The chunks are hidden, so you don't see them when using a tilemap. Each chunk has its own colliders created according to tile collider information. In case of 2D they are edge colliders. There will be more or less edge colliders depending on needed geometry. You could unhide the chunks, select the edge colliders and set "used by effector" and add an effector to each chunk.
    To unhide the chunks just add gameobject.hideFlags = HideFlags.None; at the beginning of method UpdateMesh in TilemapChunk.cs.

    But I will take your request into account to find a better way to add surface effectors easily in a tilemap.

    Regards.