Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

What is happening with this alpha...

Discussion in '2022.1 Beta' started by KamilCSPS, Sep 7, 2021.

  1. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    165
    1366041
     
    LeonhardP likes this.
  2. TieSKey

    TieSKey

    Joined:
    Apr 14, 2011
    Posts:
    225
    I'm not sure what are u referring to then. The only bug seems to be the lack of domain reloads regardless of the config checkbox value.
     
  3. MasoInar

    MasoInar

    Joined:
    Feb 20, 2014
    Posts:
    126
    Hey, is there any progress about this issue (1363963)? It prevents me testing the new alpha completely
     
  4. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    165
    I'm getting the same problem with 2021.2.0b12 now.
     
  5. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    We have a potential fix that is currently being reviewed internally. Earliest possible version with the fix would currently be a10.
     
    SugoiDev and MasoInar like this.
  6. volblob73

    volblob73

    Unity Technologies

    Joined:
    Sep 19, 2017
    Posts:
    36
    Hi. I think this problem with missing domain reload could be caused by a change where domain reload is moved inside asset db, when entering play mode. I have not been able to reproduce the issue with the cases provided in this thread :-(.

    I can see there is change in behaviour (unintended) related to EditorApplication.LockReloadAssemblies() / UnlockReloadAssemblies(), which didn't get checked before. Could one of you try to add this method to a class and run it to see if it restores domain reloads when entering playmode:

    Code (CSharp):
    1. [MenuItem("MyMenu/Do UnLock")]
    2. static public void Unlock()
    3. {
    4.     UnityEditor.EditorApplication.UnlockReloadAssemblies();
    5. }
     
  7. TieSKey

    TieSKey

    Joined:
    Apr 14, 2011
    Posts:
    225
    It's not doing anything in my repro project.
     
  8. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    165
    Doesn't do anything at any point.
     
  9. volblob73

    volblob73

    Unity Technologies

    Joined:
    Sep 19, 2017
    Posts:
    36
    I am preparing a fix, where the behaviour related to EditorApplication.LockReloadAssemblies is restored. We haven't been able to reproduce the issue in the two cases we got - 1366041 and 1365789. I also noticed that if asset database is set in editing mode (AssetDatabase.StartAssetEditing has been called with AssetDatabase.StopAssetEditing call pending) that would also prevent the domain reload when entering play mode. This is however considered an error and I will add an error log, if this scenario is preventing a domain reload.
     
  10. TieSKey

    TieSKey

    Joined:
    Apr 14, 2011
    Posts:
    225
    I find it really weird that u can't reproduce the issue since it happens on brand new projects without touching/adding anything. So it must be either OS dependent (exact .net installation?), or u guys are not using the exact same version of unity as us.

    It might be very silly but are u testing on Unity versions installed right from the Unity Hub like us? or are u pulling it from some internal repo or pre-built testing vm, etc? What are the chances that there is an un-adverted version diff between test beds and actually published version? (I mean, it shouldn't be the case at all but re-checking it should be quick)
     
  11. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    165
    I tested this with a fresh project where all I did was create one script and add it to the scene. It is very reproducible.
    I doubt it's my system. I run a standard Windows 10 with the latest updates and it's highly unlikely that any of the running programs interfere that much with the Unity installation.

    Same fresh project (in the respective latest versions):
    2021.1: Domain reload works
    2021.2: Domain reload doesn't work
    2022.1: Domain reload doesn't work
     
  12. volblob73

    volblob73

    Unity Technologies

    Joined:
    Sep 19, 2017
    Posts:
    36
    Yeah, it is really strange. Multiple persons in Unity have tried to reproduce them and we are using clean Unity Hub installs matching the versions in the cases reported.

    I will soon have a fix ready with the changes I mentioned above and will make a custom build of it available. It would be great if any of you that have the missing domain reload could give it a try. I hope to have a build ready tomorrow.
     
    TieSKey likes this.
  13. volblob73

    volblob73

    Unity Technologies

    Joined:
    Sep 19, 2017
    Posts:
    36
    Does it also happen if you create an empty project and enter play mode without any changes? From the speed of the domain reload you can probably tell if there is a domain reload - also you should see 'Mono: successfully reloaded assembly' entries in the editor.log, when domain reload is completed.
     
  14. Unity 2022.1.0a8
    and
    Unity 2021.2.0b12
    test for domain reload.
    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. public class Test : MonoBehaviour
    4. {
    5.     private static int _reloads;
    6.  
    7.     private void Awake() => Debug.Log($"There have been {_reloads++} runs without reload!");
    8. }
    screenshot.png

    screenshot1.png

    If I'm not mistaken this means everything is working for me. It is a brand new project (simple 3D), default packages and settings except for the Enter Play Mode Options. The static variable gets zeroed out if I check the Domain Reload setting too (so that's working as well). I'm on Windows 10 (all updates are installed).
     
    Last edited by a moderator: Sep 21, 2021
    valarnur likes this.
  15. volblob73

    volblob73

    Unity Technologies

    Joined:
    Sep 19, 2017
    Posts:
    36
    Yes, this is the expected behaviour. Thank you for testing it.
     
  16. TieSKey

    TieSKey

    Joined:
    Apr 14, 2011
    Posts:
    225
    No "Mono: successfully reloaded assembly" for empty project.

    Btw, did something change on a8? I'm still on 7 since change log didn't mention anything regarding this issue (nor net 2.1 missing dll facades, etc)

    Code (csharp):
    1.  
    2. Asset Pipeline Refresh (id=9ed412c32bc0c8244a66904f86c8f0df): Total: 0.025 seconds - Initiated by RefreshV2(AllowForceSynchronousImport)
    3. Reloading assemblies for play mode.
    4. Asset Pipeline Refresh (id=c245540fe7523034db368c0483a409ec): Total: 0.021 seconds - Initiated by StopAssetImportingV2(ForceSynchronousImport)
    5. Loaded scene 'Temp/__Backupscenes/0.backup'
    6.     Deserialize:            0.530 ms
    7.     Integration:            148.742 ms
    8.     Integration of assets:  0.001 ms
    9.     Thread Wait Time:       0.006 ms
    10.     Total Operation Time:   149.279 ms
    11. Asset Pipeline Refresh (id=faf1dac9024182e47a04e991a1acf1b6): Total: 0.021 seconds - Initiated by RefreshV2(AllowForceSynchronousImport)
    12. Unloading 0 Unused Serialized files (Serialized files now loaded: 1)
    13. Loaded scene 'Temp/__Backupscenes/0.backup'
    14.     Deserialize:            0.505 ms
    15.     Integration:            15.381 ms
    16.     Integration of assets:  0.001 ms
    17.     Thread Wait Time:       0.005 ms
    18.     Total Operation Time:   15.891 ms
    19. Unloading 59 unused Assets / (18.6 MB). Loaded Objects now: 4559.
    20. Memory consumption went from 146.5 MB to 127.9 MB.
    21. Total: 37.623300 ms (FindLiveObjects: 0.379400 ms CreateObjectMapping: 0.088900 ms MarkObjects: 34.403400 ms  DeleteObjects: 2.750300 ms)
    22. Asset Pipeline Refresh (id=16face8b7c7b0a645b8e440e9f00ec65): Total: 0.021 seconds - Initiated by RefreshV2(AllowForceSynchronousImport)
    23. Reloading assemblies for play mode.
    24. Asset Pipeline Refresh (id=f0ce2a4dea7da174486db8430868ed66): Total: 0.019 seconds - Initiated by StopAssetImportingV2(ForceSynchronousImport)
    25. Loaded scene 'Temp/__Backupscenes/0.backup'
    26.     Deserialize:            0.406 ms
    27.     Integration:            16.102 ms
    28.     Integration of assets:  0.001 ms
    29.     Thread Wait Time:       0.007 ms
    30.     Total Operation Time:   16.516 ms
    31. Unloading 0 Unused Serialized files (Serialized files now loaded: 1)
    32. Loaded scene 'Temp/__Backupscenes/0.backup'
    33.     Deserialize:            0.172 ms
    34.     Integration:            15.314 ms
    35.     Integration of assets:  0.001 ms
    36.     Thread Wait Time:       0.006 ms
    37.     Total Operation Time:   15.494 ms
    38. Unloading 56 unused Assets / (12.7 KB). Loaded Objects now: 4527.
    39. Memory consumption went from 127.6 MB to 127.6 MB.
    40. Total: 34.511500 ms (FindLiveObjects: 0.364700 ms CreateObjectMapping: 0.087300 ms MarkObjects: 33.944100 ms  DeleteObjects: 0.114400 ms)
    41. Asset Pipeline Refresh (id=e8c826ac02be3d546adac7efc5ac41a8): Total: 0.024 seconds - Initiated by RefreshV2(AllowForceSynchronousImport)
    42.  
     
  17. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    165
    No domain reload is happening for me on a fresh project (version a8) with zero changes. Straight into play mode.
    Also playing around with the option doesn't enable domain reload. It's just always off.
     
  18. volblob73

    volblob73

    Unity Technologies

    Joined:
    Sep 19, 2017
    Posts:
    36
    Thank you guys for testing with a empty project. An internal dev also reported the issue tonight and is testing if the fix solves the problem for him.
     
    mahdi_jeddi likes this.
  19. volblob73

    volblob73

    Unity Technologies

    Joined:
    Sep 19, 2017
    Posts:
    36
    The dev has confirmed the issue is resolved with the fix. I will not make a custom build available, but proceed in getting fix to trunk and backported to 2021.2.
     
    Last edited: Sep 21, 2021
  20. lawsonh

    lawsonh

    Joined:
    Jul 25, 2018
    Posts:
    80
    So was the speed improvement a bug?
     
  21. volblob73

    volblob73

    Unity Technologies

    Joined:
    Sep 19, 2017
    Posts:
    36
    The issue with the missing domain reload when entering play mode is a bug.
     
    KamilCSPS likes this.
  22. mishakozlov74

    mishakozlov74

    Joined:
    Aug 8, 2018
    Posts:
    143
    Is there a way to keep it this way? I don't want to wait for 10 seconds before every play again.
     
  23. See my screenshot in my previous post. Keep the "Enter Play Mode Options" setting checked and initialize your statics, basically. The domain won't be reloaded. And keep in mind not every assets or even packages are compatible with this setting as of today. Sadly.
     
  24. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    165
    just disable domain reload.

    yes. nothing major has changed.
     
  25. apkdev

    apkdev

    Joined:
    Dec 12, 2015
    Posts:
    283
    Or rather, the bug was a feature (activated by accident). It's amazing how many people still don't know about Enter Play Mode Options.

    upload_2021-9-23_0-18-59.png
     
    Deleted User likes this.
  26. mishakozlov74

    mishakozlov74

    Joined:
    Aug 8, 2018
    Posts:
    143
    So, are you saying that this alpha has forced it to avoid reloading, even when it's not compatible with asset?
     
  27. Apparently in some cases (unclear for me when, as per my post I did not experience the problem) this option is/was treated as if it is always set. So sometimes the domain reload doesn't happen for some reason.
    That's the bug.
     
  28. volblob73

    volblob73

    Unity Technologies

    Joined:
    Sep 19, 2017
    Posts:
    36
    For clarity, assets should always be compatible with having domain reload disabled when entering play mode. Diabling domain reload for play mode impacts scripting state. As an example static variables will no longer be reset. You can read mode about disabling domain reload for entering play mode here:

    https://docs.unity3d.com/Manual/ConfigurableEnterPlayMode.html
    https://blog.unity.com/technology/enter-play-mode-faster-in-unity-2019-3
    https://forum.unity.com/threads/configurable-enter-play-mode.768689/
     
    Lurking-Ninja and apkdev like this.
  29. Shizola

    Shizola

    Joined:
    Jun 29, 2014
    Posts:
    475
    I'd be curious to know the technical reason why it wasn't replicating on some of your machines, seems interesting.

    And I've always thought the domain reload tickbox should be near the play button. I know that doesn't keep it simple for beginners, but it's so hidden away at the moment I don't think people use it.
     
    FernandoMK and mishakozlov74 like this.
  30. DoctorShinobi

    DoctorShinobi

    Joined:
    Oct 5, 2012
    Posts:
    219
    Make it too accessible and you'll end up with people breaking their own projects and blaming Unity for having bugs instead of understanding how to use that feature. And since you only tick it once per project, it's probably a waste of space to put it near the play button.

    I do agree though that not enough people know about this feature, which IMO is one of the best things to know about when working with Unity
     
    Last edited: Sep 24, 2021
  31. TieSKey

    TieSKey

    Joined:
    Apr 14, 2011
    Posts:
    225
    Well, with that logic no feature should be public. I'm not saying it won't happen at all, I'm saying u have to swallow the pill or be one of those companies that treat users as stupid kids.

    Also, if the button were more accessible I'd use it more. It's not a once per project setting.
    For example, I have a lot of stuff that needs a domain reload. But, sometimes I'm only working on UI scenes were I could take advantage of the quick play mode.
     
    useraccount1, Shizola and NotaNaN like this.
  32. lawsonh

    lawsonh

    Joined:
    Jul 25, 2018
    Posts:
    80
    Interesting.. what if there was a dropdown to change the play button into a quick play button
     
    NotaNaN, Shizola and TieSKey like this.
  33. TieSKey

    TieSKey

    Joined:
    Apr 14, 2011
    Posts:
    225
    Yup, exactly my though.
    With a BIG RED warning link appearing in quick mode u can click for additional info (since there's a ton of wasted space in that tool bar anyway :p)
     
  34. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    165
    It's an issue of fast vs safe.
     
  35. mishakozlov74

    mishakozlov74

    Joined:
    Aug 8, 2018
    Posts:
    143
    I personally think that if we could hold play button to see small dropdown with another play button without reloading domain - it would be great.

     
    Last edited: Sep 24, 2021
  36. JoNax97

    JoNax97

    Joined:
    Feb 4, 2016
    Posts:
    611
    The thing is, there’s not a case where you want to play without Domain Reload sometimes.

    If your project supports it, there’s no reason to choose the slower option. And if it doesn't... well then it won’t work.
     
    apkdev, Luxxuor, Prodigga and 2 others like this.
  37. gasppol

    gasppol

    Joined:
    Feb 16, 2020
    Posts:
    33
    Exactly. That's the reason behind being a Project Setting.
     
    Luxxuor and Prodigga like this.
  38. mishakozlov74

    mishakozlov74

    Joined:
    Aug 8, 2018
    Posts:
    143
    Yes, I see.. It doesn't make sense, you're right.
     
    Prodigga likes this.
  39. TieSKey

    TieSKey

    Joined:
    Apr 14, 2011
    Posts:
    225
    No offence but, are u guys reading the entire thread or just writing?
    I already told u I do have a use case in my project where I could take advantage of skipping domain reloads.... even if the whole project can't.

    My project have 10ish scenes. 4 of those are UI only which can be tested/adjusted in play mode w/o the entire game logic running. I don't need a domain reload while working on that scenes, but I do when doing a full run.

    I assume my case is not that unique that no other devs could do the same....

    ------------------------------------------------------------------------------

    Should we "hide" the "disable" checkbox for gameobjects too? U know, if some dev unchecks that and their stuff stops working they could complain to unity...
    Sorry for the sarcasm but I can't help it when highly specialized/work software wants to fool proof their UIs like a kids game on the android store.
     
  40. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    "Our domain reload dream, shattered, by something.. or someone"
     
  41. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    So the separate play button will only be useful for projects that require domain/scene reload under normal circumstances?

    The idea being that when you ~know~ that in your project in this specific scenario the domain/scene reload is not required, even though it normally is, you can use this quick play button?

    Man, that sounds ridiculously janky and not something I think they'd want to support officially.

    Either your project supports it properly or it doesn't, for everything else just extend the editor and add this functionality that you want. Should be easy to toggle the setting and call EditorApplication Enter Play Mode or whatever the method is.
     
    NotaNaN, JoNax97 and Luxxuor like this.
  42. TieSKey

    TieSKey

    Joined:
    Apr 14, 2011
    Posts:
    225
    The idea being that when you ~know~ that in your project in this specific scenario the domain/scene reload is required, even though it isn't for all scenes, you don't have to.. ignore this quick play button and use the regular one?

    Or the idea being that when you don't ~know~ that in your project domain/scene is required or not, you don't have to.. ignore this quick play button and use the regular one?

    Man, that sounds ridiculously janky and not something I think they'd want to support officially?


    Why does an optional/QoL feature hurt u or anyone else not interested in using it?

    No, the "all or nothing" support is something u are making up. Partial support is a reality.
    Unity has the chance to make the feature more usable/known and mitigate part of the creeping slowness we have been suffering since almost 2 years ago.

    So, we have a "live link" button in the "play toolbar". My project is PC only, I'd never ever use that button. Should I ask unity to move it to project settings?

    We have a "cache server" toggle in the status bar. I don't own a cache server license so it should be a "project level setting". Should we remove the toggle cuz I don't find it useful for me?

    We have a "Auto generate lightning" toggle in the status bar. My project uses only real time lightning (procedurally generated terrains). That button is useless for my project, lets remove it cuz it is obviously a "set once at project level and forget", right??

    We even have an "account" button that totally belongs to the Hub, not the editor main interface :shrug:

    Point is, QoL features might not be used by some people, that doesn't mean they are not worthy of some visibility, they just have to be easy to ignore.
     
    Shizola likes this.
  43. Wokky

    Wokky

    Joined:
    Apr 3, 2014
    Posts:
    11
    @TieSKey In my opinion your usecase is extremely niche. Do you really think Unity's development time should be spent on reworking a fundamental part of the editor interface, documenting and explaining it to users when maybe five people will ever actually have a use for it?
     
    apkdev, Prodigga and JoNax97 like this.
  44. lawsonh

    lawsonh

    Joined:
    Jul 25, 2018
    Posts:
    80
    I have a similar use case, would love to have such a play button in the editor.
    I need to do domain reload once in a while to reset the state, but for normal use I prefer quick play
     
    Shizola likes this.
  45. lawsonh

    lawsonh

    Joined:
    Jul 25, 2018
    Posts:
    80
    although a better fix would be if Unity just makes entering play mode faster so even with domain reload it is very fast.
     
    hippocoder and laurentlavigne like this.
  46. I'm with @Prodigga on this one.

    There is no live link button in 2021+ versions. At least not for me. I'm desktop only though.

    I could support a quick setting feature in the status bar. It's less annoying than one more rarely used option in the header area. We really should fight for remove that space, not add to it. IMHO - of course.

    But if it needs to be, I would like to see the play button as a combo button. Always "normal" play upon click (depending on the settings) and the opposite option in drop down.
     
  47. TieSKey

    TieSKey

    Joined:
    Apr 14, 2011
    Posts:
    225
    That was the proposal above. A clueless "script kiddie" wouldn't even notice its there.

    I'm 100% with you there. Status bars, in general, are quite useless. If there's some important text u want to display, either use tooltips o some kind of mini popup u can dismiss or completely disable.
    Let's get rid of the tittle bar too.... I don't really get why they keep it on a software with 100% custom UI (with custom UI I mean they are not using some default windows controls.)

    Maybe, maybe not. U say it's niche I say it's not that uncommon. We can't know.
    Point is, the heavy lifting was done when enter play mode options got implemented. Turning the play button into a "click to use, hold to dropdown" button should take them 20 mins.
    Aaaaaand, well, documenting and explaining is not an issue, unity never does such things in the first place anyway :p
     
  48. apkdev

    apkdev

    Joined:
    Dec 12, 2015
    Posts:
    283
    Hey guys, just letting you know that I encountered an eerily similar problem on 2021.2.0b13 (
    PlayModeStateChange.ExitingEditMode
    fires too late which breaks Addressables). Can you confirm that I'm dealing with the same issue?

    See my thread:
    https://forum.unity.com/threads/addressables-dont-work-in-editor-in-fast-mode-2021-2-0b13.1174979/
     
  49. oobartez

    oobartez

    Joined:
    Oct 12, 2016
    Posts:
    167
    @volblob73 This is just let the Unity team know that the bug is preventing us from upgrading. We are currently stuck with b7 because other blocking bugs in b8-b12 prevented us from upgrading (but those are now fixed).

    So fingers crossed for a quick fix.
     
  50. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    I reported a bug related to this, I think they fixed this in the older beta, maybe they didn't include the fix for this alpha