Search Unity

[RELEASED] Super Tilemap Editor

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

  1. Gemfruit

    Gemfruit

    Joined:
    Sep 15, 2013
    Posts:
    10
    I just wanted to let you know that I've had this item in my wish list for quite some time, and am going to be buying it now. I just read the last 2 pages, and your support is phenomenal. The product seems extremely powerful, and I'm confident in your ambition and response times that you won't be abandoning the project any time soon.

    One quick question as I haven't seen anything mentioned yet - does this play well / compliment the latest 2D additions to Unity? Keep up the great work!
     
  2. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    524
    Hi,

    I have seen a lot of question regarding pathfinding and it seems that found solution are based on colliders or meshes. Will it be possible to compute the shortest path using an algorithm based on the grid tile properties ? The point would be able to grab an standard A* pathfinding algo and feed it with a data structure generated from STE. Does that make sense ?
     
  3. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    Hi there!
    I don't see the relation between this question and Super Tilemap Editor. Are you sure you are in the right forum?
    If you can give me more details I could help you more. The most closest answer I can give you is if you mean if you can use the tilemap editor to place a player in the scene and the answer is yes. You can attach prefabs to the tiles and instantiate the prefab instead of a tile using the grid layout. And the prefab can be a player with multiple animations.
     
  4. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    Hi there!
    Thanks for looking into this tool and for supporting it.
    I have plans to improve it and to keep it updated with last Unity features, like composite colliders that could be really useful.

    Right now I am working on giving support to tilesets made of sprites (instead of using a single texture) and support for hexagonal and isometric tiles.

    Also I will remove some warning appeared when using Unity 5.6.
     
  5. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    Yes, you can create an A* pathfinding based on a grid.
    Most A* algorithms have an interface with a method to get if a tile of position is passable or not.
    Something like IsPassable(int gridX, int gridY).
    If you have a reference to the tilemap, you can use this line to check if a tile is or not passable:
    Code (CSharp):
    1. Tile tile = tilemap.GetTile(gridX, gridY);
    2. if(tile != null && tile.collData.type == eTileCollider.None)
    3.     return true;
    4. else
    5.     return false;
    This will return the tile is passable if the tile has no colliders.
     
  6. BARKx4

    BARKx4

    Joined:
    Mar 29, 2017
    Posts:
    12
    Is there any particular A* or other third party pathfinding library you would personally recommend to use with this system? I am having a lot of trouble adapting most of the common packages to this tile system as well like the previous poster. Thanks!
     
  7. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    In my experience with previous issues posted in the forum, the problem with most of them is, they use raycasting and they expect to find a collision to detect with a position is or not passable.

    The colliders for the tiles in 3D and 2D using edge colliders is, the collisions are placed in the tile sides, not in the interior.
    But using 2D polygon colliders, the raycast will detect a collision inside of the tile.

    As I said, any A* pathfinding system using an interface to check the tile position is passable or not would be easy to adapt. Or using 2D Polygon colliders or using a raycast system to check if the tile position is inside a collider or not, using something like this:
    http://himangi774.blogspot.com.es/2013/07/how-to-check-if-given-point-lies-inside.html
     
  8. Michoko

    Michoko

    Joined:
    Apr 15, 2017
    Posts:
    11
    Hi,

    I'm a new to Unity, but a long-time developer in other languages/frameworks. I now want to create a platformer/metroidvania game, and your STE asset seems really good. Moreover, by reading this thread, I find your support to be totally amazing. So congratulations!

    I had a look at different solutions for tile mapping. I was first attracted to 2D Toolkit, as I liked their color painter, to create fake lighting over the map. I wanted to know if STE offered a similar feature, or would offer it soon. Not just tint the entire tiles, but more to bake lighting, so it can cover tiles partially (great for making torches glows for example). Please have a look at this example here: http://2dtoolkit.com/docs/latest/tilemap/img/tilemap_colorpainted.png

    Does STE allow to do something similar? Is it also possible to access the tile color at runtime, to know if the area is "lighted" and then apply the same effect to the player sprite?

    Thank you! :)
     
  9. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    Hi there!

    Right now you can set the tile color for the whole tile or for each corner of the tile using the method SetTileColor inside the Tilemap class.
    I have also added the GetTileColor method in the next release to be published during the next week.

    The idea is also use a vertex paint mode in the inspector. I hope it will be released soon.
     
  10. Michoko

    Michoko

    Joined:
    Apr 15, 2017
    Posts:
    11
    OK thank you very much! :)
     
  11. SingularitySystems

    SingularitySystems

    Joined:
    Feb 10, 2014
    Posts:
    48
    I'm working on integrating STE into my pipeline. Building a Navigation Matrix that handles pathfinding for several different map editors... Would it be possible for you to add a Delegate that listens for when a tile is painted onto or erased from the map? (Having it integrated into the main build would mean I didn't have to re-add code every time I update the project.)

    Currently while in editor I have to manually clear and reset the data every time I draw data, having a hook-in would save me several steps. (It means a lot when I'm doing rapid fire iterations when debugging pathfinding)

    My Solution looked like this:
    Tilemap.cs: Line ~720
    Code (CSharp):
    1. public delegate void On_TileChange(int gridX, int gridY);
    2.         public On_TileChange on_TileChange;
    Tilemap.cs: Line ~733 (After Last Edit)
    Code (CSharp):
    1. if (on_TileChange != null)
    2.                 on_TileChange.Invoke ((int)vLocalPos.x, (int)vLocalPos.y);
    Tilemap.cs: Line ~766 (After Edit)
    Code (CSharp):
    1. if (on_TileChange != null)
    2.                     on_TileChange.Invoke (gridX, gridY);
     
  12. milkcorp

    milkcorp

    Joined:
    Feb 26, 2012
    Posts:
    11
    Hi,
    I just have purchased Super Tilemap Editor.
    It seems doesn't have sprite packer,
    So I want to know what is the best way to create atlas texture for this?

    Thanks,
     
  13. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    I thinks it's a good idea.
    I have added a delegate changing it a little from your version, but it should work the same:
    upload_2017-4-18_21-19-5.png

    upload_2017-4-18_21-19-43.png
     
    SingularitySystems likes this.
  14. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    Hi there!

    This is going to be supported in a future release, but right now, you need to use a single texture per tileset and slice it.
    I am not sure if this is the best way, but you can use this tool to create a tileset texture using several images.
    http://renderhjs.net/shoebox/
     
  15. SingularitySystems

    SingularitySystems

    Joined:
    Feb 10, 2014
    Posts:
    48
    Looks great!

    This is what it looks like while running:
     
    CreativeSpore likes this.
  16. milkcorp

    milkcorp

    Joined:
    Feb 26, 2012
    Posts:
    11
    Thank you! I'll check it out.
    I'm also looking forward to atlas feature.
     
    CreativeSpore likes this.
  17. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    It looks really nice, thanks for sharing it and good job ;)
     
  18. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    778
    Hi, I bought your plugin and it seems great. I have one question though. I currently don't have the graphics or the final tileset for my game. What do you recommend as a pipeline to keep adding more tiles and maintaining a tilemap where the tiles keep the same spot? i.e. I want to keep updating my tileset throughout development without affecting the positioning of previous tiles.
     
  19. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    Hi there,
    The tiles takes their id from the position in the tileset.
    This position is taken from top to bottom and from left to right.
    So if you want to add more tiles later you can use a texture with some empty spaces. If you slice the texture using the tileset slicer the empty tiles will be included (not like using the unity sprite editor).

    If you need a bigger texture you can increase only the heigh to keep the same tile id for previous tiles after slicing it again.

    Also remember to answer yes to the question to keep the previous tile properties when you slice the atlas again.
     
  20. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    778
    @CreativeSpore Thanks for the answer. Although it seems it would be easier if we could simply choose the "single" sprites to be included in the tileset. And then the plugin would assemble the tileset in the background. This way we could add as many tiles as needed and not worry about leaving empty spaces in case we need them later.
    Would something like this be possible?
     
  21. Andrew122222

    Andrew122222

    Joined:
    Jul 8, 2012
    Posts:
    28
    Ah ok. Is it possible to get a feature request such that the animation fps be local to each instance of a tilemap? It'd be nice to be able to modify animation speeds per instance (rather than globally for everything that uses the brush). Also, being able to enter a negative FPS to reverse the animation would be useful too.

    Something to this effect:
    Code (CSharp):
    1. CreativeSpore.SuperTilemapEditor.Tilemap tileMap = GetComponent<CreativeSpore.SuperTilemapEditor.Tilemap>();
    2. tileMap.GetComponent<CreativeSpore.SuperTilemapEditor.AnimBrush>().AnimFPS = 10;
     
    Last edited: Apr 25, 2017
  22. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    I am working on supporting sprites as tiles, and also integrate them with the use of sprite atlases.
    Right now it's the only way.
     
    luispedrofonseca likes this.
  23. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    It is not working like that for performance reasons. If you use a lot of animated tiles all of them would need to be updated each frame.
    But you can do what you need if you use a prefab attached to a tile with the animation.
     
  24. Andrew122222

    Andrew122222

    Joined:
    Jul 8, 2012
    Posts:
    28
    Ok no problem. Thanks for the response.

    Another question, is it possible to apply a tag to the collider of a tile itself? When I set the tilemap's tag and layer properties, only the layer properties are inherited by the collider itself (I think). So for example, if I send a raycast to hit a collider, and I want to check the tag of that collider, it will be set to "untagged" as opposed to the tag of the tilemap. Is it possible to set the tag for the collider itself?

    At the moment I can only achieve this by checking the parent of the collider (which is the tilemap). I don't want to do it this way though.
     
  25. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    I will check it.
    I don't think it will be complicate to change.
     
  26. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    778
    @CreativeSpore Is it possible to eliminate the seams between tiles that appear when zooming the camera in and out?
    I know it's possible to minimize the effects by adding an extra pixel around the tiles, but ideally I'd like to avoid that.
     
  27. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    You can avoid adding extrusion by activating pixel snap in the tilemap and by using a pixel perfect camera. Take into account the lines could appear in the Scene View but not in the Game View. Also don't use a free aspect ratio but the final resolution to be sure there are no lines in the final game.

    For the pixel perfect camera, there some examples out there, basically you need to snap the position and zoom to be sure the pixels fits in the screen pixel grid.

    And finally, an easy solution would be to use Inner Padding. You can find it in the tilemap options. It will take an stretched uv rect to render the tile. A value of .5 should work in most cases.
     
    luispedrofonseca likes this.
  28. ury2ok2000

    ury2ok2000

    Joined:
    Dec 29, 2012
    Posts:
    41
    Hello i am having issues with the meshfilter in tilemap chunk(s). I am using another asset (sprite mask) which accepts a custom mesh. It actually works fine in the editor. However once i hit play the meshfilter is erased (essentially erased, as its turns into a 1 square mesh 2 vert or whatever). Again this is only when i hit play. I'm not sure if SuperTileMapEditor is doing this or the SpriteMask asset is. Any thoughts?
     
  29. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    778
    @CreativeSpore Is it possible to change the map origin? My map needs to be centered around (0,0) which creates 4 chunks. Would it be possible to change the origin to say (-20, -20) so it only creates one chunk?
     
  30. CreativeSpore

    CreativeSpore

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

    For optimization reasons the mesh filter is not saved with the scene. It allows the scene file to be smaller.
    But you can change that and it should work fine if you change this line of code:
    upload_2017-5-8_21-35-0.png
     
  31. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    Yes, you can change the origin changing the position of the tilemap.
    Also, you can change the position of the tilemap group to avoid changing the position of all the maps. Or place the map in a parent object with the offset position.
    upload_2017-5-8_21-37-48.png
     
  32. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    778
    @CreativeSpore Changing the position of the tilemap GameObject was not what I was referring to. I'm familiar with the Transform component, but thanks for the detailed explanation. :)

    What I meant is that if I create a tilemap that has 4 tiles, one on each quadrant of the position (0,0), your plugin creates 4 chunks, as shown on this image:
    Screenshot 2017-05-09 11.20.18.png

    Is there a way to move the origin of those chunks to something other than (0, 0)?
     
  33. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    No, at least, not easily. But you can use a wrapper, for example a method so when you place a tile in the position (-1, -1) it adds an offset, ex: (+30, +30), to center the tiles in the center of the chunk at (0, 0).
    If you can describe what you want to achieve or how are you placing the tiles, I will try to help you more.
     
  34. felixwaffle

    felixwaffle

    Joined:
    Feb 17, 2014
    Posts:
    2
    @CreativeSpore
    Hey, I am trying to create a tileset from a TMX file created in Tiled. When I select my TMX file unity displays a white box and pinwheels before giving me an exception:

    NullReferenceException: Object reference not set to an instance of an object CreativeSpore.TiledImporter.TmxMap.FixExportedTilesets (System.String relativePath) (at Assets/CreativeSpore/SuperTilemapEditor/Scripts/TiledImporter/Editor/TmxMap.cs:56)
    CreativeSpore.TiledImporter.TmxTilemap.LoadFromFile (System.String sFilePath) (at Assets/CreativeSpore/SuperTilemapEditor/Scripts/TiledImporter/Editor/TmxTilemap.cs:91)
    CreativeSpore.TiledImporter.TmxImporter.CreateTilesetFromTmx () (at Assets/CreativeSpore/SuperTilemapEditor/Scripts/TiledImporter/Editor/TmxImporter.cs:28)


    Any idea how i can proceed?
     
  35. sygaki786

    sygaki786

    Joined:
    Jan 26, 2014
    Posts:
    141
    Hi. I just purchased this product. I want to use my prefabs as a brush since they have the colliders and the tags, layers, scripts already set. I only see an option to import an atlas in the tileset. How do I just drag my prefabs into a tileset and use them to paint?

    Thanks,
    Arshad
     
  36. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    Hi there,
    Her are the steps to attach a prefab to a tile.
    upload_2017-5-10_20-20-15.png

    If you want to display the prefab preview, mark the option below the prefab. You can then use an empty tile and use the prefab to render the preview:
    upload_2017-5-10_20-21-30.png
     

    Attached Files:

  37. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    I think the problem is the tileset image was not loaded for some reason. Could you send me the tiled project you used to import the tileset? I could check it and see why it is not loaded.
     
  38. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    778
    Hi, is there any built-in tool to use a pool system for prefab instantiation?

    I'm loading scenes additively and each scene has a tilemap. On each map there's a collection of coins that I want to be prefabs from a pool. What do you recommend to achieve this?

    [EDIT]

    To achieve this I created an invisible tilemap and added my coins to it. Then I have an editor script that goes through all tiles and extracts the tiles information. However, I'm having some troubles and inconsistencies when doing that. I'm doing:
    Code (csharp):
    1.  
    2. for (int i = 0; i < tilemap.GridWidth; i++)
    3.                     {
    4.                         for (int j = 0; j < tilemap.GridHeight; j++)
    5.                         {
    6.                             var pos = new Vector2(i, j);        
    7.                             Debug.Log(tilemap.GetTile(pos));
    8.                         }
    9.                     }
    10.  
    But the results are far from consistent with what I see on screen. Sometimes I get a null where it should be a non-empty tile. Please advise.
     
    Last edited: May 11, 2017
  39. CreativeSpore

    CreativeSpore

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

    To iterate a tilemap, you can use these methods in the class TilemapUtils:
    static public void IterateTilemapWithAction( Tilemap tilemap, System.Action<Tilemap, int, int> action )
    static public void IterateTilemapWithAction(Tilemap tilemap, System.Action<Tilemap, int, int, uint> action)

    If you are not familiarized with Actions, this is how you can iterate a tilemap:
    Code (CSharp):
    1.  
    2. //MinGridX,Y and MaxGridX,Y are the limits of the tilemap. You can modify the limits manually or automatically when painting a tile outside of the current limit.
    3. for(int gy = tilemap.MinGridY; gy <= tilemap.MaxGridY; ++gy)
    4. {
    5.     for(int gx = tilemap.MinGridX; gx <= tilemap.MaxGridX; ++gx)
    6.     {
    7.         Tile tile = tilemap.GetTile(gx, gy); // get a tile using grid coordinates, not positions
    8.          if(tile != null) // the tile could be null, if the position is empty
    9.          {
    10.              Prefab prefab = tile.prefab; // if the tile is not null, the prefab can be accessed
    11.              //---
    12.          }
    13.     }
    14. }
    15.  
     
  40. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    I have attached the fix. Let me know if you find any other issue.
     

    Attached Files:

  41. jessejarvis

    jessejarvis

    Joined:
    Aug 9, 2013
    Posts:
    277
    Last edited: May 15, 2017
  42. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    The colliders in STE are placed in hidden children gameObjects for chunks of 60x60 tiles. If you make the tilemap static, the children gameObject should be static as well.

    To create a navigatiom mesh you need to add a collider to the tilemap or a plane with a collider for the floor. The colliders generated for the tiles are like walls, perpendicular to the collider.

    Also, you need to rotate the tilemap to be placed in the XZ axis, rotating 90 or -90 degrees the X axis.

    I didn't try this in a while but it should work.
     
  43. jessejarvis

    jessejarvis

    Joined:
    Aug 9, 2013
    Posts:
    277
    It just creates a navigation mesh of the whole map. Included the colliders, I'm trying to add colliders to water so the player can walk on the grass.
     
  44. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    Check the roguelike demo. If you add colliders to the water tiles and place the player over the grass it won't pass into the water, and if you place the player in the water, in a boat, it won't be able to go out.
     
  45. jessejarvis

    jessejarvis

    Joined:
    Aug 9, 2013
    Posts:
    277
    I'm using uMMORPG so I need to use Navmesh. Does this work with Navigation? Like I said it doesn't do anything about the colliders, it just makes the whole map (water and grass) Walkable.
     
  46. sygaki786

    sygaki786

    Joined:
    Jan 26, 2014
    Posts:
    141
    Hi. I am having a tough time slicing the tileset properly. I have tiles from different tilesets and so they are different sizes. So when I finally pack into an atlas, they don't slice properly if I set the size to 32*32 for instance. What is the best way to handle this?

    Thanks
     
  47. ury2ok2000

    ury2ok2000

    Joined:
    Dec 29, 2012
    Posts:
    41
    Question on using the character controller. On death I want to turn off the ability to control the character , and throw him/her away from death impact point. Then once the body comes to rest , reset position and give player back control of character. I tried a couple of things but none worked well (such as turning off the controller etc but when I re-enabled the character there would be like ghost movement it was never still). Any recommendations?
     
  48. sygaki786

    sygaki786

    Joined:
    Jan 26, 2014
    Posts:
    141
    Can I use sprite sheets which have already been sliced? I have the attached sprite sheet (Test2.png) which slices out correctly in the Unity slicing tool. But as soon as I drop it in the Tileset, I just can't seem to get the sizes proper, starting with the regular 32*32. Please advise. Thanks.
     

    Attached Files:

  49. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    Yes, you are right, the navmesh uses the mesh renderer to create the navmesh, so it will only create the floor but not the walls because the meshcollider is not taken into account.
    Right now I think it is not possible to generate the navmesh for the tile colliders. But I will take this into account for a future release.
    And way to achieve this would be adding an invisible box as prefab of water tiles. The invisible box will be taken into account when the navmesh is generated. I guess you can remove then the prefab once the process is completed.
     
  50. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,095
    Hi there,
    I've been trying to slice the texture Test2.png, but it looks like the layout is not perfect. First of all, the tiles look like they are 70x70 pixels size with a padding of 2x2 pixels but it only work until the last column of tiles.
    upload_2017-5-17_20-38-30.png

    Where did you take this atlas texture? Maybe you should take the one in the Tilesheet folder of Kenney's folder.