Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[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,190
    I will add the right clic option for next release.
    About multi-tile selection editing. It takes the properties of the bottom left tile now.
    I don't shrink it, it's a collateral effect of showing the line "*Multi selection Edition".
    Do you mean, display all the tiles in the same position?
     
  2. Klyntoc

    Klyntoc

    Joined:
    Apr 17, 2016
    Posts:
    5
    Thanks for the quick reply, I will try this.
     
  3. Klyntoc

    Klyntoc

    Joined:
    Apr 17, 2016
    Posts:
    5
    @CreativeSpore Thank you, this method worked and I was able to add the Surface Effectors to each chunk. I also came across some suggestions while working on a level.

    1. When using the Carpet Brush I had an issue with the auto-subdividing tiles. When inside corners need to connect to only 2 sides I would assume it should use the entire corner tile instead of being cut.
    tiler02.jpg

    2. I think a very useful option would be to "flatten" a tilemap to treat all tiles as if they were placed individually. It would be nice to use a brush to quickly draw the level and then be able to add variations overwriting those tiles. In this image I try to add a tile without grass but the tiles made with the carpet brush wrap around it.
    tiler01.jpg
     
  4. Async0x42

    Async0x42

    Joined:
    Mar 3, 2015
    Posts:
    104
    Ah I see, I had meant that instead of:

    X <- Being one tile of many tiles selected

    It would instead display:
    XXXXX <- Being all tiles currently selected, shrunken to fit.

    If the shrinking effect isn't on purpose then that's OK, I had just thought it would be a nice indication of multi-editing.
     
  5. CreativeSpore

    CreativeSpore

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

    1) I will fix the CarpetBrush to make what you said. It's more logic in that case.
    2) You can use a different tilemap and change rendering settings to draw it over the last one. But for next version you could use autotiling modes:
    • Self: will autotile with tiles of the same brush
    • Other: will autotile with tiles different to the same brush
    • Group: will autotile with tiles painted with a brush whose group is autotiling with the tile brush group
    You can mix autotiling modes, so the carpet brush could be Self and Other to achieve what you want.
    Also, you would be able to select a random brush to draw the top of the carpet, so you can even create a random brush with two tiles, with and without grass and it will be done automatically.
    I hope the next version will be available next week.
     
  6. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,190
    I have fixed the issue while adding support for polygon colliders.
    So you will be able to use them without any problem in the next version.
     
    Last edited: Apr 27, 2016
    Async0x42 likes this.
  7. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,190
    Next version of Super Tilemap Editor v1.3.0 is ready and will be available soon.
    These are the changes, features and bugs fixed in the next release:
    • Added brush autotiling groups and autotiling modes: self, other and group
    • Added option create a tile view from brush selection to create tile prefabs
    • Added Tilemap Groups to manage several tilemap like if they were layers
    • Improved collider 2D generation to use less colliders
    • Added support for Polygon colliders in addition to Edge for tilemaps with 2D colliders
    • Display all selected tiles in tile collider properties and drawing a tile background to see the shape of tiles with transparency
    • Changed IBrush interface to support tiles with flags
    • Added the option to select a brush to draw a tile of another brush
    • Added the option to change brush tile flags (flip vertically and horizontally and 90º rotation)
    • Right click over a tile in the palette will display the tile property window
    • Added Is Trigger property to tilemap colliders
    • Added Refresh button in tilemap toolbar and shortcut key F5 for the same operation
    • Fixed carpet interior corners autotiling
    • Fixed refresh tilemap properly when changing cell size
     
    Async0x42 likes this.
  8. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    How do you compare this to your RPG Map Editor?

    Can I use more than 1 tileset to create a tilemap?
     
    Last edited: Apr 29, 2016
  9. CreativeSpore

    CreativeSpore

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

    RPG Map Editor is an editor focused on creation of tilemap using the RPG Maker VX tilesets.
    It also includes a framework to create a basic RPG like character controllers, vehicles, path finding, area transitions, enemies, etc
    Super Tilemap Editor is a more generic tile editor to create any kind of game, from top-down to platformers.

    About your second question, in next version (now in the Unity review process) you can easily create a tilemap group and create tilemaps as if they were layers and select a different tileset for each of them. So you can use different tilesets but in different "layers".
    If you want to use different tilesets in the same tilemap, you need to create a bigger atlas texture including all tilesets you want. But I am working on giving some tools to merge several tilesets in a single atlas, so it will be posible in the future.
     
  10. Klyntoc

    Klyntoc

    Joined:
    Apr 17, 2016
    Posts:
    5
    @CreativeSpore I'm not sure if anyone else is having this problem but I am getting gaps between tiles during camera movement. Lines flicker as I'm moving through the level and appear more often depending on the size of my game window and zoom of the camera. In Unity it was subtle but when I built to my Android device the gaps are everywhere, line breaks between each tile through the level as I'm moving.

    linebreak03.jpg

    Here is a screenshot from your Smart Platform Collider asset. At certain camera zooms I get the same problem.
    linebreak02.jpg

    Also, I tried using the Pixel Snap option in the Renderer settings but it seemed to make the problem worse. My tileset is set to 16x16 pixels with 1x padding. I'll try removing the padding from my texture and see if it works.
    Hope you can help, thanks.
     
    Last edited: May 3, 2016
  11. CreativeSpore

    CreativeSpore

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

    This is a common problem when using tiles but there are some ways to fix it.
    The problem is a precision problem while rendering the tile. Sometimes a pixel outside the tile is taken and it could be a transparent pixel or a pixel of different color.
    To fix this you can:
    • Add padding pixels around the tiles. But not transparent pixels. They have to be an extension of the tile color or the problem would happen anyway. A transparent padding only fix issues with single sprites like a character or an item but it doesn't fix tiles that are supposed to fit together.
    • In Renderer section of the tilemap, activate the Snap Pixel option. This fix the problem for a if zoom level is not too big or too small.
    • In Renderer section you can also use the Inner Padding. You can set here a value to shrink the rectangle used to copy the tile from the tileset. I mean, if you set a value of 0.5, the source resctangle used to take the tile from the tileset will be 0.5 pixels smaller. It will be stretched to fit the total size of the tilemap cell size. The only problem with this is, you will be removing pixels from the border of the tile, but for small values, less than 0.5 it is almost not appreciable. You can increase the value only in case of using big levels of zoom, like if you want a platforme level in the background, far away.
    • You can use also a Pixel Perfect camera. Basically a pixel perfect camera keep the camera position and zoom clamped to a level so the pixels fit in the screen and this problem is avoided. I have a pixel perfect camera in RPG Map Editor and Smart Platform Collider you can use.
    In case my description of Inner Padding is not clear, here there is an image describing it.
    For Inner Padding = 0.5 pixels
    upload_2016-5-4_12-56-55.png

    The source texture rectangle (blue) will be shrunk 0.5 pixels but stretched to fit the tilemap cell size.
    In most of the cases removing half pixel of the border is not appreciated like in this example.
     
    Last edited: May 4, 2016
  12. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,190
    New version of Super Tilemap Editor v130 now available!

    v130 changelog:
    • Added brush autotiling groups and autotiling modes: self, other and group
    • Added option create a tile view from brush selection to create tile prefabs
    • Added Tilemap Groups to manage several tilemap like if they were layers
    • Improved collider 2D generation to use less colliders
    • Added support for Polygon colliders in addition to Edge for tilemaps with 2D colliders
    • Display all selected tiles in tile collider properties and drawing a tile background to see the shape of tiles with transparency
    • Changed IBrush interface to support tiles with flags
    • Added the option to select a brush to draw a tile of another brush
    • Added the option to change brush tile flags (flip vertically and horizontally and 90º rotation)
    • Right click over a tile in the palette will display the tile property window
    • Added Is Trigger property to tilemap colliders
    • Added Refresh button in tilemap toolbar and shortcut key F5 for the same operation
    • Fixed carpet interior corners autotiling
    • Fixed refresh tilemap properly when changing cell size
     
  13. Delmadan

    Delmadan

    Joined:
    Apr 8, 2014
    Posts:
    6
    Hi there, your addon looks very promising. I have a few questions however, please forgive me if these are answered elsewhere.

    Would your addon support creating multiple map chunks/templates which can be procedurally stitched together at run-time?

    Thanks mate.
     
  14. CreativeSpore

    CreativeSpore

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

    Well, the tilemaps are made of chunks of 60x60 tiles and they are boundless, so you can create procedurally the maps in any direction at run time. The tilemap edition has a very good performance in runtime, including brush autotiling and colliders autotiling.
     
  15. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,190
    I have modified the procedural generation script to generate the map dynamically centered on the camera position or any game object it is attached to.
    Here you can see how it works.
    mapProcedural.gif
    And here there is a video of a player walking over the map.
    https://twitter.com/CreativeSpore/status/728244635546624001
     
  16. Delmadan

    Delmadan

    Joined:
    Apr 8, 2014
    Posts:
    6
    Fantastic! Thanks for the reply :) I assume this would be no different for a platformer style map.
    I think you've sold me to purchase the asset.
     
  17. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,190
    Yes, it would be the same for a platformer style. Infinite in every direction.
    Here is the code I used with demo RoguelikeDemo, included in the package.
    Just attach the script to the camera and the Ground and GroundOverlay tilemap to the script.
     

    Attached Files:

    Last edited: May 6, 2016
  18. Nixaan

    Nixaan

    Joined:
    May 30, 2013
    Posts:
    118
    Hi,
    I have few questions about Super Tilemap Editor.

    1. Do you know if the performance of the asset would be good (for PC) on a level with a cell 1x1 units (16x16 pixels sprites), around say 30-40% of the sprites with square/triangle polygon colliders, 1000 x 800 cells (around 10x16 visible)?
    2. Is it possible to use a tile as a placeholder for instantiating a prefab (i.e on tilemap loading instead of placing the tile/sprite a prefab to be placed/instantiated there)?
    3. Is it possible to select all the cells with sprite/tile X and randomly replace it with tile/sprite X1,X2,Xn ?
    4. Can sprites be bigger than the cells?
    5. Does STE support 47tiles tilesets? like this and this.
    6. Can tiles be changed at runtime?
    7. Is it possible to draw on multiple sorting layers (including order in layer)?
     
  19. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,190
    Hi there,
    I answer below:
    1. Do you know if the performance of the asset would be good (for PC) on a level with a cell 1x1 units (16x16 pixels sprites), around say 30-40% of the sprites with square/triangle polygon colliders, 1000 x 800 cells (around 10x16 visible)?
    Yes, it would work. Even with all tiles visible at the same time.
    I've been testing your configuration in the scene demo Rogue like 1000x800 tiles.
    It takes about 7 seconds to generate the map, and 4 seconds to load after pressing play in the editor, but it loads intermediately in a PC version.
    While testing it I have found a bug that will be fixed on next release.
    Basically is a fix to avoid creating twice the tilechunk meshes (it is not noticeable for a small map but it is for a big map )
    And also, you can comment a line in the code to save the meshes and save time regenerating them at the expense of a bigger scene file.
    I have also create a demo with a 1000x800 tilemap. Download it here if you want to test it yourself.
    Use the arrow keys to move around.
    1. Is it possible to use a tile as a placeholder for instantiating a prefab (i.e on tilemap loading instead of placing the tile/sprite a prefab to be placed/instantiated there)?
    Yes, you can attach a prefab to any tile, add an offset of creation (in pixels or in units) and decide if the tile should be painted as well or not.
    1. Is it possible to select all the cells with sprite/tile X and randomly replace it with tile/sprite X1,X2,Xn ?
    Yes, you can do that with a script, but also, you can use a brush, like RandomBrush to randomly paint a tile in the tilemap.​
    1. Can sprites be bigger than the cells?
    If with sprites you mean the tiles (they are not sprites, the tiles are rendered using a mesh) they will be placed inside the cell of a tilemap. But you can create a prefab and attach the prefab to a tile if you want, for example, to instantiate a tree or similar. The painting brush will instantiate the prefab while painting so you will see the prefab, not the tile, and it will be easier to place it in the map.
    1. Does STE support 47tiles tilesets? like this and this.
    Not yet, but it won't be difficult to support using the brush interface including in the asset.
    I can help you to implement it if you want.
    1. Can tiles be changed at runtime?
    Yes
    1. Is it possible to draw on multiple sorting layers (including order in layer)?
    Yes, you can change the sorting layer and sorting order of a tilemap, but not for each tile individually (you can create sprite prefabs with other sorting layer though)
     
  20. Nixaan

    Nixaan

    Joined:
    May 30, 2013
    Posts:
    118
    But there can be several maps on the same sorting layer but different order in layer?
     
  21. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,190
    Yes, you can set the same sorting layer for several tilemaps and different sorting order.
     
  22. Nixaan

    Nixaan

    Joined:
    May 30, 2013
    Posts:
    118
    Aha, i got it. At first I thought layers were done "inside" the canvas. Anyway thanks for the info, looks like it would fit my needs.
     
  23. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,190
    When I was deciding how to add layers support, I found out that it was better to create a parent object to manage children tilemaps. So a tilemap with layers in Super Tilemap Editor is a TilemapGroup gameobject with tilemaps as children.
    This contributes to a clean code and it's more powerful than having more than one tilemap managed by the same script.
     
  24. Nixaan

    Nixaan

    Joined:
    May 30, 2013
    Posts:
    118
    BTW why meshes instead of sprites?
     
  25. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,190
    Because a mesh contains the geometry for 60x60 tiles and using sprites I would have to create 60x60=3600 gameobjects with a SpriteRenderer that would take a lot of memory and resources.
     
  26. Mijago

    Mijago

    Joined:
    Mar 27, 2016
    Posts:
    11
    Hello, it's me, again.

    I made a little break with Unity, but now the work will go on.

    And i just got the next issue.
    I do not know whether you know it already, but simply look the video and you'll see what I mean (-> 2d Colliders):
    http://sendvid.com/uw6bwjrm

    Tomorrow I'll do more tests.. But this is just weird :D


    #Edit 1:
    Also, I got this error message. In the video (in the footer) you can see when it occurs: http://prntscr.com/b647bg

    #Edit 2:
    Also, what I would love to see is a button, that shows where which brush is (in the Map).
    I thought about a unique color per brush, generated by a hash of the name or something similar. This color will be used as overlay over the brush(es) in the map, so you can see where which brush was used. It is not necessary, but it would be really nice!
     
    Last edited: May 20, 2016
  27. CreativeSpore

    CreativeSpore

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

    I have tried to replicate the problem but I couldn't. If you can send me a demo project it would be great.
    What version of Unity are you using?
    I will think about a way to show the brushes on the tilemap.

    #Edit 1:
    To fix this error change line tiemapchunk.cs:599 for this one:
    m_has2DColliders = ParentTilemap.ColliderType == eColliderType._2D;
     
    Last edited: May 20, 2016
  28. Mijago

    Mijago

    Joined:
    Mar 27, 2016
    Posts:
    11
    Sorry, I can't reproduce it on my own in an other Project.. This is so weird :(
    But no problem, I can live with that. Just weird!
    But I do not give up. You can only fix it if you can reproduce it, I know..

    But, another thing that happens frequently: When I jump on the map from too high (using the default 2d Robot Character), I get stuck inside the ground. http://prntscr.com/b6qka0

    #Edit 1
    I guess it has something to do with faulty copied colliders on the Tiles..
    Working (but not nice):

    Not Working, as soon as (3) hits the inner "wall":



    #Edit 3

    Yep, the Collision data was somewhat faulty.. After deleting the Tileset and creating it again, including "drawing" every collider again, it works nicely.
     
    Last edited: May 21, 2016
  29. Gozdek

    Gozdek

    Joined:
    Jun 21, 2015
    Posts:
    356
    Looks great
     
    CreativeSpore likes this.
  30. CreativeSpore

    CreativeSpore

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

    Thanks for telling me about this issues.
    I will check the issue with the colliders, but I think the problem is only because I always connect the start with the end of the segment and in some cases I shouldn't. So it is easy to fix.
    About the robot going thorough the collider, it is normal if the colliders are moved too fast. Unity updates the collider position using the default timeDt of 0.02. If in that time the collider is trespassing the collider without be over it, the collider will skip that collision like if it wasn't touched it.
    It's fixed if you through a raycast from previous position to the new one and check for collisions in the middle.
     
  31. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,190
    I have found and fix the issue generating the colliders. It happened only sometimes if the vertex was not fitting the neighbour tile vertices, but it is solved now. If you want I can send you the fix. I will upload a new version today with this fix and other improvements.
     
  32. IndyBonez

    IndyBonez

    Joined:
    May 26, 2015
    Posts:
    3
    @CreativeSpore I like the look of your asset, I have previously used 2dToolkit but it wasn't quite right for my usage pattern but it did provide support for the .tmx format for importing tilemaps made with Tiled Map Editor
    http://doc.mapeditor.org/ do you have any plans to support importing/exporting to the .tmx format?
     
  33. CreativeSpore

    CreativeSpore

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

    I have in my TODO list "add support for TMX", but my intention was design Super Tilemap Editor to be more easy to use than Tiled in Unity.
    Anyway, the next feature I want to implement is creating a tileset atlas from different textures and once I have this feature, it would be possible to add support for TMX files as well, because if I remember well, the format includes creating tilemaps using different textures and it would be possible once I have the support for tilesets with different textures.
    But it depends on priorities and I am not 100% sure of when I would give support for TMX files.
     
  34. Tiber

    Tiber

    Joined:
    Aug 12, 2015
    Posts:
    2
    @CreativeSpore
    Hi,

    I have been using your asset and it is great so far. I am just wondering if there is any way it supports SVG files or SVG's created with https://www.assetstore.unity3d.com/en/#!/content/38258 . I know that the TileSet expects a Texture2D, but is there any way to change it to accept a different object type?

    Thanks,
    Tiber
     
  35. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,190
    Hi,
    I don't think it is possible to use something different than a texture. I would be easier to convert the svg in a texture, then use it for a tileset.
    What you can do is attach prefabs to a tile, so you can create placeables or other object using SVG while painting.
     
  36. Tiber

    Tiber

    Joined:
    Aug 12, 2015
    Posts:
    2
    @CreativeSpore

    Thanks!!, The attaching a prefab works great !


    Tiber
     
  37. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,190
    You are welcome ;)
     
  38. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,190
    New version of Super Tilemap Editor v1.3.1 released!

    v1.3.1 Changelog:
    • Added Erase method in Tilemap.cs
    • Added user friendly methods to Tilemap.cs to set tile data using parameters for tileId, brushId and tile flags
    • Added a dialog asking to keep or not the previous tile data when slicing the atlas tiles in the tileset
    • Tile Properties and Tile Selection windows has been moved to a new create menu section "SuperTilemapEditor/Window"
    • All tilemaps are now refreshed if refresh button is pressed when the tilemap group is selected
    • Improved the tile slicing to be more precise calculating the right uv rect
    • Hiding painting brush then mouse is not over the SceneView or when dragging a prefab into the SceneView
    • Fixed refresh tilemap after Undo/Redo
    • Fixed precision error while dragging tile collider vertices in the Tile Property window
    • Fixed collider 2D generation issue
    • Fixed removing 2D colliders properly when switching to 3D after painting
    • Fixed creation of tilechunk meshes twice when pressing play
    • Fixed continuously enabling/disabling of painting brush
    • Fixed copying the pixelSnap value when duplicating a tilemap
    • Fixed AddParam and added parameter getters and AddValue helper methods in ParameterContainer.cs
    • Fixed not painting in the tilemap when closing a popup over the scene view
     
    Async0x42 likes this.
  39. bitbiome_llc

    bitbiome_llc

    Joined:
    Aug 3, 2015
    Posts:
    58
    Still learning this tool but seems great so far. I am curious how to place a tile without messing up carpet tiles.

    1. I have an area of carpet tiles with a few center tiles.
    2. I'd like to replace some of those center tiles with a tile from the tile set or from a random brush.
    3. When I try to replace once of the center tiles all the surrounding carpet tiles shift to keep the carpet looking "correct".
    I've tried a number of autotiling modes with groups and failed to get the desired result.

    Here is a video. I'm trying to place a different style of center tile in an area that is carpeted. I'd like it to not affect the surrounding tiles and just replace the single tile.

     
    Mighty183 likes this.
  40. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    There's no chance this asset might go on sale anytime soon? I just discovered it, but it's a little out of my budget. It looks amazing.
     
    CreativeSpore likes this.
  41. CreativeSpore

    CreativeSpore

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

    You have to options to achieve that:

    First option
    Set the autotiling mode for the carpet brush to "Self | Other".
    This will make the autotiling with itself but also with other kind of tiles as well.
    I have seen a bug so the tilemap is not updated when painting a normal tile (not using a brush) so you have to refresh the map by pressing the refresh button or F5. I will fix this for next version.
    Using this option, the road should.

    Second option (using brushes)
    In this case you have to use a brush to paint inside the carpet. It could be a RandomBrush with a single tile.
    Create a new group for "Roads" going to the tileset, Groups sectiong and setting a name in the group1 for example.
    Set the "Roads" group in the carpet brush used to draw the roads and for the brush used to paint inside the carpet.
    Set the autotiling mode to "Self | Group" and create a new group for Roads
    In this case, you can also use the directly RandomBrush for the interior carpet tiles, selecting this brush instead of a normal tile.

    Looking for your solution I have seen some improvements to be made in this matter and probably I will have a better solution in a couple of days.
     
  42. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,190
    Hi Ben,

    That would be great! But it is not in my hands to decide when it would be.
     
    Ben-BearFish likes this.
  43. bitbiome_llc

    bitbiome_llc

    Joined:
    Aug 3, 2015
    Posts:
    58
    Option 1
    I couldn't get the first option to work (might just be me).

    Option 2
    The second option did work, thank you. I thought I had tired this the other day but it did work today. I have a brush group called bricks.
    1. Brick carpet brush
      Group: bricks
      Autotile: self, group
    2. Random center brick brush
      Group: bricks
      Autotile: self, group
    Carpet Brush Autotile
    If I set my carpet brush to autotile other it only places center tiles until I reach the edge of the map. Does autotile other mode require all other tiles in the tile set to be in some type of group that is also set to autotile other?

    Thanks again.
     
    Last edited: May 30, 2016
  44. bitbiome_llc

    bitbiome_llc

    Joined:
    Aug 3, 2015
    Posts:
    58
    Random Brush - Feature Request

    Sorry for the double post but figured I should keep this as a separate item for a reply.

    Would it be difficult to have an option to randomly do the following to each tile from a random brush?
    1. Do nothing
    2. Flip horizontal
    3. Flip Vertical
    4. Rotate 90 deg
    This could be a toggle at the brush level (maybe too much to have at the tile level?). Right now you can manually do this by adding a single tile 4 times and then checking the boxes individually for the tiles.

    This option further breaks up any patterns that the human eye can catch from a tile set.
     
    Last edited: May 30, 2016
  45. CreativeSpore

    CreativeSpore

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

    I will add your request in next release. You can do the same adding these lines after line 76 in RandomBrush.cs:
    Code (CSharp):
    1.  
    2. uint randomTileData = GetRandomTile();
    3. {
    4.     uint flags = (uint)Random.Range(0, 8) << 29;
    5.     randomTileData &= ~Tileset.k_TileDataMask_Flags;
    6.     randomTileData |= flags;
    7. }
    8.  
     
  46. bitbiome_llc

    bitbiome_llc

    Joined:
    Aug 3, 2015
    Posts:
    58
    Excellent! Thank you.
     
  47. bitbiome_llc

    bitbiome_llc

    Joined:
    Aug 3, 2015
    Posts:
    58
    EDIT
    Changed the map collider type to 2D polygon and it works. I do have 3D dice that roll on the map and it would be nice if the 3D version would only report hits on the defined colliders like the image below.

    With 2D colliders I can use OverlapPoint over non-collider tiles inside the red area and no collider is returned. This is how I would expect it to behavior. With 3D colliders I use a Raycast ,or an overlap, over non-collider tiles inside the red area a collider is returned. This is not the behavior I would expect.

    Original

    I have a question about tile colliders. I've setup some wall tiles to have colliders. I'm using 3D colliders and I've tried Raycast and a few overlaps. Collision returns the tilemap mesh. I can walk my units all around the border as seen in the image below. The outer most colliders appear to be creating a larger collision area.

    http://i.imgur.com/1qEhZ4q.png



    Perhaps I'm missing a step in the process?
    1. Right click a tile from the tilemap tile list
    2. Press collider tab.
    3. Set as polygon.
    4. Back on the tilemap press the collider tab
    5. Set collider type to 3D
    6. I increased the depth a bit.
    7. Set Is Trigger to true
    8. Press map tab
    9. Press Refresh Map
     
    Last edited: Jun 4, 2016
  48. CreativeSpore

    CreativeSpore

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

    The problem here is the same like when you are using 2D polygon collider. To be a trigger, the collider has to be convex.
    You can see the real collider lines by unhiding the tilemapChunks by adding this line in the OnValidate method:
    gameObject.hideFlags = HideFlags.None;

    It is working it 2D Polygons because in this case, a different polygon collider is created for each enclosed area, but in 3D all the collider is managed by a single MeshCollider.
    I think the best option to fix it using 3D colliders is creating the wall using prefabs and attaching them to the tile.
     
  49. bitbiome_llc

    bitbiome_llc

    Joined:
    Aug 3, 2015
    Posts:
    58
    Ok, I figured it had something to do with the mesh. I'll go the prefab route. Thank you for the quick response.
     
  50. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,190
    New version of Super Tilemap Editor v1.3.2 released!

    changelog:

    • Added RemoveRedundantVertices and SplitSegments to tilemapChunks (improving performance and fixing lighting issues)
    • Added probability weights to tiles in a random brush
    • Added Randomize Flags mask in random brush to randomize selected flags when painting tiles
    • Added Tileset selector in Tile Palette Window
    • Now, right clicking a tile in the tilemap will first select the brush if any, and second time the tile painted by the brush will be selected.
    • Normal tiles, not painted with a brush, are now considered to be in group Default or group 0 in relation to brush autotiling mode "Group"
    • Fixed some bugs using brush groups
    • Fixed creation/destruction of prefabs asigned to tiles when they are painted using a brush
    • Fixed memory leak issue in TilemapGroupEditor by properly destroying the tilemapEditor object
    In next version I will include a new script behaviour TileObjectBehaviour. When attached to a prefab attached to a tile, it will create the prefab changing the SpriteRenderer sprite for the tile painting it.
    This will allow to create separated sprite object from tiles to create all kind of common behaviour using a single prefab for all tiles who share the same logic.
    For example if you create breakable wall ( a tile with a spriteRenderer and a collider that is destroyed with a bomb ) but you have a lot of different wall tiles, you can create only one game object, attach this script, and attach the prefab to all wall tiles and the tile sprite will be changed for each wall.
     
    bitbiome_llc likes this.