Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

[RELEASED] Super Tilemap Editor

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

  1. ralphyua

    ralphyua

    Joined:
    Mar 28, 2017
    Posts:
    20
    I am using Unity version 2017.2.0f3 and using STME v1.4.3.4

    I will try updating STME to see if that fixes the problem. I searched for "Tilemap.Update" in the files and didn't come up with anything. Not sure where this Tilemap.Update() function actually exists.
     
  2. ralphyua

    ralphyua

    Joined:
    Mar 28, 2017
    Posts:
    20
    So I updated STME. I deleted the project library so that Unity would rebuild the cache files. I am now getting this error:

    NullReferenceException: Object reference not set to an instance of an object
    CreativeSpore.SuperTilemapEditor.TilemapChunk.OnWillRenderObject () (at Assets/_AssetPackages/CreativeSpore/SuperTilemapEditor/Scripts/Tilemap/TilemapChunk.cs:132)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    When I click on that error, it brings me to this line of code:

    static Dictionary<Material, Material> s_dicMaterialCopyWithPixelSnap = new Dictionary<Material, Material>();
    void OnWillRenderObject()
    {
    if (!ParentTilemap.Tileset) //This line specifically is what is causing the error!
    return;

    Really not sure how to fix this problem. Any thoughts on what could be causing it?
     
  3. ralphyua

    ralphyua

    Joined:
    Mar 28, 2017
    Posts:
    20
    Actually this is the error:

    NullReferenceException: Object reference not set to an instance of an object
    CreativeSpore.SuperTilemapEditor.TilemapChunk.OnWillRenderObject () (at Assets/_AssetPackages/CreativeSpore/SuperTilemapEditor/Scripts/Tilemap/TilemapChunk.cs:132)
    UnityEngine.GUIUtility: ProcessEvent(Int32, IntPtr)

    I hate these automatic emoji things.

    Okay, did a search on TilemapChunk.OnWillRenderObject and found this answer in this thread:

    https://forum.unity.com/threads/released-super-tilemap-editor.387330/page-18#post-3236700

    After renaming that file, everything works fine now. The update got rid of that Profile Sampler warning I was getting as well. So for anyone updating from an older version, make sure you rename the Tilemap.cs file to STETilemap.cs and make sure the class name is STETilemap.
     
    Last edited: Sep 1, 2018
    CreativeSpore likes this.
  4. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    Thanks for telling about this bug. I have fixed it in the attached package.
     

    Attached Files:

  5. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    I am afraid, it is not possible to name tiles. You could paint on the tileset texture and change the prefab properties to display the tileset tile instead for the preview.
     
  6. CaptCollins

    CaptCollins

    Joined:
    Jan 27, 2016
    Posts:
    9
    Without reading through this entire forum, are there any general dos and donts for using this asset? Since I got it a year ago, ive constantly had problems with ugly lines between tiles and similar issues. If pixel snap fixes 1 issue another pops up in its place. The tutorials werent much help. Does decreasing pixels per unit mess with something? It's not a padding or offset issue.

    To clarify, pixel snap fixes tearing but usually messes with my tiles making them carry on to other tiles, even though the padding and offsets look correct.
     
    Last edited: Sep 5, 2018
  7. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    Pixel Snap doesn't work very well with tiles. It is because it creates a separation between tiles. I added it before knowing this fact and kept it in the options, but it is not a good option.

    You have two ways to remove lines between tiles:

    First of all, uncheck Pixel Snap and be sure the texture Filter mode is Point (no filter), or just press the button in the tileset inspector view:
    upload_2018-9-5_17-18-46.png

    Now you have two options:
    • Set the Tile Inner Padding to value like 0.2
    upload_2018-9-5_17-22-49.png
    • Use the Atlas Editor Window to extrude the tiles
    upload_2018-9-5_17-28-54.png
     
  8. CaptCollins

    CaptCollins

    Joined:
    Jan 27, 2016
    Posts:
    9
    The inner padding crops my tiles? The more padding I have the more the tearing goes away, but it's clipping the edges of my tiles. And the more the resolution gets bigger, the more padding I need to not see tearing?
     
  9. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    Yes, Inner Padding is a fast way to fix the lines by cropping the tiles a little (really, it crops the UV rect).
    There is a third method to remove the lines and it is using a pixel perfect camera.
    And, if with more resolution you mean zoom out (so the tiles are smaller) you need to adjust the extrude padding or inner padding to be greater. Usually, in tile based games, you ended by using a pixel perfect camera and a constant zoom or integer zoom like 1x, 2x, 3x, etc.
     
  10. CaptCollins

    CaptCollins

    Joined:
    Jan 27, 2016
    Posts:
    9
    Turning off anti aliasing in unity seemed to have fixed everything? Working great thanks.
     
  11. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    I forgot that one. Some quality settings in Unity enables Anti-Aliasing in textures and could create gaps between the tiles.
    I wrote about that in a tweet that could be interesting to check if you want to create your own pixel perfect camera.
    https://twitter.com/CreativeSpore/status/1018408144689647616
     
  12. andympage101

    andympage101

    Joined:
    Jun 7, 2013
    Posts:
    12
    Hi, apologies if this has been answered before, I am working on a game which has some procedural generation, this means each room will effectively be a different tile group.

    At the moment every tileset under the tilegroup consumes draw calls. I saw it mentioned briefly but is there a way to merge the tilesets with the same material so they consume less draw calls?

    Thank you
     
  13. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    At the moment you change the texture of the material, a new draw call is performed.
    Anyway, the drawcalls are also limited by the number of vertices in the mesh and tilemap chunks are close to the limit, so it is already consuming few drawcalls.
    If you want enable Unity dynamic batching, the chunks should have a size of 8, but changing this will make all previous tilemaps incompatible with the new size:
    upload_2018-9-6_11-38-55.png
     
  14. ralphyua

    ralphyua

    Joined:
    Mar 28, 2017
    Posts:
    20
    How do I uncheck pixel snap? Every time that I uncheck it, leave the scene, then open the scene again, the pixel snap check box under the render tab becomes checked again. I thought I was going crazy for a second. Is there a reason the pixel snap setting would not save? Is there some other place that I have to uncheck pixel snap? Screen Shot 2018-09-07 at 11.20.34 AM.png

    Edit: For some reason, if you have the material set to Sprite-Default, some times the Pixel Snap checkbox does not save. I created a custom material that is a clone of the Sprite-Default, then the checkbox saved.
     
    Last edited: Sep 8, 2018
  15. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    I couldn't replicate the error. Maybe it is related with the Unity version you are using, but I added an extra check to save the value of pixel snap in the attached package.
     

    Attached Files:

  16. ralphyua

    ralphyua

    Joined:
    Mar 28, 2017
    Posts:
    20
    I've been getting some of the dreaded lines and noticing that some of the pixels are shaking or glowing as I move from left to right. So far I have:

    1. Turned the Tilemap sprites to Point no Filter
    2. Turned Compression to None.
    3. Turned off Pixel Snap for all Tilemaps.
    4. Turned off Anti_aliasing in Quality Settings

    I tried to do an Extrude using the Atlas Editor, but it screwed up all of my maps. I don't know what happened when I hit apply, but the tiles suddenly turned into a jumbled mess. It did ask me if I wanted to apply some sort of setting from the original Tileset (Don't remember the wording completely), and I clicked yes. Was I suppose to click "No"? I will try to do the inner padding trick to try and get rid of the lines. I don't think that will get rid of the strange artifacts I see when the camera moves horizontally. Is that what the pixel perfect camera is suppose to fix?
     
  17. andympage101

    andympage101

    Joined:
    Jun 7, 2013
    Posts:
    12
    Hey, Thanks very much this has worked great so far. Loving the program, hoping to use it in lots of projects :)
     
    CreativeSpore likes this.
  18. ralphyua

    ralphyua

    Joined:
    Mar 28, 2017
    Posts:
    20
    So it looks like the inner padding worked! All those nasty lines finally disappeared. The last thing I need to do is make the background tiles not blur and distort in a weird way while the camera is moving. I'm going to try the pixel perfect camera script that was posted. I haven't had much luck with pixel perfect scripts. I've tried a few, and they have all failed. Hoping this one will give me the desired results.

    Edit: So I was looking at the code that was posted in the tweet. I'm pretty confused on what some of the variables are referring to. Is there a tutorial that guides and explains step by step how this code works? Sorry, but I'm kind of a newbie to this stuff. If there isn't a guide, can someone point me to a pixel perfect tutorial that has worked for them. I remember trying several, and none of them seemed to work right. A recommendation would be greatly appreciated. Thanks.
     
    Last edited: Sep 11, 2018
  19. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    First of all, it depends on the view resolution.
    Try to play your game at full screen and you would notice it less that in a small editor view.
    The pixel perfect camera fix that snapping the position to the screen pixel grid and also changing the camera zoom so the texture pixel size is scaled with an integer value, like 1x, 2x, 3x, etc.
    In my example, you should use an integer zoom factor.
     
  20. lonehamster

    lonehamster

    Joined:
    Aug 14, 2018
    Posts:
    32
    Some help please.

    Apart from Super Tilemap Editor, what other tools would I need in order to "easily" create a game like "To The Moon"? Or would RPG Map Editor be better place to start?
     
    Last edited: Sep 29, 2018
  21. KhenaB

    KhenaB

    Joined:
    Aug 21, 2014
    Posts:
    260
    I'm getting these errors 50% of the time when I build my game, 2018.2.2f1, latest STE version no tilemaps in the scene, only way to solve it is to restart the editor and give it another try until it builds.

    Error.jpg
     
  22. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    Well, it depends on your skills and what features you need to be implemented.
    I would say, Super Tilemap Editor is a better tilemap editor that RPG Map Editor, but RPG Map Editor is more easy to use if you want to use RPG Maker style tilesets and also comes with extra features like basic player controller, AIs, path finding (this is also included in STME), etc.
     
  23. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    I am not sure what is causing those errors. It looks like a Unity bug with serialization, like if it was skipping one of the serialized fields.
    Did you downgrade your Unity version at some point? Unity doesn't support downgrading very well.
    A possible way to fix that could be closing the project, removing the Library folder, and opening it again to force a full reimport.
     
  24. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    I have fixed a bug with Unity version 2018.3.0b2 related with the Group Autotiling Mask.
    Apply the attached package to fix it if you are updated to this version.
     

    Attached Files:

  25. KhenaB

    KhenaB

    Joined:
    Aug 21, 2014
    Posts:
    260
    I've never downgraded Unity, I didn't know this was possible, I've never downgraded my projects either, I always make backups before upgrading and go back to my backup if there are issues, I also delete the library folder from time to time, I did it right now and the first build still failed, 2018.3 is still in beta so I don't want to make the switch yet, 2018.2.2f1 is really stable so I'll stick with it for a while, let me know if you need more help figuring this out.
     
  26. KhenaB

    KhenaB

    Joined:
    Aug 21, 2014
    Posts:
    260
    I'm not 100% certain because of how random it happens, but it only seems to happen when using .NET 4.x Equivalent, I've done a couple of builds with 3.5 and the error hasn't come up yet, but in a new project I can't reproduce the error, not sure why.
     
  27. noberkli

    noberkli

    Joined:
    Sep 9, 2018
    Posts:
    1
    Does this support like this size tileset... each scene tile has Main 64 x 64 pixels and with corner 16 x 16. finally, I only can slice individual by 16 x 16. so I got 16 tiles in main tiles after sliced. not 9 tiles, like your video showing...

    How to resolved?
     

    Attached Files:

  28. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    I am not sure what is causing this bug, but could be related with the use of partial classes because m_meshRenderer is declared in a partial class.
    Maybe this is something fixed in a newer version. But I couldn't find more information. Only that could be related with cloud builds.
     
  29. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    The problem here is that you should use 32x32 tiles, not 16x16.
     
  30. KhenaB

    KhenaB

    Joined:
    Aug 21, 2014
    Posts:
    260
    The problem also happens with the latest version of Unity 2018.2.11f1, can you contact Unity and see if this is something that can be solved for 2018.3? I can try and make a bug report with a stripped down version of my project.
     
  31. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    Could you try the attached patch? I have moved all serializable properties to the main class file. If it was a partial class bug, it should be fixed now.
     

    Attached Files:

  32. KhenaB

    KhenaB

    Joined:
    Aug 21, 2014
    Posts:
    260
    I'm getting an error with the patch:

    Assets\Plugins\CreativeSpore\SuperTilemapEditor\Scripts\Tilemap\TilemapChunk_TileObjFactory.cs(166,127): error CS1061: 'TilePrefabData' does not contain a definition for 'rotation' and no extension method 'rotation' accepting a first argument of type 'TilePrefabData' could be found (are you missing a using directive or an assembly reference?)
     
  33. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    Try this new package.
     

    Attached Files:

  34. KhenaB

    KhenaB

    Joined:
    Aug 21, 2014
    Posts:
    260
    I've managed to do a dozen builds without seeing the error so it seems to have fixed it, I'll let you know if it comes up again, thanks!
     
  35. NathanGroovy

    NathanGroovy

    Joined:
    Sep 9, 2015
    Posts:
    34
    I just bought and imported this from the asset store but I immediately got these compile errors:

    Assets/CreativeSpore/SuperTilemapEditor/Scripts/Tilemap/TilemapChunk.cs(209,29): error CS0117: Event' does not contain a definition forcurrent'

    Code (CSharp):
    1. Event e = Event.current;
    Assets/CreativeSpore/SuperTilemapEditor/Scripts/Tilemap/TilemapChunk.cs(210,32): error CS1061: Type Event' does not contain a definition fortype' and no extension method type' of typeEvent' could be found. Are you missing an assembly reference?

    Code (CSharp):
    1.   if (e != null && e.type == EventType.ExecuteCommand && (e.commandName == "Duplicate" || e.commandName == "Paste"))
    Assets/CreativeSpore/SuperTilemapEditor/Scripts/Utils/EditorCompatibilityUtils.cs(19,77): error CS0117: Event' does not contain a definition forcurrent'

    Code (CSharp):
    1. Handles.DotHandleCap(controlID, position, rotation, size, Event.current.type);
    Anybody know what the problem could be?
     
  36. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    Probably you have another class named Event that is not enclosed inside a name space.
    If you double click the error, select the word Event clicking on it and press F12 you will navigate to the location of the Event class that is causing the problem. Enclose the class inside a name space and that will fix the issue.
     
  37. Dweebster

    Dweebster

    Joined:
    Aug 30, 2012
    Posts:
    63
    Hey!
    I must say that I love this tool. Lovely to work with :)

    But I do have an issue, I'm trying to color the tiles from code and it works when I run the game in the editor. But if I compile to game for PC (or any other platform) then the color is ignored.
    I change the color of the grid by calling: steTilemap.SetTileColor(0, 1, Color.red, eBlendMode.AlphaBlending);

    I assume that this is not the correct way as it's not working :D Is there some other way to change colors of tiles at runtime?
     
  38. Dweebster

    Dweebster

    Joined:
    Aug 30, 2012
    Posts:
    63
    Ahh never mind! I had forgotten to call steTilemap.UpdateMesh();
     
    CreativeSpore likes this.
  39. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    No problem! Good to know you found the answer ;)
     
  40. NathanGroovy

    NathanGroovy

    Joined:
    Sep 9, 2015
    Posts:
    34
    Yeah, that's exactly what happened. Thanks for the input. Also, is there any way to use multiple tilemaps in the same tilemap group?
     
    CreativeSpore likes this.
  41. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    Good to know it was fixed ;)
    You can use multiple tilemaps in the same tilemap group, so I am not sure what you mean.
     
  42. Raseru

    Raseru

    Joined:
    Oct 4, 2013
    Posts:
    22
    There's been a bug I've noticed in STE for awhile and still present in 1.6.0, at least for me. Was curious if others get it or know about it.

    Go to paint bucket, have mouse somewhere on scene view and press control. It will paint on the screen. This can be sometimes frustrating because you are trying to press Ctrl+Z to undo something but instead it paints. Not a big deal, and the work around is just moving mouse off the scene to undo.
     
    Last edited: Oct 23, 2018
    CreativeSpore likes this.
  43. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    Thanks for telling me about this bug.
    I have fixed it in the attached package.
     

    Attached Files:

  44. GaDeMy

    GaDeMy

    Joined:
    Mar 22, 2016
    Posts:
    7
    Considering that the source code is included. How possible do you see the chance of adapting this for a 2.5D workflow? I mean swapping the 2D sprites for 3D meshes.
     
  45. XaneFeather

    XaneFeather

    Joined:
    Sep 4, 2013
    Posts:
    85
    Is it possible to attach a custom texture as an icon when attaching prefabs to a TileMap? Simultaneously, could it be possible to create an empty TileMap of set size without using a dummy texture?
    We want to split logic prefabs (puzzle triggers, etc) from regular tiles, by separating them into their own tilemap, most of which do not have a SpriteRenderer attached (e.g. Spawn Points) yet we want them to be distinguishable in the TileMap by giving them an icon.
     
  46. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    You can already use prefabs to place 3D objects in a plane (the tilemap plane) if that is what you mean.
     
  47. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    The only options to preview a tile is, showing the tile or, if you attach a prefab with a sprite renderer to a tile, you can choose to display the prefab preview instead through the Tile Property Window.
    For the last question, I am not sure if I understood you. Do you want to paint a set of tiles like painting a single tile? That is not possible, but you can use the Tile Views to save a tile configuration and you can attach any prefab to any tile to instantiate the different objects like spawners and use a sprite renderer with any icon to show it in the tile palette. Just remember to add the logic to hide the icon on instantiate or during game play.
     
  48. XaneFeather

    XaneFeather

    Joined:
    Sep 4, 2013
    Posts:
    85
    Essentially I want a preview icon without the needs of attaching a SpriteRenderer to said prefab as it is just a logic object and shouldn't be visible to the player.
     
  49. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    998
    You can use the tile where the prefab is attached as preview.
    By default, the tile is not rendered if there is a prefab attached.
    You can check it in the Tile Property Window.
     
  50. lostdragon

    lostdragon

    Joined:
    Mar 23, 2014
    Posts:
    42
    Feature request:

    Ability to start the tile ID at some arbitrary number per tileset.

    All my tilesets start at 0. I want one to start at 0, another at 650, and another at 1500 (for example).

    Reason: I have a lot of tiles across several tilesets and I was using tile IDs in a database as an index, but I can't have repeating ID numbers as I now have. As far as I can tell there is no way to set what number the tile ID starts at per tileset. It always starts at 0.

    I guess I could lump all my tiles into one massive sheet but boy is it ever going to be big.

    Edit: I can probably set up a schema in my database to handle this. That might even be the preferred method. Still would not be a bad feature to have if it's possible.
     
    Last edited: Nov 7, 2018