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:
    93
    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:
    301
    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:
    93
    Here's the bug report :
    1117888
     
    Last edited: Jan 17, 2019
  4. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,214
    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:
    93
    Ah ok. Thanks, I didn't know that.
     
  6. ChuanXin

    ChuanXin

    Unity Technologies

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

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    301
    @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:
    93
    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:
    301
    Thanks! Got how to reproduce it.
     
  10. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    93
    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:
    301
    Hi, sorry for the lack of updates!

    This will be fixed in 2018.3.8f1.
     
  12. arkogelul

    arkogelul

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

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    93
    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:
    301
    Thanks, I will check this out!
     
  15. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    93
    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:
    301
    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:
    93
    Here's a video with some bugs I could reproduce.
     
  18. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    301
    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:
    93
    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:
    301
    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:
    93
    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:
    301
    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:
    93
    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:
    301
    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:
    93
    Thanks :)
     
  26. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    93
    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:
    301
    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:
    93
    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:
    93
    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:
    301
    Thanks! Will check out this issue.
     
    arkogelul likes this.
  31. arkogelul

    arkogelul

    Joined:
    Nov 14, 2016
    Posts:
    93
    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:
    301
    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:
    93
    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:
    301
    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:
    93
    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:
    93
    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:
    301
    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:
    93
    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 at 9:07 PM