Search Unity

DOTS Editor 0.7.0-preview Release

Discussion in 'Entity Component System' started by raymondyunity, May 26, 2020.

  1. raymondyunity

    raymondyunity

    Unity Technologies

    Joined:
    Apr 30, 2018
    Posts:
    122
    With the release of 0.7.0-preview of the DOTS Editor package we have now released the new Systems Window. This can be found in the file menu “Window > DOTS > System Schedule”.





    The System window is an improvement over the systems list view of the Entity Debugger. Its purpose is to allow users to debug and discover the systems in their DOTS enabled project. In the close future, it will also allow users to see the interaction between entities and the systems acting on them.


    First, you’ll notice the new icons that represent System Groups, Systems, and ECB Systems. This is to help easily pinpoint the different types of systems in the project.


    We can now also disable System Groups.


    To keep world information manageable, we have hidden the other worlds in the world dropdown list. To enable it again, we have added a setting to show all of the available worlds in the project in the Preferences window. We have also moved the options (“Show Full Player Loop” and “Show Inactive Systems” to the right of the search button.





    When a system is selected, there is now a Systems details preview window that shows up on the bottom and can be hidden by clicking on the header. This allows a user to view the queries related to the system and also contains a button that will show system dependencies only defined by that system.


    By clicking on a component in the Queries section, a user can also find other systems that have queries containing the same components.





    Filter Syntax
    To filter by a component: c:<component name>
    To filter by system dependency: sd:<system name>


    Please leave your feedback here and any issues that you may have noticed.


    Enjoy!


    Known Issues:
    • Limited search. The search is currently a limited feature, for example, it is only filtering strings and only inclusive matches.

    • The details section of the System window can cover a selected system
     
  2. OldMage

    OldMage

    Joined:
    Jun 25, 2018
    Posts:
    10
    I'm just a DOTS beginner, but this is amazing. In a few seconds I had the package installed and was able to disable and enable systems. Even just messing with disabling gravity or 2D Collision checking felt responsive and just really cool to mess around with.
     
  3. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    967
    This editor is asuming that you use AutoCreation for systems and the default player loop.
    How can we use this with a custom loop?
     
    NotaNaN, msfredb7, Wobbers and 6 others like this.
  4. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    Just add few cents:
    We have additional root system group EarlySimulationSystemGroup that runs before MonoBehaviour.Update
    Do this window will work with it?

    Additionally for hybrid projects where DOTS work alongside GameObjects add markers of default events in PlayerLoop like: Update, FixedUpdate, LateUpdate... so we can understand where our system invoked relative to MonoBehavior Logic
     
    Orimay and msfredb7 like this.
  5. raymondyunity

    raymondyunity

    Unity Technologies

    Joined:
    Apr 30, 2018
    Posts:
    122
    It should show custom groups and custom systems (systems with DisableAutoCreation/AlwaysExecute/UpdateinGroup attributes). Enable "Full Player Loop" in the top right options button to see the Unity monobehaviour systems. If things aren't working as expected, can you please share some more details.

    There is currently a bug where you cannot see a custom system if it is being scheduled against another world (aka a custom player loop). You should still see it with show Full Player Loop. The work around is to view it in the EntityDebugger for now if you want to view the list per World.
     
  6. JoNax97

    JoNax97

    Joined:
    Feb 4, 2016
    Posts:
    611
    This is great. Keep it up!
     
  7. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    @raymondyunity it's definitely an upgrade, but what's confusing is that now we have both the
    Systems
    window as well as the
    Entity Debugger
    window, which also had a
    Systems
    panel. Information in those two is largely duplicated and I assume they'll be merged back together into one, since Systems and Entities are coupled together so tightly?
     
  8. martinpa_unity

    martinpa_unity

    Unity Technologies

    Joined:
    Oct 18, 2017
    Posts:
    480
    @nicolasgramlich Not exactly, we intend to do the opposite. :)

    The next window that we will release will most likely be a dedicated entities window. The first step will be to release it as a standalone window (just like this one) in order to gather feedback from users. While iterating on the feedback, we'll add connections between the two windows, such as filtering the entities by systems and by query. We'll also revamp the search to allow searching by name and by id.

    We know it is a little confusing to have the new tooling sit beside the Entity Debugger, but we feel it is a necessary evil until we can offer at least the same feature set. Once we are satisfied that the new windows provide a better experience for the users, we will remove the Entity Debugger.
     
    NotaNaN, JesOb, Orimay and 2 others like this.
  9. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    Ah I see. Curious how you're going to do that "cross window linking" part without it being confusing :)
     
  10. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    857
    Will we be able to modify simple component data at runtime like changing ints, floats, bools etc with this upcoming window? :)
     
  11. martinpa_unity

    martinpa_unity

    Unity Technologies

    Joined:
    Oct 18, 2017
    Posts:
    480
    @thelebaron Initially, the entities window will allow to browse the entities using the Parent and Child relationship. It will not affect how the entity inspector currently works.

    However, we are also looking into revamping the entity inspector. That should come after the entities window. As a starting point, we'll only allow custom inspectors to be written. After an internal pass on creating inspectors for Unity provided components (let's not ever run into setting yourself as a parent), we'll look into allowing to write back to the entity. It's one of those things where it's very easy to activate, but difficult to nail down, as there are many pitfalls. For example, editing a shadow World would corrupt the GameObject conversion. This one is easy to spot, but there are definitely other, more devious situations where editing can be problematic. So we will take our time on that one and make sure it will be safe and pleasant to use.
     
  12. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    967
    I think the DOTS editor looks great but I'm having trouble with the project assumptions you're making.

    First of all, I don't want to run the game to see systems, components, dependencies, etc...
    There's a lot of information to show without any actual runtime data.

    And please provide an API to register worlds, groups, systems so for those who use a custom bootstrap can also enjoy this tool. I don't need anything automagically.
     
    Orimay likes this.
  13. martinpa_unity

    martinpa_unity

    Unity Technologies

    Joined:
    Oct 18, 2017
    Posts:
    480
    @Enzi One thing to note is that our mandate with these windows is to surface what is going on under the hood. We will be more than happy to change the tooling whenever the underlying systems change. It is one reason why we wanted these tools to be in a different package, so that we can assemble them like a user could. We do have to cheat here and there and call some internal APIs, however the end goal is that we should only use public APIs. If we can't build the tooling on top of public APIs, it means the users won't be able to either.

    At the moment, the system schedule is automagic. A call to change this has been echoed several times on the forums and I agree it with many of them. It is known, but as far as I know, there are higher priorities to deal with before tackling this.

    About your custom bootstrap, do you tick the world manually?
     
    NotaNaN and JesOb like this.
  14. Scorr

    Scorr

    Joined:
    Jul 2, 2013
    Posts:
    73
    To add on to what Enzi said, we also use a custom world that is ticked manually and it doesn't show up because entitydebugger and the new systems window are getting its systems from PlayerLoop. Is this because it has to display timings?

    I'm not sure if there is an elegant way to display per-system timings for manually ticked worlds. But if there was a setting that branches to getting the systems from selected world directly, that'd at least give us all the other benefits these windows provide without having to change internal/public APIs (if assumptions are true).

    The main issue I'm running into with not being able to use these windows right now is figuring out if systems are ordered correctly.
     
    Last edited: May 28, 2020
    Enzi likes this.
  15. msfredb7

    msfredb7

    Joined:
    Nov 1, 2012
    Posts:
    168
    I have a similar setup and I found an arguably ugly, but functional workaround:
    1) Add your custom world system groups in the PlayerLoop
    2) Use a special flag to make sure the system groups only update when YOU command them to. Something like
    Code (CSharp):
    1. [AlwaysUpdateSystem]
    2. public class CustomWorldInitializationSystemGroup : InitializationSystemGroup
    3. {
    4.     public bool CanUpdate { get; set; }
    5.     protected override void OnUpdate()
    6.     {
    7.         if (!CanUpdate)
    8.             return;
    9.  
    10.         base.OnUpdate();
    11.     }
    12. }
    You should see the timing metrics in the Entity debugger.
     
  16. martinpa_unity

    martinpa_unity

    Unity Technologies

    Joined:
    Oct 18, 2017
    Posts:
    480
    @Scorr It's not so much because we want to show timings, it has more to do with the fact that these systems will be called every frame. Manually ticked systems are.. manually ticked, which means they can be ticked every frame, more than once every frame, once every second, conditionally ticked if it's Monday, etc. In those case, we cannot guarantee that the system will be called every frame and there are no good ways for us to track good metrics on it at the moment (internally, we track the timings using profiler marker).

    We're looking into other ways to give you access to the systems without them being scheduled. However, we won't mix scheduled and unscheduled systems in the same view, as that would bring more confusion.

    Ideal situation for me is we can open up how the schedule is populated to users and these systems would then show up in the window. In the meantime, we'll explore other solutions, such as creating inspectors for some of the constructs that we have (systems, archetypes, world, etc.), so that we can show more specific information (list of sub system for a give system, the shared component values on archetypes, etc.)
     
  17. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    For systems that update few times per frame or only once in couple of frames profiler marker can show good info in profiler.
    But

    In systems window I, personally, want to see cost per update and not cost of current frame but last cost on system.
    So it can be that each system just store time of last update duration, frame in which it is occurs and how much it occurs in that last frame. In window I want to see this info like time, x2 marker for 2x updates in frame and gray color indication that it is was not in current frame. i.e.

    2.156 - run in current frame only once in 2.156ms
    4.15x2 - run in current frame twice each average on 4.15ms
    1.64x5 - dont run in current frame and it was 5 times per frame each average on 1.64ms

    this data can be collected from actual showed timings in systems itself or inside Systems window UI
     
    Orimay likes this.
  18. martinpa_unity

    martinpa_unity

    Unity Technologies

    Joined:
    Oct 18, 2017
    Posts:
    480
    @Jes28 That's fair.

    We're using the same method of calculation that the Entity Debugger currently uses. We do want to expand on that eventually (i.e. choice between average, min/max, median, etc.)
     
  19. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    @raymondyunity @martinpa_unity

    One very very useful feature would be to be able to hide "built in" systems and only show systems of my own. Could be a simple checkbox or maybe by namespace `ns:MyGame.Systems.Simulation.*`
     
    NotaNaN, JoNax97 and JesOb like this.
  20. Orimay

    Orimay

    Joined:
    Nov 16, 2012
    Posts:
    304
    I use a prefix of S_ for all my systems, so it's very easy to filter
     
  21. martinpa_unity

    martinpa_unity

    Unity Technologies

    Joined:
    Oct 18, 2017
    Posts:
    480
    @nicolasgramlich Those are good suggestions, I'll take them back to the team.

    A note for the search, we're working on using the Quick Search package to enable extended search scenarios. This would be done as an optional dependency, meaning that if you have the Quick Search packaged installed (and you should :) ), then we can allow more functionalities; if not installed, we'll revert back to the more simpler we have right now.
     
  22. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,271
    I believe I stated this in the other thread before this new window was released, but I manually add some systems to multiple groups and this gnerates errors:
    The game itself is working fine. This is purely an editor issue.
     
  23. martinpa_unity

    martinpa_unity

    Unity Technologies

    Joined:
    Oct 18, 2017
    Posts:
    480
    @DreamingImLatios Yes, that would be because the time recorder is stored per system instance, which was how the Entity Debugger was storing it.

    I'll bring this back to the team, so we can track multiple insertions of a single system instance.
    Thank you for reporting this.
     
    NotaNaN, JesOb and DreamingImLatios like this.