Search Unity

[RELEASED] Super Tilemap Editor

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

  1. SiliconAvatar

    SiliconAvatar

    Joined:
    Mar 23, 2014
    Posts:
    50
    Wow, nice update. Thanks!
     
    CreativeSpore likes this.
  2. Stab

    Stab

    Joined:
    Jan 26, 2013
    Posts:
    13
    I use DefaultSpriteLit mat. As I understand normal maps doesnt work with atlases and it is unity limitation
     
  3. Saishy

    Saishy

    Joined:
    Jun 3, 2010
    Posts:
    79
    I'm getting a null reference error after the update:



    tileBrush is null, added some variables on the watch so you can see them.
     
  4. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Apply the attached patch and let me know if you have any issue.
     

    Attached Files:

  5. Saishy

    Saishy

    Joined:
    Jun 3, 2010
    Posts:
    79
    Well, there is no error message anymore!
     
  6. Stab

    Stab

    Joined:
    Jan 26, 2013
    Posts:
    13
    Hi Creative Spore!

    After last update got error:
    upload_2020-7-28_23-3-49.png

    It appearance only if I try to use x(y)-mirrored tile with polygon collider attached.
    For example (from default tilemap PixelPlatformTilemap):

    upload_2020-7-28_23-5-46.png

    Placed normally with no errors in console.
    But if I place same tile mirrored (x or y) it cause error:

    upload_2020-7-28_23-7-54.png

    As you can see second mirrored tile placed without collider and throw error in console

    upload_2020-7-28_23-9-21.png
    These buttons used to mirror the tile.
     
  7. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Apply the attached patch and let me know if you have any issue.
     

    Attached Files:

    Stab likes this.
  8. Stab

    Stab

    Joined:
    Jan 26, 2013
    Posts:
    13
    Thank you! Fixed=)
     
  9. NikoBay

    NikoBay

    Joined:
    Aug 15, 2018
    Posts:
    39
    Hi Creative Spore,

    How can I sort objects individually like Unity tilemap?

    I have surrounding walls and a character moving around. Problem is these wall are considered as 1 object in sorting, and not individually so I can't make character appears before and below certain parts of walls when said character is lower and higher in y position respectively.

    In Unity tilemap, you can do this by change the sorting mode to Individually and walls, trees inside 1 tilemap will be sorted separately.

    Attachments for visual examples.

    Rgds
     

    Attached Files:

  10. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    You can create the tiles individually attaching a prefab to the tiles.
    The prefab should be a gameObject with the component TileObjectBehaviour.
    You can also add any other components like, for example, a sorting component to change the sorting order accordingly with the Y position.
     
    NikoBay likes this.
  11. NikoBay

    NikoBay

    Joined:
    Aug 15, 2018
    Posts:
    39
    Tks for quick reply, Creative Spore.

    Attaching a prefab to wall-tiles does fix the sorting issue.
    Is there any tips for performance efficiency when it comes to this prefab approach?
     
  12. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Yes, there is another component TileObjMesh that uses a Mesh instead of a Sprite and should be more efficient.
    Also, as all the object use the same tileset texture, it should draw all of them with a single drawcall and should be fast.
     
    NikoBay likes this.
  13. Plesioth

    Plesioth

    Joined:
    Jun 10, 2015
    Posts:
    6
    I just noticed something not particularly important. In my game, timescale slowly draws to 0 before the results screen is shown. The "problem" I noticed is that my animbrush tiles don't seem to respect timescale, and keep dancing away.
    A video can be seen here. After the door closes, up to the ending of the webm, it should slow everything down to a complete stop, but you can't stop the dance apparantly. I haven't tested if this is a case in the build yet, but it is in the editor, which seems to update animbrush really inconsistently anyways.
     
  14. antonioperez80

    antonioperez80

    Joined:
    Jun 8, 2017
    Posts:
    40
    Hello! I have tried to delete a tile but I can't do it, this error appears.


    error.jpg
     
  15. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    This happens with prefabs if you have added the instantiated tile prefabs to the tilemap prefab. Unity doesn't allow you to do that in the scene. You need to unpack the prefab first or enter in Prefab Edit Mode.
     
    antonioperez80 likes this.
  16. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Change in these lines "Time.realTimeSinceStartup" to "Time.time". It should work after that change as you wish.
    upload_2020-8-29_20-0-46.png
     
  17. Plesioth

    Plesioth

    Joined:
    Jun 10, 2015
    Posts:
    6
    Ahh, thank you. I find it wierd that it's not like this by default, or at the very least there's no option for this. Please consider making this an option in the brush setting. And thanks for everything!
     
  18. liquidsht

    liquidsht

    Joined:
    Jun 4, 2020
    Posts:
    49
    Looks like a super cool asset, do you know how it compares to Unity's own tilemap editor in terms of performance? both in the editor and in play mode? as I am making a metroidvania with possibly around 1 million tiles, if I could load everything into one scene in editor and play mode and not have to load scenes would make my life much easier. Also, when Unity's tilemap is saved as a prefeb, it slows to a crawl, does STE have the same issue?Thanks!
     
  19. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    I can tell you what other users told me about the performance, and it look like STE has a better performance.
    You can load everything in the same scene if you want.
    About editing a tilemap inside a prefab, you need to uncheck the autosave feature or it will be saving it everytime you modify it.
     
  20. Toad

    Toad

    Joined:
    Aug 14, 2010
    Posts:
    298
    Hi, does STE support isometric tilemaps?
     
  21. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    No, it doesn't
     
  22. NikoBay

    NikoBay

    Joined:
    Aug 15, 2018
    Posts:
    39
    Hi, in my iphone build, a TilemapChunk.OnEnable() creates 1.3mb GC and 8ms. What could be possibly the cause of this? And how to prevent/minimize it?
     
  23. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Yes, it is normal. Like when you are instantiating objects. A problem would be if that is generated every frame, but in this case it is part of the initialization: mesh generation, colliders, etc.
     
  24. NikoBay

    NikoBay

    Joined:
    Aug 15, 2018
    Posts:
    39
    Tks for the info (I kind of figured it out when was digging into the codes), but since I don't need TileChunk's mesh generation (I use prefabs instead) and don't have the need to get tile's info during runtime, I tried to disable TileChunk but it led to more weird bugs ^^!. Any suggestions on how to disable TileChunk's Awake and OnEnable safely?

    I think st like that could be useful to STE users. User can still work with functioning STE on editor but can strip off everything when in standalone build?
     
  25. Carnage01

    Carnage01

    Joined:
    Feb 17, 2019
    Posts:
    1
    Hi there.
    First of all, your tool is absolutely awesome and outstanding. It's a pleasure to use it.
    But I have a few issues with the editor, and hope you know how to fix them.
    1. How do I insert tiles with alpha to the same layer of tilemap? Right now I have to create separate tilemap and put such tiles there (see pic below)
    upload_2020-10-20_11-58-49.png
    2a. When I use brush to create lake or some separate figure part of a hill, I need to insert a unique piece (like a ramp to the hilltop). How do I prevent such painted lake or hill from re-drawing around this tile? (see pic below)
    upload_2020-10-20_12-0-45.png
    2b. If I have to use different layers of tilemap, how do I make a "collision cut" in place of ramp, if there is solid collision "underneath" it (on a lower layer)?
     
  26. BIGTXY

    BIGTXY

    Joined:
    Jan 20, 2017
    Posts:
    7
    Hi, adding a prefab to the tile does solve my problem, but this caused another issue since I'm saving my tilemap as prefab, so every time when I exit from the prefab mode, all my wall tile prefab's mesh (prefab + tile obj mesh) are gone, I have to click refresh tilemap to fix this issue every time i switch between scene view and prefab view.

    Any idea on how to fix this issue?

    p.s it would be really nice to have this feature to draw each tile individually without using a prefab like Unity's tilemap
     

    Attached Files:

  27. spottedzebra

    spottedzebra

    Joined:
    Oct 26, 2013
    Posts:
    39
    Hi, is it possible to mark a tile that's normally solid as non-solid? I'd prefer not to create a second tilemap or duplicate the sprites just for this purpose. For more context I have a wall sprite that's normally solid, but when painted above doors it should be non-solid so the player can pass through underneath it to the next room. There are a number of different wall types, so duplicating the artwork isn't ideal. Painting on a second tilemap without collision works but is a fiddly, bug prone workflow. Here's a screenshot illustrating things:



    In the above I have a second tilemap for the "not solid" tiles.
     
  28. Saishy

    Saishy

    Joined:
    Jun 3, 2010
    Posts:
    79
    Why are you against creating a second tilemap? They are very lightweight. It's common to have multiple tilemaps to compose a scene.

    This goes for everyone else also posting like having a second tilemap is the end of their career, it's totally normal!
     
  29. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    You could try changing this lines where the hideFlags are set to don't save:
    upload_2020-11-2_20-20-20.png
     
    NikoBay likes this.
  30. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Glad you liked the tool ;)
    About your questions, you need to use different layers in case of the alpha tile I'm afraid.
    And for the ramp, you would need to draw it in the same layer for updating the lake brush and the colliders.
     
  31. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    That's weird. I couldn't replicate the issue in Unity 2018.4.14f1. What version are you using?
     
  32. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    That would be complicated. All the tiles are in the same meshrenderer so you cannot change the sorting order of each individually unless you paint them using a prefab.
    You could create a prefab with the TileObjectPrefab component attached and attach it to the tiles you want to be painted in a different sorting layer, like the ones used on top of the walls. Look for TileObjectPrefab in this thread for a lot of examples.
     
  33. chrische5

    chrische5

    Joined:
    Oct 12, 2015
    Posts:
    52
    hello

    i have a prefab attached to a tile. when my play collides with the tile, i want to get access to this script. how can i do this? GetComponent or something like this?

    thx
    chrische
     
  34. BreadWeek

    BreadWeek

    Joined:
    Aug 12, 2014
    Posts:
    45
    Hello, ty for the asset :)

    I've been having a hard time coloring tiles correctly. In the image below, Exhibit A shows the color I have selected to paint with and Exhibit B shows the result when I color a white tile. This happens with just about any color on every tilemap and SetTileColor() gives the same results. The resulting color is usually lower in saturation and higher in value than my color.

    tilemappaintcolor.png

    This seems so simple that I must be missing something obvious. Thank you for any help.
     
  35. spottedzebra

    spottedzebra

    Joined:
    Oct 26, 2013
    Posts:
    39
    Yes, I'm going with an additional tilemap. However given my requirements there are now four tilemaps -- and I'm sure I'll come up with reasons for more as things develop. Multiply that by the number of floors in the game (likely 2 or 3) and it adds up...

    Setting aside possible perf problems the main reason I want one tilemap is to improve the workflow. It's easier to design and change things with one tilemap versus two (or four).

    If it proves too cumbersome I may end up duplicating the tiles and just defining one set with collision and one without
     
  36. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Best option would be adding the collider to the prefab instead of the tile.
    Other option would be using Tilemap.GetTileObject(player.transform);
     
  37. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    It could be you have changed the tilemap tint color or the tile is not fully white or the blend mode you are using.
     
  38. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    You can use the tilemap events to do most of it automatically. For example, I do that when I want to add shadows to the walls in another tilemap. Each time I paint a wall in the wall tilemap or remove it, the shadows tilemap is adding a shadow in the tile below.
     
    Saishy likes this.
  39. BreadWeek

    BreadWeek

    Joined:
    Aug 12, 2014
    Posts:
    45
    Thank you, but these were the first things I checked and are unfortunately not the problems. I even went into the source and removed the blending so that the tile's color is set directly. The shader is the usual Sprites-Default and I'm testing it in an empty scene with the latest version, on 2019.3.5f1 and 2020.1.12f1, and no post-processing or added effects. Calling GetTileColor() confirms that the tile is the rgb color I want, but the colors on display are vastly different. Setting the tint color and leaving each tile as white works correctly, as does altering colors on every other renderer in my game.

    I would like to take advantage of 2D lights in the URP. Putting a standard lit shader on the tilemap ignores the tint color, so any tilemap lit by a 2D light shows as white (which is their original color as they're meant to be colored in-game). Setting the color individually for each tile works with the light but it's unusable because the color is so off.
     
  40. ExtraCat

    ExtraCat

    Joined:
    Aug 30, 2019
    Posts:
    52
    Hello, I was wondering if it's possible to achieve effect described here, ie use a simple shader to soften the edges of tiles. It works for built-in unity tilemap, but I'm not sure about STE.
     
  41. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    501
    Hi

    Can this be used to make a level editor at runtime? If yes, is there an example somewhere?

    Thanks
     
  42. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    The way it works is using a MeshRenderer to render the tiles as quads made of two triangles. That's the same as using a SpriteRenderer. And for the color, it's changing the tint color for the shader or if use use the vertext paint, it sets the color for each vertex. So for both cases it needs to be supported by the shader.
    You can change the tint property name here to fit other shader property name:
    upload_2020-11-29_13-24-10.png

    Also, looking into the code I've seen the non selected tilemap color is modified when the Highlight Alpha is not 1.
    That could be the reason as well. But that happens only while not playing.
    upload_2020-11-29_13-26-30.png
     
  43. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    I know Unity Tilemaps has an option to render the tiles one by one instead of using a chunk with a performance loss if the tilemap is big. In that case you could do the same creating a prefab with the TileObjMesh or TileObjectBehaviour and modify them to create a texture of the tile using antialiasing. The attaching the prefab to all the tiles you want with that effect.
     
  44. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Yes, you can create an in game level editor. Not sure if there is any example in this thread but you could have a look.
    At least you will find a lot of examples to get the tile under the mouse position (there is a method for that in TilemapUtils) and also this method GetOrCreateTileSprite to create a sprite for any tile that you can use to render it in the HUD palette.
     
    iddqd likes this.
  45. Qusdrok

    Qusdrok

    Joined:
    Jun 28, 2020
    Posts:
    24
    Hi bro, thank you so much for your tool, so if i use it then ex my map is large then it has increase my fps? And i created a map in unity tilemap editor, so how i can import it to your tool? and i can get tag of collider ? Thank you so much, and please reply me, i really need your answer
     
    Last edited: Dec 16, 2020
  46. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    There is no Unity Tilemap to STE Tilemap converter I'm afraid. You would need to do it manually.
     
  47. Qusdrok

    Qusdrok

    Joined:
    Jun 28, 2020
    Posts:
    24
    oh no, I mean, does your tilemap improve fps higher than the tilemap of unity? Because my map run on tilemap unity is very laggy, but I don't have time to redo this map on your tilemap.
     
  48. bunp

    bunp

    Joined:
    Feb 21, 2019
    Posts:
    70
    Hey CreativeSpore, I got a question.

    Where would I / is there any way way to give the tile art the same normal vectors of the colliders? I am working on a shader to deform the terrain (only visually) but the shader requires the terrain's normal vectors to be pointing outward, exactly the way the terrain's colliders are aligned.

    I can't figure out / solve an alternate method to obtain the effect I need that doesn't use the terrain's normal vectors.
     
  49. chrische5

    chrische5

    Joined:
    Oct 12, 2015
    Posts:
    52
    Hello

    Im looking for an Event like onmouseenter. I want to change the mousecursor of the mouse is over a specific tilemap. Have anyone an idea?

    Christoph
     
  50. Grillstern

    Grillstern

    Joined:
    Oct 14, 2013
    Posts:
    32
    Hi, after importing TM into a blank new 2D unity 2020 Project i get the following errors:

    upload_2021-1-13_10-14-0.png

    Did i miss something here?