Search Unity

Feedback EntityDebugger feedback

Discussion in 'Entity Component System' started by any_user, Mar 24, 2020.

  1. any_user

    any_user

    Joined:
    Oct 19, 2008
    Posts:
    374
    I've been using the entities package for a bit now. Coding works reasonably well, but the editor debugging tools unfortunately still really incomplete. Compared to the MonoBehaviour workflow, with ECS I feel "blind" while working, mainly because I can't visualize things easily (gizmos) and I can't tweak values in the entity debugger.

    – How can I draw gizmos for the selected entity? It's possible to draw gizmos with Debug.DrawLine in a system, but how can I get the selected entities?

    – It would be incredibly useful to be able change values of selected entities, like we're used to with the GameObject inspector.

    – Managed references (eg. Mesh objects) are not visible/clickable in the entity inspector.

    – "Used by systems" often doesn't show anything, even though there are systems using the entity.

    – Entity search by id: If I I know the index of an entity, is there a way to find it in the list of possibly thousands of entities?

    – Hierarchical display: If would be great if we could visualize entities in a hierarchy, eg. by using the "parent" component as a way to group entities hierarchically. Ideally, we could plug in our own components to show hierarchies defined by arbitrary components. Grouping by shared components could also work in the same way.

    – Is there a way to hide/split the systems list? Ideally we'd have two separate tabs for systems list and entity list.

    Basically, it would be great to have a similar workflow to edit entities like the one we have to edit GameObjects, with some additional tools specific to working with entities. I understand that the editing representation are still game objects, but as programmers we still need most of these proven tools to efficiently work with the runtime representation. When I started with Unity in 2008, one of the game-changing workflows was the ability to tweak values of a running game, and now with ecs all this intuition seems to be lost.
     
    Last edited: Mar 24, 2020
    chrismarch and fnuecke like this.
  2. any_user

    any_user

    Joined:
    Oct 19, 2008
    Posts:
    374
    Update: Getting the selected entity is actually not that hard:
    Code (CSharp):
    1. using Unity.Entities;
    2. using Unity.Entities.Editor;
    3. using UnityEditor;
    4.  
    5. public static class EntitySelection
    6. {
    7.     public static Entity selectedEntity
    8.     {
    9.         get
    10.         {
    11.             var proxy = Selection.activeObject as EntitySelectionProxy;
    12.             if (proxy)
    13.                 return proxy.Entity;
    14.  
    15.             return Entity.Null;
    16.         }
    17.     }
    18. }
    But now it would be great if Debug.DrawLine wouldn't be broken in HDRP...
     
  3. martinpa_unity

    martinpa_unity

    Unity Technologies

    Joined:
    Oct 18, 2017
    Posts:
    480
    The story around selecting and editing entities is still being discussed and worked on. Your solution above will work for now, but it has many limitation, such as not allowing multiple entities to be selected at the same time (the entity inspector itself does not support multi-targets).

    This is also something we want to allow. We will first work on ensuring that the entity inspector can be extended through custom inspectors and property drawers. After that, we will look into having entities be editable. There are many things to consider when allowing editing entities. For example, if you edit an entity that is the result of the conversion workflows, there is a very good chance that any manual modifications will be overridden the next time the conversion runs. We need to make sure that users are aware of those cases.

    The `UnityEngine.Object` references should now be visible in the entity inspector, we'll make sure that you can click to ping.

    We'll look into that.

    Not at the moment, this is in our backlog, as well as search by name.

    We are working on creating a new window for the runtime entities. The initial goal is to display the entities in a hierarchical fashion, using Parent and Children components. We also want to allow custom grouping down the line. The search by id and by name will be integrated into this window directly.

    In addition to the Entity Window mentioned above, we are also working on a standalone system schedule window. We don't like how the Entity Debugger is one big window that tries to do it all. We want to have multiple windows handling more specific use-cases and then connect them together. The Entity Debugger should be split into at least three different windows: Entity, System Schedule and World Visualization.

    Could not agree more. We'll get to it, but there is a lot of scaffolding to be done.

    Thank you for the feedback.
     
    chrismarch, Sarkahn, jdtec and 2 others like this.
  4. any_user

    any_user

    Joined:
    Oct 19, 2008
    Posts:
    374
    Great to hear you‘re aware of these issues, thanks for answering. In that case, I‘m looking forward to see updates!