Search Unity

Ghost tiles spawned when painting on a tilemap in prefab mode

Discussion in 'Prefabs' started by arkogelul, Jan 16, 2019.

  1. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    Hi everyone,

    When painting in prefab mode on a tilemap, the brush tool spawns ghost tiles right after painting.
    If I click and move my cursor immediately after releasing the click, ghost tiles are spawned over the course of the cursor.

    Those ghost tiles disappear when I hover over them with the brush tool and only the brush tool.
    If I hover over those with the eraser (or any other tool than the brush), it won't do anything.
    And obviously, I can't erase them as they don't exist.
     
  2. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Hi, are you using the Default Brush from the Tile Palette and getting this issue, or other brushes?

    If you could share more details or your reproduction project with the Unity Bug Reporter, that would be helpful, thanks!
     
  3. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    Here's the bug report :
    1117888
     
    Last edited: Jan 17, 2019
  4. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    Note that posting the link to fogbugz allows everyone to see all of your bug reports.

    I generally don't care that people can, but the mods tend to assume that you messed up when you post the link, so ymmw. You can just post the ID of the bug report (1117888 in your case), and Unity staff will be able to find it.
     
  5. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    Ah ok. Thanks, I didn't know that.
     
  6. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Thanks, will check this out!
     
  7. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    @arkogelul Sorry to bother you, would you mind adding a video clip of the issue to the bug report, or possibly clarify which views you see the ghost tiles (prefab mode, Game View, Scene View etc)? Thanks!
     
  8. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    Sure thing, I hope it helps.
    If you need anything else, don't hesitate to ask.
    (Don't forget to activate the subtitles, I'm commenting along the video)

     
    Last edited: Jan 18, 2019
  9. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Thanks! Got how to reproduce it.
     
  10. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    Hi, just wanted to know if there were any news on this tile issue.
    Thanks.
     
  11. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Hi, sorry for the lack of updates!

    This will be fixed in 2018.3.8f1.
     
  12. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    Thanks :)
     
  13. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    I don't know if it's related, but I also have some major graphic bugs on the game view when I edit a tilemap in prefab mode.
    It can display tiles that are not even related to the one I'm painting.
    I reckon it might be related to the bug you fixed, but I wanted to give you the info in case it's not.
    Thanks again !
     
  14. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Thanks, I will check this out!
     
  15. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    I would like to say that I love the fact that us users are able to talk to you guys and have such fast feedback (not only for that particular case).
    I know it's what forums are for, but I really do appreciate it.
    I don't see that comment a lot, and I assume that's obvious to think but I wanted to say it :)
     
  16. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Hi, sorry to bother you, could I trouble you for a screen capture of the graphics bugs that you see in the GameView, as well as the reproduction steps? Thank you!
     
  17. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    Here's a video with some bugs I could reproduce.
     
  18. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Wow, what an interesting issue!

    The pink Tiles you see in the Tilemap in the GameView (Prefab instance in Scene) are special Tiles which show that the original Tile Asset is now invalid. The reason why the Green Tile Asset became invalid is because the Prefab and the Prefab instance have become de-synced. The Prefab instance stores only overrides (or changes from the Prefab) and does not have the full working dataset compared to the Prefab. This means that if the Prefab does not have the Green Tile Asset, the Prefab Instance will not have it as well as that is not captured as part of the overrides.

    Similarly, when both Tiles at a particular position on the Prefab and the Prefab instance have changed, it becomes unclear for the Prefab instance to reconcile the differences.

    I will also look into the error you get in the console too!
     
  19. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    A little bit off topic but there's something that's bothering me for quit some time.
    In the tile palette, if I click on a tile, it automatically uses the eyedropper (to pick the tile) and get back to the tool previously selected. Which is fine when I have the brush tool selected.
    But when I have the eraser tool active, I think it would be better to switch to the brush tool when I click on a tile.
    I never found myself wanting to have the eraser tool selected when I click on a tile. I always want to paint the given tile.
    What do you think ?
     
  20. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Lets see if I get this right: After picking from the Pick tool (eyedropper), you would like to go back to the Brush tool instead of the previous tool (Erase tool)?

    I would say there that is fair, however the Pick tool is also generally used to change the brush size too, which may be useful when trying to erase a large block? Possibly we could detect if the brush size remains at 1x1, we could swap to a paintable tool like the Brush tool.
     
  21. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    Here's a video to explain better what I meant.



    Thanks again for being around:)
    (don't forget to activate caption)
     
    Last edited: Apr 4, 2019
  22. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Sorry for the late reply, thanks for the video! I get what you mean by picking from the Tile Palette, and not I mentioned about picking in general.

    That sounds fair, and should switch to the Brush tool or one of the Painting tools, if that was selected before. I will check this out!
     
  23. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    That's fine, thanks again for taking the time.
    Do you have a rough estimate of the Unity version those features will be implemented in ?
     
  24. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    I would say tentatively 2019.2. Not much time to make it for the 2019.1 initial release!
     
    arkogelul likes this.
  25. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    Thanks :)
     
  26. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    Hi ChuanXin,

    First of all, thanks again. I just updated my project on 2019.1 and the tilemap issue is gone for good. That's great :)
    But I stumbled upon a couple of weird issues.
    The most annoying one is that my project is now limited to 30fps in build. I tried in a blank project and the problem remains. No matter what Vsync count parameter I pick, it's still limited at 30fps in build.

    EDIT:

    The changes you made are great, unfortunately we'll not be able to use them. 2019.1 is way too buggy.

    There is this framerate problem, but there is also a sound problem (AudioSource.PlayOneShot seems to skip part of sound sometime).

    I also have methods using Time.DeltaTime before that worked fine and now it's super slow in game.

    For all those reasons I'm forced to go back to 2018.3
    I hope those are little things to fix because the others upgrades are cool.

    EDIT²:

    I found out what was wrong about the framerate issue. In 2019.1 when I have an additional monitor plugged in (HDMI) and I duplicate my display, the framerate of my builds is limited at 30fps. (in 2018.3 it worked fine. I used to playtest on my secondary monitor).

    I also found out about the sound issue. It seems that in 2019.1, AudioSource.PlayOneShot is not as efficient as in 2018.3. The more gameobjects (sprite with animator) there is in the scene, the more buggy the sound becomes.
    I found that using AudioSource.Play works better. But still, it worked fine in 2018.3.
     
    Last edited: Apr 19, 2019
  27. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    I'm not sure about the issues you are having with frame rate and with AudioSource. If you could file separate bugs for these cases, that would be helpful!
     
  28. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    I've filed bug reports for both issues. Someone emailed me back that they managed to reproduce the audiosource bug. But nothing about the framerate issue caused by the secondary monitor, although it's reproducible on any computer.
    I'll wait, but I'm still not able to use the 2019.1 update until this is fixed. I'm looking forward using the new tilemaps tools you corrected.
     
  29. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    Hi Chuan Xin,

    I'm testing 2019.3 beta and I've got a couple of issues with the tilemap feature.
    I actually wanted to record a video to show you a bug where the cursor freezes at the end of a stroke, but I found another one where the tile is never displayed on screen, but still exists (can be selected).

    Case 1181256
     
    Last edited: Sep 3, 2019
  30. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Thanks! Will check out this issue.
     
    arkogelul likes this.
  31. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    The bug about tile not displaying isn't a bug. I forgot to set the pixel per unit of the image to 1, so it looked tool small to be seen. Sorry for that.

    About the actual bug I was talking about before, I could reproduce it.
    As you can see, the more I paint tiles, the longer there is to wait after each stroke.

    Case 1181342

    I work on 2018.3 and I have huge tilemaps and everything is fine. This actually is how I found out about this, I just opened up my project in 2019.3 and started to paint, and there were massive lags. Which was not the case in 2018.3.

    I remember testing the same project in 2019.1 and the painting was great. No lag, no graphic bugs.

    Thanks again Chuan
     
    Last edited: Sep 3, 2019
  32. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Hi, I tried out the project in case 1181342 and it seems fine for me. However, based on your video, it seems that Auto Save for Prefab editing is turned on? That normally does reduce performance for Prefab editing with a large Tilemap, even in prior versions (down to 2018.3). Does turning it off improve the performance for you? Also, was this turned on for you in the prior versions but without the problems in performance?
     
  33. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    The thing is, it works fine in 2018.3. It just doesn't refresh properly (this is what this thread was initially about). Auto-save is a very useful feature and I use it all the time.
     
    Last edited: Sep 5, 2019
  34. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Thanks! That helps to narrow down the problem. In the meantime, does turning off Auto-Save help in this case? Also, just to note, Auto-save does reduce performance when editing a really large Tilemap Prefab, due to the time spent saving and serialising the data.
     
  35. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    In 2019.3, I turned auto-save off and it does remove the little loading time at the end of the stroke.

    We also tested to turn off auto-save in our 2018.3 project and it actually removed the problem we initially had (the ghost tiles spawned at the end of strokes). But we never experienced any slow down while working on tilemaps (even huge ones) in 2018.3.

    I tested with the same project and the same tilemap with 2018.3 and 2019.3 and with auto-save turned on:
    2018.3 is fine and 2019.3 lags at the end of a stroke (as in the video from my earlier port).

    Thanks Chuan.
     
  36. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    Hi Chuan,

    Does my last post ring any bells ? Auto-save seems faulty from the begining.
     
  37. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    The hitch at the end of the stroke occurs when auto-saving the prefab (Auto-Save saves your changes after detecting an edit when one occurs, where the edit happens with the end of a Paint). Since the Tilemap has a lot of Tiles, it will naturally take a long time to save.

    It is strange that you do not have this lag issue at the end of the stroke with 2018.3 with AutoSave on (I tried it with the project in 1181342, and I do see the lag). Do you see the "Auto Saving..." tag next to the AutoSave checkbox after each stroke in 2018.3 with AutoSave on?
     
  38. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    Hi Chuan,

    Thank you for taking the time. I appreciate it !
    Here's a video comparing 2018.3 and 2019.3 in the same project on the same tilemap.
    I hope it will help.

    To answer your question, no, I don't see anything next to the AutoSave checkbox after each stroke, neither in 2018.3 nor in 2019.3.

    EDIT: Don't forget to turn on the caption, I comment along what's going on.

     
    Last edited: Sep 13, 2019
  39. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Hi, sorry for the delay! I have located the issue in saving between 2018.3 and 2019.3. In 2019, after saving the Tilemap prefab, it will refresh all the Tiles in the Tilemap in Prefab mode. This causes the additional lag that you are seeing since auto-saving is pretty quick for you. I will get a fix in for this. Thank you for pointing this out!
     
    arkogelul likes this.
  40. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    Thanks a lot Chuan :)
     
  41. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    I just checked and found out that all the editing tools of the tile palette have the same laggy behavior.

    If I move a selection of tiles.
    If I paint.
    If I paint a filled box.
    If I erase.
    If I fill with the bucket.

    All of these actions lag.
     
  42. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Will check the fix to see if the performance of these tools are fixed as well!
     
    arkogelul likes this.
  43. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    @arkogelul Hi, I have a couple of questions about the 2018.3 and 2019.3 lag issue to validate our fix for testing which I hope you can help with:
    • Before editing the prefab in Prefab mode, in the main Scene, did the Tilemap prefab instance have any changes? This is shown in the Inspector window under Overrides, where if you click on Overrides, it will show the changes if any.
    • Would it be possible to share a screenshot using the Unity Profiler Window while profiling the Editor? In particular, I would like to have the profile frame where it is auto-saving the prefab. Here is an example Profiler.PNG
    Thanks for your help!
     
  44. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    In all the tests I ran, I actually always edited the prefab directly from the project window. There were no prefab in the main scene. So to answer your question, no, there were no changes in the prefab before editing.

    Here are the profiler screenshots. I hope it shows everything you need. Ask me back if it doesn't.
    profiler_2.png profiler_3.png

    Here's the profiler data file in case you'd need it.
    https://srv-file7.gofile.io/download/HBK54p/profiler_data.data

    Cheers !
     
    Last edited: Sep 24, 2019
  45. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    @arkogelul Thanks for the screenshots!

    For the profiler data file, I get the following error:
    You are not authorized to download this file.

    Could it be attached to the post or sent as part of the case 1181342?
     
  46. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    @ChuanXin here it is.
    Out of curiosity, how could I send a file to a case after having send the report ?
     

    Attached Files:

  47. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    That is a good question. I think you can only reply and send files to the issue only if we first reply to you on that issue.
     
    arkogelul likes this.
  48. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    105
    Hi Chuan,

    I was looking for the case adressed here (1181342) in the issue tracker page to check its status, and couldn't find it.
    Could you tell me how to access it please ?

    Regards,
     
  49. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068