Search Unity

[RELEASED] Super Tilemap Editor

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

  1. SugoiDev

    SugoiDev

    Joined:
    Mar 27, 2013
    Posts:
    395
    I think this is related to some update operation when opening prefabs with maps created on older STE versions.
    I had a bunch of those and what solved for me was to open each prefab map on the prefab stage, then change something and save.


    If there's need, I can fetch some old prefabs from source control and send you to help with reproduction.
     
    CreativeSpore likes this.
  2. ryanzec

    ryanzec

    Joined:
    Jun 10, 2008
    Posts:
    696
    @CreativeSpore I think the use case causing this error was caused by the fact that the prefab was a variant of another prefab and the map I was editing was part of the base prefab. I removed the map from the base prefab and then added the map to the prefab variant itself and everything has been working fine since.

    I did not mean for the map to be part of the base prefab and I don't foresee a reason that I would want a map to be part of a prefab that I am using as a base prefab for other prefabs so this is not as big of a problem for me.

    I was not able to create the error in an empty project so I am not sure what the exact reproducible case is but if I figure it out, I will let you know.
     
  3. Raseru

    Raseru

    Joined:
    Oct 4, 2013
    Posts:
    87
    Sorry if this has been answered but I couldn't find it via searching.
    If I have a destructible object like a barrel that is 2 tiles tall, would it be more efficient to just have this as a prefab with a sprite attached to it and then a child object with the second sprite? Or would it make more sense for the prefab to just have a STE Tilemap with both the sprites drawn together or would that be overkill due to the overhead? If it's overkill, would this still be the case if it was a bit more complicated like a tree that was let's say 10 tiles?
     
  4. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    As @SugoiDev said, it looks like a serialization problem when updating the prefabs to new versions of Unity.
    I hope these errors will be fixed eventually with no need to apply special fixes. I don't mind to apply a fix when necessary but I prefer to keep the code simple and not to add a code that will be obsolete soon.
    It these errors persists I will find a way to avoid them in all cases.
     
  5. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    I think you should use a prefab with a sprite for the whole barrel. Usually, for these kind of objects you could need to sort them by Y axis, so it could be a good idea to separate them in prefabs.
     
  6. Raseru

    Raseru

    Joined:
    Oct 4, 2013
    Posts:
    87
    Oh I was so used to slicing everything by 16x16 automatically that I didn't realize I could just customize it afterwards by deleting one slice and expanding the other. This will make things a lot easier, thanks!
     
    CreativeSpore likes this.
  7. UWEPogoP

    UWEPogoP

    Joined:
    Jun 10, 2019
    Posts:
    1
    Hi there! Really enjoying this tool, thank you so much.

    Just curious, I can't seem to get this to work. Should this script (or a similar script) be put on the player prefab? This line doesn't seem to work for me. The if statement is never true.

    private void OnTriggerEnter2D(Collider2D collision)
    {
    bool isTilemapChunk = collision.gameObject.GetComponent<TilemapChunk>();
    if(isTilemapChunk)
    ++m_colliderCount;

    My character has a rigidbody and a collider too. So do my individual tiles which are set up as prefabs with trigger colliders on them. Not quite sure what I'm doing wrong, maybe it's something silly!

    Edit - I actually got it working by checking the tag on the collider instead. Is that a viable method for doing this? It seems to work!
     
    Last edited: Jul 4, 2019
  8. BreadWeek

    BreadWeek

    Joined:
    Aug 12, 2014
    Posts:
    45
    Erasing one carpet brush tile in a 100x100 map using the following code causes a huge lag spike. Am I using it incorrectly?

    SuperTilemapSlowCode.png

    SuperTilemapSlowProfiler.png

    Thanks for the awesome work :)
     
  9. Saishy

    Saishy

    Joined:
    Jun 3, 2010
    Posts:
    79
    I don't really get what the Anim Delay does, I tried setting to from 0, 0.25, 1, 4 to 50, and nothing happened?
     
  10. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    That is weird. You it should work by getting the TilempChunk component. Maybe you fixed it before using the tag?
     
  11. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    If you use a tilemap group to manage the tilemaps, you can access the tilemaps like this:
    Code (CSharp):
    1. STETilemap tilemap = tilemapGroup["nameOfTheTilemap"];
    About the spike, are you using Deep Profile?
    Also, are you updated with the last version? I fixed a performance issue happening only in Editor when updating a tilemap mesh.
     
  12. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    You can use it to avoid repetition when using several animated tiles together.
    Check this tweet to see how it works:
    https://twitter.com/CreativeSpore/status/1024612195102076928
     
    Saishy likes this.
  13. Saishy

    Saishy

    Joined:
    Jun 3, 2010
    Posts:
    79
    Ah thanks, for some reason it wasn't showing for me but I got it to work by creating a new scene!


    Now, I've updated unity to 2019.1.9f1 and in the scene my tilemap are having weird artifacts (everything is okay in game)

    upload_2019-7-9_7-26-47.png

    This is with the Dirt deactivated:

    upload_2019-7-9_7-27-16.png

    And strangely, with the dark grass deactivated:

    upload_2019-7-9_7-27-51.png

    There are no problems when actually playing tho:

    upload_2019-7-9_7-28-27.png


    Edit: Also after the update I'm getting infinite messages like this: https://i.imgur.com/BR1eTEB.gifv

    And if you see the lines it's complaining, there is actually nothing there? There is nothing supposed to be there in the first place: https://i.imgur.com/q7zRrll.png

    Those errors repeat for every single empty tile.
     
    Last edited: Jul 9, 2019
  14. vambier

    vambier

    Joined:
    Oct 1, 2012
    Posts:
    102
    Is it possible to use multiple tilesets on the same tilemap? If not, is this something that could be added?
    I have for example a background and a foreground tilemap. These tilemaps have different tilesets with different textures. No problems so far. But now I've got a second scene where I want to use some of the background tiles in the forground tilemap. The only way to do that now is to make just one tileset which contains sprites with the tiles from the background AND the foreground. The only way I can think of to do this now is put all the tiles from the whole game in one sprite but then if I reach the max number of tiles I have to add the new tiles in another sprite and then I have the same problem. The other way would be to create a new tilemap(layer) and put that on top of the other tilemap and use the tileset with the other tiles that I want to use, but this way I am creating a lot of extra tilemaps(layers) that are necessary. The best way, in my oppinion, would be to just be able to add multiple tilesets to a tilemap so you can pick and choose any tile from the tilesets to paint with.
     
  15. BreadWeek

    BreadWeek

    Joined:
    Aug 12, 2014
    Posts:
    45
    Thanks for the reply :)

    Thanks! I totally missed that in the docs.

    I was in deep profile for that image, and I updated from 1.6.0 to 1.6.2, but there is still a spike. I ran a build and get this when erasing one tile:
    SuperTilemapSlowProfiler2.png
    In the editor the spikes are about 5ms. Any suggestions for how I can narrow down the issue?
     
  16. bunp

    bunp

    Joined:
    Feb 21, 2019
    Posts:
    70
    I'm hitting a a few bugs with 2019's new terrible prefab workflow and undoing edits to tilemaps.

    upload_2019-7-12_16-2-22.png

    When I try to erase the final tile of a tilemap layer, Unity spits out this error every time.

    Additionally, whenever I hit Ctrl-Z to undo, 80% of the time it brings back tons of tiles I edited eons ago or just completely destroys my prefab. I make one edit, but it undoes dozens of random changes I made, its hard to explain or reproduce, just that I basically cannot use Edit Undo because of how random and unpredictably destructive it is in 2019.
     
    vexe likes this.
  17. vexe

    vexe

    Joined:
    May 18, 2013
    Posts:
    644
    Having same issues as @themadmuffin. Using Unity 2019 1.2f1, with latest version of STME 1.6.2. Not being able to undo is a scary workflow. Any help would be appreciated
     
  18. victor_fl

    victor_fl

    Joined:
    Dec 9, 2017
    Posts:
    2
    This asset made my life a lot easier! I have a question though. Is it possible to set the collider type/trigger on the tile properties window? That would make my workflow as simple as Mario Maker. I'm currently using separate layers for each collider type (holes and walls) but having to change two layers (collider and actual tile) isn't optimal for iterating on level design. If there isn't such feature, is it somewhere on the roadmap for the next update? Cheers.
     
  19. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    About the artifacts, you can see them in the editor and not in game because it depends on Screen Resolution and how you manage the camera.
    The issue appears when the tile border is just in the middle of an screen pixel, but there some ways to get rid of them.
    Best of all is to add tile extrusion:


    About the warnings, It happens to me when I import the asset while a scene is opened.
    In your case I guess you just opened the project with a new version of Unity, but it could lead to the same case.
    Maybe the project was opened with a scene with a tilemap, Unity reimported the assets and that caused the issue.
    It should be fixed by just exiting the scene without saving and opening it again.
    When also you didn't loose the brushes
     
  20. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    It is not possible right now. The reason is the performance.
    The tilemaps are rendererd using a single MeshRenderer and you cannot apply more than one texture to it without using a special shader, what makes impossible to apply your own shaders to your tilemaps like SpriteDiffuse, etc.
     
  21. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    The RecalculateNormals function is optional when you don't use SpriteDiffuse. It is used to fix shadows, so you could comment that call.
     
  22. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    I think you are not updated with the last version.
    I will check what I can do. I think I could avoid destroying the tilemap chunks (they are destroyed when there is no tiles on its area of 60x60 tiles and are drawn with a red line in the editor) but I would still need to manage the destruction of tile prefab objects.
    Unity manages this by forcing you to open the tilemap in prefab mode when you try to remove a children gameObject that was saved in the prefab so I could also just popup a message in the same way, but right now it's quite sure you would need to go to prefab mode to easily modify a tilemap inside a prefab I am afraid.

    Also, take care of the Auto Saving check when in edit mode as it will save all the asset each time you paint a single tile, making it difficult to edit the tilemap. Uncheck this option before editing the tilemap and save it manually.
     
  23. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    It is not prepared to use different tilemaps right now. The tile properties window only defines the shape of the tile.
     
  24. victor_fl

    victor_fl

    Joined:
    Dec 9, 2017
    Posts:
    2
    Ok. :(
     
  25. vambier

    vambier

    Joined:
    Oct 1, 2012
    Posts:
    102
    What would be the best way to do this then? Create one really big spritesheet, create a layer per spritesheet, or is there a better way?
     
  26. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    Hi!Any idea how I can do so that the pathfinder does not go inside colliders?
    upload_2019-7-14_12-0-13.png
     
  27. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    I think the best way would be creating a big spritesheet. If you need to update the tileset adding more tiles, you can do it without breaking previous tilemaps if you increase the atlas texture Height, so I would place it in an horizontal layout keeping the size to be less than the maximum allowed by your target device.
     
  28. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Apply this patch. It should fix the problem.
     

    Attached Files:

    gferrari likes this.
  29. bunp

    bunp

    Joined:
    Feb 21, 2019
    Posts:
    70
    I am using 1.6.2, the store's latest version. I am updated to the latest version.
     
  30. titan045

    titan045

    Joined:
    Apr 27, 2018
    Posts:
    7
    Hi CreativeSpore!

    First off, great tool STME. I really like some of the advanced features. :D

    I'm trying to help madmuffin solve some of the workflow issues they're running in to. After fiddling around I'm starting to think it's a variety of smaller issues.

    In case it was a Unity bug, I've since bumped to "2019.1.10" (was "2019.1.2"). There was something in the Unity change log that suggested an undo bug was fixed in "2019.1.9", alas this didn't seem to be related.

    Anyway, I'm still digging in to the issue, but here's what I have so far:

    When you undo, some layers in a Tilemap Group you had previously hidden become visible

    undo-hidden.gif

    In the GIF above I hide Touchup_16 and Touchup_32 and do some painting. When I press CTRL+Z to undo, the layers I hid come back. That's a bit unexpected. ;)

    Now the slightly more complicated issue.

    If you create a CarpetBrush that contains a RandomBrush, any time you paint (or undo), all generated tiles that contain the RandomBrush tile change

    I'll walk through the working example.

    We have this dirt brush.

    left-random.png

    Specifically the left-most tile has a RandomBrush associated with it. The RandomBrush looks like this:

    left-random2.png

    (NOTE: I tried to see if "Remove Brush Id" would help, but it didn't seem to make a difference. In the screenshot above I forgot to uncheck it... oops).

    Take note of the 2nd permutation, it's a detail tile that jets out. Technically this isn't a safe tile for the generator code, but that's on us. That said, it's easy to spot in the GIF below as an example of a non-generated side tile that works as expected.

    left-random3.gif

    You can see near the cursor that any time you click, those generated left-side tiles with the Random brush emit some funny results. In some cases it's not even the same tile on the "top-left" and "bottom-left".

    Anyway, I'm going to keep digging and see if I can better reproduce and demonstrate the more complicated undo bug muffin is running in to.

    Thanks again! :D
     
    vexe likes this.
  31. titan045

    titan045

    Joined:
    Apr 27, 2018
    Posts:
    7
    Okay, I think have a repro case that makes sense.

    Undoing after changing layers occasionally glitches the layer

    I give 2 demonstrations below.

    undo-layer.gif

    The first is a simple undo. If you undo, it works.

    The second, I change layers before undoing. The action of undoing does switch the layer back, but during the switch some of the tiles occasionally glitch out.

    On the plus side, making a 2nd undo does seem to actually correctly undo, at least in this simple example. There might be more complicated examples that don't undo correctly though.

    If I figure anything else out I'll let you know.

    Thanks again. :D
     
    Last edited: Jul 23, 2019
    CreativeSpore and vexe like this.
  32. GameDevSA

    GameDevSA

    Joined:
    Dec 12, 2016
    Posts:
    252
    Update 1 (original message below): This is an error that has happened many times, even after I updated super tilemap tonight and rebooted Unity. It was consistent enough to film it. However, oddly enough, since posting, the error hasn't repeated on the most recent levels I've created, but it is still present when I go back to some of the older prefabs I made. So, for one reason or another, it is not always consistent.

    Update 2: And then it just started happening again. Inconsistent, but at the same time regular enough to be a genuine bug.

    Update 3: I've found a new clue that might be related to this bug and the one in my following post. It's an error linked to GUI code in Unity and Super Tilemap code. It has been appearing whenever I open Unity, and then start painting in my first tilemap, and I've just taken a closer look and seen it could be related. I just cleared it and it hasn't come back if I continue painting after that, so far. I closed and re-opened Unity again to try and repeat it, but it didn't come back. Then when I stopped thinking about it and designed the next level, it came back, so it's inconsistent, but regular. I've seen it many times. The error is as follows:

    upload_2019-7-24_13-42-41.png

    The actual error says:
    ArgumentException: Getting control 8's position in a group with only 8 controls when doing Repaint
    Aborting

    And the expanded message says:
    UnityEngine.GUILayoutGroup.GetNext () (at C:/buildslave/unity/build/Modules/IMGUI/LayoutGroup.cs:117)
    UnityEngine.GUILayoutUtility.DoGetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayoutUtility.cs:461)
    UnityEngine.GUILayoutUtility.GetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayoutUtility.cs:450)
    UnityEditor.EditorGUILayout.GetToggleRect (Boolean hasLabel, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:9268)
    UnityEditor.EditorGUILayout.Toggle (UnityEngine.GUIContent label, Boolean value, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:7471)
    UnityEditor.EditorGUILayout.Toggle (System.String label, Boolean value, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:7466)
    CreativeSpore.SuperTilemapEditor.TilePropertiesControl.DisplayPrefab () (at Assets/CreativeSpore/SuperTilemapEditor/Scripts/Tilemap/Editor/TilePropertiesControl.cs:148)
    CreativeSpore.SuperTilemapEditor.TilePropertiesControl.Display () (at Assets/CreativeSpore/SuperTilemapEditor/Scripts/Tilemap/Editor/TilePropertiesControl.cs:84)
    CreativeSpore.SuperTilemapEditor.TilePropertiesWindow.OnGUI () (at Assets/CreativeSpore/SuperTilemapEditor/Scripts/Tilemap/Editor/TilePropertiesWindow.cs:86)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:342)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:336)
    UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition, Rect viewRect) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:302)

    Update 5: I have since updated Unity to the latest, 2019.1.11f1, and haven't noticed an issue with the blocks refusing to erase since, however the error message still appears. Since it was inconsistent before it may still be present.

    Update 6: Just to add, it seems also when painting the prefabs as tiles, once they can't be erased, they also have lost their link to their original prefab. I discovered this because when I updated the prefab, the tile did not update.

    upload_2019-7-26_14-35-13.png

    You can see above how Hero, Red Block, and all of the other game objects are not linked to a prefab, but they should be, except for Obstacle, which is still linked to the prefab. About the same time I deleted and tried repainting prefabs, that error message came up again.

    Original Message:
    Hi Creative Spore! I have found a bug. I am using:

    Unity 2018.3.4f1, and the latest version of Super Tilemap Editor, v1.6.2.

    The bug is related to nested prefabs and the eraser tool. Quite simply, sometimes when I turn a level into a prefab (all of my levels are a series of tilemaps under an empty object, so let's call this prefab Level 2), if I am inside of the Level 2 prefab editing one of the tilemaps, sometimes when I paint tiles, I cannot use the eraser tool on them, and have to manually click and delete them from the scene or in the tilemaps heriarchy.

    Generally, when I paint with prefabs as a brush on the first pass it seems fine, but if I go out of the Level 2 prefab editor, then go back into it and try and erase the tiles i just painted, they won't erase. Here's a GIF demonstrating:

    Example Of No Erase.gif

    In the GIF, I started inside the prefab L2 (aka level 2), and painted with the 'S' tile, which is a prefab with a script and sprite renderer attached.

    I paint with the tile, then erase it with no problems. Then I exit the Level 2 prefab and go back in. This time when I try to erase the 'S' tiles I painted, 2 of them will not delete. Sometimes it happens like this with one or two tiles, sometimes all of most of the tiles won't delete.

    I have only found this error occuring when I paint tiles that are prefabs. I haven't noticed this error when painting normally with tiles that are just sprites from the tilemap.

    Also, each time I finish a level, I duplicate the prefab, then create a new prefab from it and make sure to make a "New Original Prefab", not sure if that's relevant, likely not.

    If this is a known error and I simply need to update Unity, I will try and update, although I'm a little reluctant to update Unity otherwise as that can break a lot of things. I have since updated Unity to the latest, 2019.1.11f1, and haven't noticed an issue with the blocks refusing to erase since, however the error message still appears. Since it was inconsistent before it may still be present.

    Thank you.
     
    Last edited: Jul 26, 2019
  33. GameDevSA

    GameDevSA

    Joined:
    Dec 12, 2016
    Posts:
    252
    Update 1 (original message below): I updated to the latest Unity now, 2019.1.11f1, because this error with the ghost blocks has become so unusable. Every single time I try and paint with tiles that are just sprites, if I have also painted with prefabs, all tiles that are not using prefabs disappear.

    Ghost Blocks v2.gif

    The first part of the GIF shows the two brushes I'm using, the bush that has no prefab, and the 'S' block that is a prefab. I paint the bush fine inside the Tutorial 1 prefab. I also paint the 'S' block prefab fine. When I leave the Tutorial 1 prefab, then go back inside, the bush tiles are gone.

    Update 2: I just discovered another clue. The problem seems to occur when I have 3 tilemaps, on the 3rd tilemap created. Base is the tilemap i first made, where I made the sand and islands. It uses just tiles that have no prefabs, but one of them, the islands, use the Brushx47 brush, to auto-tile islands. If I paint any new tiles on that tilemap, they don't disappear.

    On the second tilemap, I can only paint using prefabs. If I try to paint with a non-prefab, it vanishes.

    Can't Paint.gif

    If I try and paint on the third tilemap, Decorative, which is the last I created, it's like I showed before, it will paint, but if I leave the prefab and come back, it vanishes.

    I need to have multiple tile maps to create my levels. It seems unusable inside of a prefab. I might be able to get away with a separate scene for each level, multiple tilemaps but not inside a prefab, but that's a bit of a work around and I'm not sure without testing if that will actually fix it.

    Update 3: I tried having separate tile maps in a scene, not putting the tile maps in a prefab, and this error still happens once I add a 3rd tilemap to the scene. Unless you can fix it, it's basically unusable for my game, because I need to have multile tilemaps for all of the different graphical layers.

    On a whim, I tried deleting the Creative Spore folder from Assets and re-importing from the asset store, but that didn't fix it either.

    Update 4: I tried creating a brand new project in Unity 2019, and seeing if that fixed anything. The problem persists, making using prefabs as tiles completely unusable, unless perhaps you made every tile a prefab, which I don't want to do.

    At this rate it seems as though it may not be usable for me without a fix.

    Update 5: In case this information helps you, here are the components I had attached to some of the prefabs I was painting as tiles:
    • Scripts (even tested with empty scripts in a new project)
    • 2D Box collider
    • 2D Rigidbody
    • Sprite Renderer
    This was the same both for this issue and the one in my previous post.

    Original Message:
    I have a second bug that is happening that is probably related, creating "ghost blocks" that won't paint properly. It first occured in a version of Unity 2018, as in previous post, but is still occuring in 2019.1.11f1. I painted up a tilemap fine, exited the level prefab, then noticed in the level preview that some of the tiles had disappeared. There were supposed to be purple blocks visible, but the preview had none.
    upload_2019-7-24_0-13-16.png

    I went back into the prefab and tried repainting the now disappeared tiles, the purple blocks, but I couldn't paint. I kept holding the paint button down, but nothing would paint - I even tried reselecting the paint brush tool, but still no success. But intermittently, I would see blocks reappear then vanish again, flickering in and out, as demonstrated below. I even tried changing the tile to paint with, which created new "ghost blocks" but still wouldn't paste properly.

    Ghost Blocks.gif

    Upon further testing, I realised the purple blocks hadn't been made into prefabs yet - they were just sprites. I could still paint with tiles that were prefabs, but could not paint regular sprite tiles, no matter what I chose. I even tried using the eraser to erase the ghost blocks, but still could not paint.

    Erasing the ghost blocks, then exiting and re entering the Level 10 prefab finally let me paint again, however once the prefab was exited, they would again disappear.

    Thanks.
     

    Attached Files:

    Last edited: Jul 25, 2019
  34. Haberzeth

    Haberzeth

    Joined:
    Mar 1, 2018
    Posts:
    2
    Hey,
    i've got a question about best practice for Prefabs in Super Tilemap Editor.
    I want to set a Tile during the game which has a Prefab. The new Object should get a parameter e.g. "city".

    This is my attempt to get this done:
    Code (CSharp):
    1. tilemapArea.SetTile(x, y, -1, areaBrushBlue);
    2. tilemapArea.UpdateMeshImmediate ();
    3. Area myArea = getAreaAtPosition(x, y);
    4. myArea.city = city;
    Is there a better way to do this? Because i got prolems when i make a UpdateMeshImmediate() and the new Object also calls a UpdateMeshImmediate() at start().
     
  35. Saishy

    Saishy

    Joined:
    Jun 3, 2010
    Posts:
    79
    No, the problem only occur in the Scene view, not in the Game view:

    upload_2019-8-1_12-43-28.png

    So the extrude thing does nothing.

    https://i.imgur.com/61sc0QR.png

    Edit: The warnings about every single tile still persists.
    Edit2: Oh, so the problems seems to be calling SetTileData with a TileData with a tileId of -1, I was using it before when I didn't want to set any tile to the tile (since it is a procgen map, it was hard to keep track of everything) and it worked before, but now it throws the warnings.
     
    Last edited: Aug 1, 2019
  36. titan045

    titan045

    Joined:
    Apr 27, 2018
    Posts:
    7
    @Saishy The artifact is a "feature" of GPUs, specifically floating point numbers. It's undesirable for pixel art, but it's not caused by any fault of STME. It's literally how GPUs work. You can do a search on Texture Atlas Artifacts to learn more.

    If you have a rigid camera that locks itself to whole pixels (something like https://blogs.unity3d.com/2019/03/1...up-your-unity-project-for-retro-8-bits-games/) you can mostly work around it. But when you use a free camera (i.e. Scene view), even in 2D mode you should be able to trigger it. 2D in Unity lingo doesn't mean pixel perfect, which is why the above exists.
     
  37. Saishy

    Saishy

    Joined:
    Jun 3, 2010
    Posts:
    79
    So why did it never do that, from the first version of SuperTileMap, up to exactly this one?
     
  38. titan045

    titan045

    Joined:
    Apr 27, 2018
    Posts:
    7
    If you look at your tilesheet/atlas, the colored lines that show are pixels from neighboring tiles. If you've changed your tilesheet/atlas, this is why.
     
  39. Saishy

    Saishy

    Joined:
    Jun 3, 2010
    Posts:
    79
    I didn't change it.
     
  40. titan045

    titan045

    Joined:
    Apr 27, 2018
    Posts:
    7
    Okay, then try Zooming or Panning. Ultimately this is caused by the numerical error found in floating point numbers.
     
  41. GazingUp

    GazingUp

    Joined:
    Jun 16, 2015
    Posts:
    271
    This tool caught my attention. I have yet to buy it - however - I am dealing with some ... challenges regarding Unity's tilemap system. Perhaps you can sell this product to me if you can answer my question.

    I am trying to implement a top down (3/4 perspectives like zelda) jump system - bug free - I got this working so far with pure 2D colliders and sorting layers. As you may have guessed - this approach is riddled with bugs as everything involves trigger events and sorting layer changes. I was thinking maybe this is what the playstation game Alundra did - in playstation.

    But then I was thinking maybe this is possible if I can place 3D colliders on top of the 2D sprites.

    Can you place 3D Colliders on top of whole tilemaps? or tiles? Because this is not even an option with tilemap collider 2D in Unity.

    If not the 3D approach - perhaps you know a better approach to deal with varying heights in tilemaps ?
     
  42. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    The Undo/Redo is being a paint in the neck since the new Prefab Workflow was introduced. It is a very complex process and it's easy to find a bug if you find the use-case, but it's difficult to fix in each version and each case, so if it is not a very important issue I don't usually fix it (sometimes it could even be impossible to fix). There was a bug for example where an array always miss the first element when a redo is done. I have a fix with a workaround for that, but just as an example.

    About the random brush, it is caused because when you increase the tilemap limits, all the brushes in the borders should be updated. For optimization and for generics I don't make special cases for brushes and with random brushes it happens than all the tiles are updated if you increase the map limits. A way to avoid that is set the map size before painting.
     
  43. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Is it possible that you are painting the prefabs with a SpriteRenderer using the same sortingOrder value than the tilemap? I guess it is a Z-Fighting issue. Try using a different sortingOrder or Z position value.
     
  44. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Use UpdateMesh instead. It will Update the tilemap once during the next Update.
     
  45. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Did you enable the Pixel Perfect feature? It could cause this issue because it tries to make the pixels fit the screen pixel and sometimes it leads to make a tile a pixel smaller.
    I recommend you to check the FAQ section of the manual where there are some recommendations to fix those lines.
     
  46. CreativeSpore

    CreativeSpore

    Joined:
    Nov 6, 2014
    Posts:
    1,192
    Yes, you can use 3D colliders. You can set the width of the collider and it looks like this:
    upload_2019-8-14_17-45-50.png
     
    GazingUp likes this.
  47. GazingUp

    GazingUp

    Joined:
    Jun 16, 2015
    Posts:
    271
    This seems too good to be true. Do you think this would work with platforming on a 3/4 perspective game? Like how Supermario bros superstar saga or as Alundra (the below screenshots) had done?

    upload_2019-8-14_12-51-14.png

    upload_2019-8-14_12-54-38.png

    Each tilemap and object has its own height attribute, which now I am thinking were just 3D box colliders as i play the game to observe (this game was made in playstation 1 - so I don't think it was fully 2D. It seems to be completely glitch free - I can assume they utilized the PSX's 3D collision to the effect I am thinking of.)

    I said too good to be true, because how can you achieve what Unity's inbuilt tilemap is lacking so much on? :) I was literally trying to figure out how to get 3D colliders on my tilemaps.
     
  48. PolyGryph

    PolyGryph

    Joined:
    Jan 22, 2018
    Posts:
    9
    Is there a way to erase more than one tile at a time?
     
  49. ryanzec

    ryanzec

    Joined:
    Jun 10, 2008
    Posts:
    696
    @CreativeSpore I found either a bug in the collider generation or just that I am misunderstanding.

    I am using the Astar Path Finding Project with this package and so far everything has been working fine however all the maps I have been working with have consisted of multiple tile chunks per map which is probably why I have not see this issue yet. I was testing on a much smaller map that only have 1 tile chunk and noticed that the Astar Path Finding Project was saying none of my tile were passable which was weird.

    What I found was if a tile chunk has a section of tile that themselves don't have colliders (like sand) but are surrounded by tiles that do have colliders (like mountains), all the tiles inside of the ones that do contain colliders seems to also have colliders on them regardless if the tile itself should:
    2019-08-18 21_26_50-Window.png
    All the spots in red indicator there is a collider from the tile map over the center of that tile position.

    Is this the expected behaviour? If so, it there a work around so that I can surround tiles without colliders with tiles that have colliders but allow the tiles without colliders to not have collider in them with using Polygon 2D collider type (hopefully that make sense, a little hard to explain)?
     
  50. ryanzec

    ryanzec

    Joined:
    Jun 10, 2008
    Posts:
    696
    Also just to mention incase it is not clear, the blue line are passable and even though the passable area is surrounded by impassible tiles, since the edge of the tile chunk is passable (it is the other tile chunk that contains some of the impassible tiles), I don't see the same issues at the other instances.