Search Unity

Entity Debugger feedback

Discussion in 'Data Oriented Technology Stack' started by Daniel_Brauer, Mar 21, 2018.

  1. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    500
    This is really straying from the topic of this thread. So if you have more questions, I suggest starting a new thread. But to answer your question, you just have to make sure that ComponentSystemGroup's base implementation of SortSystemUpdateList() is not called on your custom group. Then the systems update in the order you add them (it's just your standard C# List). Easiest way to do that is to override your custom group's SortSystemUpdateList() method.
     
    diesoftgames likes this.
  2. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    331
    With 0.0.12-preview.30, converted Cube and Sphere (created from GameObject menu) is incorrectly shown in Entity Debugger. Both of entities are shown RenderMesh with Cube mesh in inspector.

    Reproducible step: (Unity 2019.1.0b10)
    1. Create new scene.
    2. Create Cube object by using context menu then add ConverToEntity component.
    3. Create Sphere object samely.
    4. Play scene and see Entity debugger.
    5. both RenderMesh.mesh of Entity0 and Entitiy1 are Cube.
     
  3. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    1,203
    Can the EntityDebugger drill down below/into the OnUpdate for performance? For example, I have a system that is using ~1.5ms per 1000 entities according to the EntityDebugger. The obvious question is, "Why?". Can / will ED be able to reveal what in OnUpdate is consuming most of the time?

    BTW I think the EntityDebugger is a good start.
     
  4. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    456
  5. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    883
    my notes so far:

    - The custom engines are not showed immediately, I have to switch between worlds to see my engines
    - SystemGroups can be disabled, but the debugged doesn't reflect this. I spent a couple of days debugging something that turned out to be due to the TransformSystemGroup being disabled
     
    Jes28 likes this.
  6. Bas-Smit

    Bas-Smit

    Joined:
    Dec 23, 2012
    Posts:
    113
    The entity debugger is a very useful tool, but I have a bunch of entities with rather large dynamic buffers, about 1400 ints. If I select one such entity in the entity debugger it takes several seconds for the inspector to display the entity and its components, making it very hard to use. Is there anything I can do to prevent the dynamic buffers from being shown in the inspector, or speed this up in another way?

    Also, it would be great if buffers (or components in general) could be collapsed, it is easy to miss components below 1400 buffer values
     
    Last edited: May 3, 2019
    Antypodish likes this.
  7. TRS6123

    TRS6123

    Joined:
    May 16, 2015
    Posts:
    104
    In 0.0.12-preview.31, when you select an entity in the debugger, zero-sized Components aren't indented properly in the inspector (each one is indented inward from the last)
     
    Bas-Smit likes this.
  8. Bas-Smit

    Bas-Smit

    Joined:
    Dec 23, 2012
    Posts:
    113
    fwiw daniel brauer has not been active on the forum since december :( upload_2019-5-13_16-43-33.png
     
  9. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    364
    I found my myself often clicking on a bunch of entities and looking at their translations to figure out which is which.

    Considering the editor knows their transforms, what are the chances of getting a double click to set the editor camera position to look at the entity?
     
  10. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    1,524
    Just change EntityDebugger code which moves camera pos on dbl click on entity if it has LTW matrix :)
     
  11. francois85

    francois85

    Joined:
    Aug 11, 2015
    Posts:
    677
    Not sure If this was already mentioned but a tool tip pop up on the histograms numbers when you hover over them would be awesome. I feel a lot of information could be given that way without cluttering the UI. But in general I love where this is heading.
     
    Daniel_Brauer likes this.
  12. Justin_Larrabee

    Justin_Larrabee

    Joined:
    Apr 24, 2018
    Posts:
    88
    This * 1000. I have recording functionality for a number of entity properties that get stored in DynamicBuffers and I basically freeze the editor if I attempt to inspect the entity.
     
    Xerioz and TZ- like this.
  13. Timboc

    Timboc

    Joined:
    Jun 22, 2015
    Posts:
    31
    Small request - I'm using flag enums a fair bit which (due to the read-only mode of an entity in the inspector) means I'm unable to inspect the value when it has multiple flags. Any improvement or workaround for this would be really handy!
     
  14. Justin_Larrabee

    Justin_Larrabee

    Joined:
    Apr 24, 2018
    Posts:
    88
    Here is my workaround:

    Code (CSharp):
    1.  
    2.     public class EnumFlagDrawer<T> : PropertyDrawer where T : struct
    3.     {
    4.         public override void OnGUI(Rect rect, SerializedProperty property, GUIContent label)
    5.         {
    6.             var content = EditorGUI.BeginProperty(rect, label, property);
    7.  
    8.             T val = (T)Enum.ToObject(typeof(T), property.intValue);
    9.             Enum enumNew = EditorGUI.EnumFlagsField(rect, content, (Enum)Convert.ChangeType(val, typeof(Enum)));
    10.  
    11.             property.intValue = Convert.ToInt32(enumNew);
    12.  
    13.             EditorGUI.EndProperty();
    14.         }
    15.     }
    16.  
    17.     // SteeringBehaviorFlag is a flag enum
    18.     [CustomPropertyDrawer(typeof(SteeringBehaviorFlag))]
    19.     public class SteeringBehaviorFlagDrawer : EnumFlagDrawer<SteeringBehaviorFlag>
    20.     {
    21.     }
    Anytime I add a flag enum I have to manually create a drawer subclass. It's tedious, but it gets the job done.

    Edit: Ah I noticed this is an issue for you in read-only viewing. This solution will still only show 'mixed'. If you have Odin Inspector you could replace EditorGUI.EnumFlagsField with their version that shows a much more rich display.
     
    Timboc likes this.
  15. francois85

    francois85

    Joined:
    Aug 11, 2015
    Posts:
    677
    Do we know if the Debugger is being worked on. I haven’t heard an update in forever.
     
  16. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,356
    An improvement for viewing dynamic buffers will be in an upcoming release. They are now paginated, so they don't take up too much space regardless of the number of elements they contain.
     
    dadude123, Josh4364, Seb-1814 and 4 others like this.
  17. Abbrew

    Abbrew

    Joined:
    Jan 1, 2018
    Posts:
    166
    Nested structs are not being shown in the debugger.
    Here are the structs
    Code (CSharp):
    1. [RequiresEntityConversion]
    2. public class BanzaiBlackboardComponent : MonoBehaviour, IConvertGameObjectToEntity//, IDeclareReferencedPrefabs
    3. {
    4.     [SerializeField]
    5.     private BanzaiBlackboard data;
    6.  
    7.     public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    8.     {
    9.         dstManager.AddComponentData(entity, data);
    10.     }
    11. }
    12. [Serializable]
    13. public struct BanzaiBlackboard : IComponentData, IAttackingBlackboardProvider
    14. {
    15.     [SerializeField]
    16.     public AttackingBlackboardData data;
    17.  
    18.     public AttackingBlackboardData GetBlackboard()
    19.     {
    20.         return data;
    21.     }
    22.  
    23.     public void SetBlackboard(AttackingBlackboardData newBlackboard)
    24.     {
    25.         this.data = newBlackboard;
    26.     }
    27. }
    28.  
    Code (CSharp):
    1.  
    2. [Serializable]
    3. public struct AttackingBlackboardData
    4. {
    5.     private int users;
    6.     private int timestamp;
    7.     [SerializeField]
    8.     private int maxUsers;
    9.     [SerializeField]
    10.     [Range(0, 1)]
    11.     private float userWeight;
    12.  
    13.     public bool FresherThen(AttackingBlackboardData other)
    14.     {
    15.         return this.timestamp > other.timestamp;
    16.     }
    17.     public void ReplaceWith(AttackingBlackboardData other)
    18.     {
    19.         this.users = math.min(other.users, maxUsers);
    20.         this.timestamp = other.timestamp;
    21.     }
    22.  
    23.     public float CalcUserRatio()
    24.     {
    25.         return (((float)users) / ((float)maxUsers)) * userWeight;
    26.     }
    27.  
    28.     public bool CanUse()
    29.     {
    30.         return users <= maxUsers;
    31.     }
    32.  
    33.     public void Use()
    34.     {
    35.         users++;
    36.     }
    37.  
    38.     public void NoLongerUsing()
    39.     {
    40.         users--;
    41.     }
    42. }
    However, this is showing up in the debugger
    https://imgur.com/a/NEwkP7K

     
  18. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,801
    I don't know why / what happened, but with Unity 2019.2, I can not longer collapse buffer arrays, or anything else.
    It may be general Unity bug, rather than DOTS related, but thought I post it here first.

    upload_2019-8-2_7-14-11.png

    See in contrast screenshot from the first post.

    upload_2019-8-2_7-13-18.png
     
  19. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    1,722
    This is correct. However latest version of unity package has pages (of 5) for dynamic buffers.
     
  20. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,801
    How to access this pages?
    I am on Entities preview 33.
     
  21. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    1,722
    that's the previous version.

    0.1.0-preview is latest version, it's available just through package manager. if it doesn't show up might have to clear your library.
     
    Antypodish likes this.
  22. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,801
    Ah got it. Installed. Thx

    upload_2019-8-2_7-37-23.png

    Yeah that works much smoother.

    But still however my question is, why collapsing options are gone?
     

    Attached Files:

  23. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,407
    With Unity.Physics 0.2.0 the debugger is throwing exceptions when it hits physics related components. Is there any way to just disable showing certain types when stuff like this breaks?

    Code (csharp):
    1.  
    2. InvalidCastException: Specified cast is not valid.
    3.   at Unity.Properties.Reflection.ReflectedMemberProperty`2[TContainer,TValue].GetValue (TContainer& container) [0x00001] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\Reflection\Properties\ReflectedMemberProperty.cs:24
    4.   at Unity.Properties.PropertyVisitor.VisitProperty[TProperty,TContainer,TValue] (TProperty property, TContainer& container, Unity.Properties.ChangeTracker& changeTracker) [0x00016] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\PropertyVisitor.cs:54
    5.   at Unity.Properties.Reflection.ReflectedPropertyBag`1+PropertyProxy`2[TContainer,TProperty,TValue].Accept[TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) [0x00000] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\Reflection\ReflectedPropertyBag.cs:19
    6.   at Unity.Properties.Reflection.ReflectedPropertyBag`1[TContainer].Accept[TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) [0x00006] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\Reflection\ReflectedPropertyBag.cs:58
    7.   at Unity.Properties.PropertyContainer.Visit[TContainer,TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) [0x00075] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\PropertyContainerVisit.cs:29
    8.   at Unity.Properties.PropertyVisitor.TryVisitContainerWithAdapters[TProperty,TContainer,TValue] (TProperty property, TContainer& container, TValue& value, Unity.Properties.ChangeTracker& changeTracker) [0x0006b] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\PropertyVisitor.cs:127
    9.   at Unity.Properties.PropertyVisitor.VisitProperty[TProperty,TContainer,TValue] (TProperty property, TContainer& container, Unity.Properties.ChangeTracker& changeTracker) [0x00032] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\PropertyVisitor.cs:57
    10.   at Unity.Properties.Reflection.ReflectedPropertyBag`1+PropertyProxy`2[TContainer,TProperty,TValue].Accept[TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) [0x00000] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\Reflection\ReflectedPropertyBag.cs:19
    11.   at Unity.Properties.Reflection.ReflectedPropertyBag`1[TContainer].Accept[TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) [0x00006] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\Reflection\ReflectedPropertyBag.cs:58
    12.   at Unity.Properties.PropertyContainer.Visit[TContainer,TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) [0x00075] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\PropertyContainerVisit.cs:29
    13.   at Unity.Properties.PropertyVisitor.TryVisitContainerWithAdapters[TProperty,TContainer,TValue] (TProperty property, TContainer& container, TValue& value, Unity.Properties.ChangeTracker& changeTracker) [0x0006b] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\PropertyVisitor.cs:127
    14.   at Unity.Properties.PropertyVisitor.VisitProperty[TProperty,TContainer,TValue] (TProperty property, TContainer& container, Unity.Properties.ChangeTracker& changeTracker) [0x00032] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\PropertyVisitor.cs:57
    15.   at Unity.Properties.Reflection.ReflectedPropertyBag`1+PropertyProxy`2[TContainer,TProperty,TValue].Accept[TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) [0x00000] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\Reflection\ReflectedPropertyBag.cs:19
    16.   at Unity.Properties.Reflection.ReflectedPropertyBag`1[TContainer].Accept[TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) [0x00006] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\Reflection\ReflectedPropertyBag.cs:58
    17.   at Unity.Properties.PropertyContainer.Visit[TContainer,TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) [0x00075] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\PropertyContainerVisit.cs:29
    18.   at Unity.Properties.PropertyVisitor.TryVisitContainerWithAdapters[TProperty,TContainer,TValue] (TProperty property, TContainer& container, TValue& value, Unity.Properties.ChangeTracker& changeTracker) [0x0006b] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\PropertyVisitor.cs:127
    19.   at Unity.Properties.PropertyVisitor.VisitProperty[TProperty,TContainer,TValue] (TProperty property, TContainer& container, Unity.Properties.ChangeTracker& changeTracker) [0x00032] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\PropertyVisitor.cs:57
    20.   at Unity.Properties.VisitCollectionElementCallback`1[TContainer].VisitProperty[TElementProperty,TElement] (TElementProperty property, TContainer& container, Unity.Properties.ChangeTracker& changeTracker) [0x00001] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\PropertyVisitor.cs:17
    21.   at Unity.Entities.EntityContainerPropertyBag+ComponentsProperty+GetComponentDataCallback`1[TCallback].Invoke[TComponent] () [0x00001] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.entities@0.1.1-preview\Unity.Entities.Properties\EntityContainer.cs:65
    22.   at Unity.Properties.PropertyBag`1[TContainer].Cast[TCallback] (TCallback& callback) [0x00001] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\IPropertyBag.cs:38
    23.   at Unity.Entities.EntityContainerPropertyBag+ComponentsProperty.GetPropertyAtIndex[TGetter] (Unity.Entities.EntityContainer& container, System.Int32 index, Unity.Properties.ChangeTracker& changeTracker, TGetter getter) [0x0006e] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.entities@0.1.1-preview\Unity.Entities.Properties\EntityContainer.cs:227
    24.   at Unity.Properties.PropertyVisitor.TryVisitCollectionWithAdapters[TProperty,TContainer,TValue] (TProperty property, TContainer& container, TValue& value, Unity.Properties.ChangeTracker& changeTracker) [0x000a8] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\PropertyVisitor.cs:159
    25.   at Unity.Properties.PropertyVisitor.VisitCollectionProperty[TProperty,TContainer,TValue] (TProperty property, TContainer& container, Unity.Properties.ChangeTracker& changeTracker) [0x00021] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\PropertyVisitor.cs:87
    26.   at Unity.Entities.EntityContainerPropertyBag.Accept[TVisitor] (Unity.Entities.EntityContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) [0x00017] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.entities@0.1.1-preview\Unity.Entities.Properties\EntityContainer.cs:265
    27.   at Unity.Properties.PropertyContainer.Visit[TContainer,TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) [0x00075] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\PropertyContainerVisit.cs:29
    28.   at Unity.Properties.PropertyContainer.Visit[TContainer,TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.IVersionStorage versionStorage) [0x00009] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.properties@0.6.2-preview\Runtime\Unity.Properties\PropertyContainerVisit.cs:15
    29.   at Unity.Entities.Editor.EntitySelectionProxyEditor.OnInspectorGUI () [0x00023] in C:\Games\aigame\AiClient\Library\PackageCache\com.unity.entities@0.1.1-preview\Unity.Entities.Editor\EntityInspector\EntitySelectionProxyEditor.cs:44
    30.   at UnityEditor.UIElements.InspectorElement+<CreateIMGUIInspectorFromEditor>c__AnonStorey1.<>m__0 () [0x00251] in C:\buildslave\unity\build\Editor\Mono\Inspector\InspectorElement.cs:462
    31. UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    32. UnityEngine.DebugLogHandler:LogException(Exception, Object)
    33. UnityEngine.Logger:LogException(Exception, Object)
    34. UnityEngine.Debug:LogException(Exception)
    35. UnityEditor.UIElements.<CreateIMGUIInspectorFromEditor>c__AnonStorey1:<>m__0() (at C:\buildslave\unity\build\Editor\Mono\Inspector\InspectorElement.cs:472)
    36. UnityEngine.UIElements.IMGUIContainer:DoOnGUI(Event, Matrix4x4, Rect, Boolean, Rect) (at C:\buildslave\unity\build\Modules\UIElements\IMGUIContainer.cs:278)
    37. UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent(Event, Matrix4x4, Rect) (at C:\buildslave\unity\build\Modules\UIElements\IMGUIContainer.cs:481)
    38. UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent() (at C:\buildslave\unity\build\Modules\UIElements\IMGUIContainer.cs:455)
    39. UnityEngine.UIElements.UIR.ImmediateRenderer:Draw(DrawChainState) (at C:\buildslave\unity\build\Modules\UIElements\Renderer\UIRenderer\UIRenderers.cs:447)
    40. UnityEngine.UIElements.UIR.UIRenderDevice:ContinueChain(RendererBase, DrawChainState, Boolean) (at C:\buildslave\unity\build\Modules\UIElements\Renderer\UIRenderer\UIRenderDevice.cs:865)
    41. UnityEngine.UIElements.UIR.ZoomPanRenderer:Draw(DrawChainState) (at C:\buildslave\unity\build\Modules\UIElements\Renderer\UIRenderer\UIRenderers.cs:419)
    42. UnityEngine.UIElements.UIR.UIRenderDevice:ContinueChain(RendererBase, DrawChainState, Boolean) (at C:\buildslave\unity\build\Modules\UIElements\Renderer\UIRenderer\UIRenderDevice.cs:865)
    43. UnityEngine.UIElements.UIR.UIRenderDevice:DrawChain(RendererBase, Rect, Matrix4x4, Texture) (at C:\buildslave\unity\build\Modules\UIElements\Renderer\UIRenderer\UIRenderDevice.cs:848)
    44. UnityEngine.UIElements.UIRRepaintUpdater:DrawChain(Rect, Matrix4x4) (at C:\buildslave\unity\build\Modules\UIElements\Renderer\UIRRepaintUpdater.cs:218)
    45. UnityEngine.UIElements.UIRRepaintUpdater:Update() (at C:\buildslave\unity\build\Modules\UIElements\Renderer\UIRRepaintUpdater.cs:190)
    46. UnityEngine.UIElements.VisualTreeUpdater:UpdateVisualTree() (at C:\buildslave\unity\build\Modules\UIElements\VisualTreeUpdater.cs:70)
    47. UnityEngine.UIElements.Panel:Repaint(Event) (at C:\buildslave\unity\build\Modules\UIElements\Panel.cs:589)
    48. UnityEngine.UIElements.UIElementsUtility:DoDispatch(BaseVisualElementPanel) (at C:\buildslave\unity\build\Modules\UIElements\UIElementsUtility.cs:240)
    49. UnityEngine.UIElements.UIElementsUtility:ProcessEvent(Int32, IntPtr) (at C:\buildslave\unity\build\Modules\UIElements\UIElementsUtility.cs:78)
    50. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:\buildslave\unity\build\Modules\IMGUI\GUIUtility.cs:179)
    51.  
     
    RBogdy likes this.
  24. RBogdy

    RBogdy

    Joined:
    Mar 6, 2019
    Posts:
    38
    I am getting the same errors in Console when trying to view Entity Data in Entity Debugger for entities that contain physics components. I am on Unity 2019.2.0f1 with all DOTS packages to the latest versions
    Code (CSharp):
    1. InvalidCastException: Specified cast is not valid.
    2. Unity.Properties.Reflection.ReflectedMemberProperty`2[TContainer,TValue].GetValue (TContainer& container) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/Reflection/Properties/ReflectedMemberProperty.cs:24)
    3. Unity.Properties.PropertyVisitor.VisitProperty[TProperty,TContainer,TValue] (TProperty property, TContainer& container, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/PropertyVisitor.cs:54)
    4. Unity.Properties.Reflection.ReflectedPropertyBag`1+PropertyProxy`2[TContainer,TProperty,TValue].Accept[TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/Reflection/ReflectedPropertyBag.cs:19)
    5. Unity.Properties.Reflection.ReflectedPropertyBag`1[TContainer].Accept[TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/Reflection/ReflectedPropertyBag.cs:58)
    6. Unity.Properties.PropertyContainer.Visit[TContainer,TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/PropertyContainerVisit.cs:29)
    7. Unity.Properties.PropertyVisitor.TryVisitContainerWithAdapters[TProperty,TContainer,TValue] (TProperty property, TContainer& container, TValue& value, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/PropertyVisitor.cs:127)
    8. Unity.Properties.PropertyVisitor.VisitProperty[TProperty,TContainer,TValue] (TProperty property, TContainer& container, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/PropertyVisitor.cs:57)
    9. Unity.Properties.Reflection.ReflectedPropertyBag`1+PropertyProxy`2[TContainer,TProperty,TValue].Accept[TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/Reflection/ReflectedPropertyBag.cs:19)
    10. Unity.Properties.Reflection.ReflectedPropertyBag`1[TContainer].Accept[TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/Reflection/ReflectedPropertyBag.cs:58)
    11. Unity.Properties.PropertyContainer.Visit[TContainer,TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/PropertyContainerVisit.cs:29)
    12. Unity.Properties.PropertyVisitor.TryVisitContainerWithAdapters[TProperty,TContainer,TValue] (TProperty property, TContainer& container, TValue& value, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/PropertyVisitor.cs:127)
    13. Unity.Properties.PropertyVisitor.VisitProperty[TProperty,TContainer,TValue] (TProperty property, TContainer& container, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/PropertyVisitor.cs:57)
    14. Unity.Properties.Reflection.ReflectedPropertyBag`1+PropertyProxy`2[TContainer,TProperty,TValue].Accept[TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/Reflection/ReflectedPropertyBag.cs:19)
    15. Unity.Properties.Reflection.ReflectedPropertyBag`1[TContainer].Accept[TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/Reflection/ReflectedPropertyBag.cs:58)
    16. Unity.Properties.PropertyContainer.Visit[TContainer,TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/PropertyContainerVisit.cs:29)
    17. Unity.Properties.PropertyVisitor.TryVisitContainerWithAdapters[TProperty,TContainer,TValue] (TProperty property, TContainer& container, TValue& value, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/PropertyVisitor.cs:127)
    18. Unity.Properties.PropertyVisitor.VisitProperty[TProperty,TContainer,TValue] (TProperty property, TContainer& container, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/PropertyVisitor.cs:57)
    19. Unity.Properties.VisitCollectionElementCallback`1[TContainer].VisitProperty[TElementProperty,TElement] (TElementProperty property, TContainer& container, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/PropertyVisitor.cs:17)
    20. Unity.Entities.EntityContainerPropertyBag+ComponentsProperty+GetComponentDataCallback`1[TCallback].Invoke[TComponent] () (at Library/PackageCache/com.unity.entities@0.1.1-preview/Unity.Entities.Properties/EntityContainer.cs:65)
    21. Unity.Properties.PropertyBag`1[TContainer].Cast[TCallback] (TCallback& callback) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/IPropertyBag.cs:38)
    22. Unity.Entities.EntityContainerPropertyBag+ComponentsProperty.GetPropertyAtIndex[TGetter] (Unity.Entities.EntityContainer& container, System.Int32 index, Unity.Properties.ChangeTracker& changeTracker, TGetter getter) (at Library/PackageCache/com.unity.entities@0.1.1-preview/Unity.Entities.Properties/EntityContainer.cs:227)
    23. Unity.Properties.PropertyVisitor.TryVisitCollectionWithAdapters[TProperty,TContainer,TValue] (TProperty property, TContainer& container, TValue& value, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/PropertyVisitor.cs:159)
    24. Unity.Properties.PropertyVisitor.VisitCollectionProperty[TProperty,TContainer,TValue] (TProperty property, TContainer& container, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/PropertyVisitor.cs:87)
    25. Unity.Entities.EntityContainerPropertyBag.Accept[TVisitor] (Unity.Entities.EntityContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.entities@0.1.1-preview/Unity.Entities.Properties/EntityContainer.cs:265)
    26. Unity.Properties.PropertyContainer.Visit[TContainer,TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.ChangeTracker& changeTracker) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/PropertyContainerVisit.cs:29)
    27. Unity.Properties.PropertyContainer.Visit[TContainer,TVisitor] (TContainer& container, TVisitor visitor, Unity.Properties.IVersionStorage versionStorage) (at Library/PackageCache/com.unity.properties@0.6.2-preview/Runtime/Unity.Properties/PropertyContainerVisit.cs:15)
    28. Unity.Entities.Editor.EntitySelectionProxyEditor.OnInspectorGUI () (at Library/PackageCache/com.unity.entities@0.1.1-preview/Unity.Entities.Editor/EntityInspector/EntitySelectionProxyEditor.cs:44)
    29. UnityEditor.UIElements.InspectorElement+<CreateIMGUIInspectorFromEditor>c__AnonStorey1.<>m__0 () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorElement.cs:496)
    30. UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  25. Roobubba

    Roobubba

    Joined:
    Nov 5, 2015
    Posts:
    9
    Same InvalidCastException for entities with PhysicsColliders attached here. It makes it impossible to debug the authoring - can't tell when I create an entity whether it has the components I'm intending to set on it, and getting physics to work in any meaningful way is honestly hard enough as it is right now. The player controller example in the physics sample project is a thing of absolute nightmares!
     
  26. Zadirion

    Zadirion

    Joined:
    Mar 16, 2015
    Posts:
    48
    same issue as Roobubba, any official answers to our plight?
     
  27. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,356
    The InvalidCastException should be fixed in the next version of Properties (which the next version of Entities will depend on).
     
    Zadirion likes this.
  28. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    1,722
    If anyone needs this right away, the next version of Properties is actually already out on package manager and you can update manually to fix it.

    "com.unity.properties": "0.6.4-preview",
     
    Ryetoast, psuong, haskins and 7 others like this.
  29. diesoftgames

    diesoftgames

    Joined:
    Nov 27, 2018
    Posts:
    40
    Just chiming in with a feature request: I tend to use "SystemState" as the name for my ISystemStateComponentData and just nest it in my system privately, but if I am lazy and forget to properly clean up, I'm left with entities with one or more "SystemState" on them, which makes figuring out which system it is that I need to fix. I tried using the "used by systems" info to deduce it, but I feel like I'm seeing a lot of red herrings in there. Perhaps for SystemState components specifically it could include the namespace?
     
  30. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,801
    I have noticed, that PageUp/PageDown keys doesn't react in All Entities panel viewer, when try scroll quickly with keyboard
    upload_2019-8-20_18-2-13.png
     
  31. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,801
    Following may be have been already answered somewhere before, but I could not find answer.

    Does using [DisableAutoCreation] in System, excludes the system from EntityDebuger?
    All system that I have included DisableAutoCreation attribute, does not appear there.
    What I am missing? How to make such systems showing in debugger?
     
  32. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    1,722
    As long as after you create the system yourself you add it to one of the 3 default loops then it'll appear fine. Most of my systems are manually created and I have no issue.

    The 3 default loops being simulation, presentation and initialization.

    If you don't add it to a default update loop and create your own then and update it manually it will not appear in the entity debugger.
     
    Antypodish likes this.
  33. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,801
    Thx.
    That worked out of the box.
    Providing I did it right.

    Code (CSharp):
    1. mySystem = World.Active.GetOrCreateSystem <MySystem> () ;
    2. SimulationSystemGroup systemGroup = World.Active.GetOrCreateSystem <SimulationSystemGroup>() ;
    3. systemGroup.AddSystemToUpdateList ( mySystem ) ;
    Funny part, for searching of unknown ....
    On side note, since I wasn't sure of full method name, I did quick search on internet (forum search is not best for that).
    Typed following keywords
    That lead me immediately to
    https://gametorrahod.com/world-system-groups-update-order-and-the-player-loop/
    Thx @5argon.
    Quick keyword "Add" search in the blog, lead me to
    Code (CSharp):
    1. AddSystemToUpdateList
    Now I was able to search library.
    But also decided search forum.
    And quickly had an answer :)
     
    5argon likes this.
  34. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    1,722
    If you're doing this in ICustomBootstrap you can just use World.AddSystem and it'll be automatically added to loop and correctly ordered.
     
    Antypodish likes this.
  35. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,801
    Right, I will look into that.
    Would it be more preferable option, than setting Start() and controlling in FixedUpdate(), of MonoBehaviour for example?

    What is the advantage of using ICustomBootstrap in this case? Or if there is any?
     
  36. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    1,722
    If you're manually calling Update on your system FixedUpdate you can't just add your system to the loop because now it'll be updated twice, just like it was just discussed earlier today in this thread: https://forum.unity.com/threads/handling-collisions.734033/#post-4904900

    So if you're manually updating i don't think you can get it to show in Entity Debugger.
     
  37. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,801
    Ignore following replay, seems actually not working as expected. I need double check :p
    I can show system now (see few images down).
    However, regarding 2x calls, to what you mentioned, all behaves as desired so far in my case.
    Yet I did small following quick test.

    So I got following MonoBehaviour
    Code (CSharp):
    1. private void Start ()
    2.         {
    3.             // sliderLabelText = fixedTimestepSlider.GetComponentInChildren<Text>();
    4.              Time.fixedDeltaTime = 1.1f ;
    5.  
    6.         }
    7.  
    8.         private void FixedUpdate ()
    9.         {
    10.             Debug.Log ( "AA" ) ;
    11.             if ( timetepSystem == null )
    12.             {
    13.        
    14.                 timetepSystem = World.Active.GetOrCreateSystem <TimeStepSystem> () ;
    15.                 SimulationSystemGroup systemGroup = World.Active.GetOrCreateSystem <SimulationSystemGroup>() ;
    16.                 systemGroup.AddSystemToUpdateList ( timetepSystem ) ;
    17.  
    18.                 World.Active.AddSystem ( timetepSystem ) ;
    19.             }
    20.  
    21.             timetepSystem.Update () ;
    22. }
    23. }
    and I got following system
    Code (CSharp):
    1. [DisableAutoCreation]
    2.     public class TimeStepSystem : JobComponentSystem
    3.     {
    4.         struct TestTag : IComponentData {}
    5.  
    6.         EntityQuery group_test ;
    7.         protected override void OnCreate ( )
    8.         {  
    9.             Debug.Log ( "Start Test" ) ;
    10.             EntityManager em = World.Active.EntityManager ;
    11.             Entity zonk = em.CreateEntity () ;
    12.             em.SetName ( zonk, "zonk" ) ;
    13.             em.AddComponent <TestTag> ( zonk ) ;
    14.  
    15.             group_test = GetEntityQuery
    16.             (
    17.                 typeof ( TestTag )
    18.             ) ;
    19.         }
    20.  
    21.  
    22.  
    23.         static int i_currentUpdateStep ;
    24.  
    25.         protected override JobHandle OnUpdate ( JobHandle inputDeps )
    26.         {
    27.             Debug.Log ( "test: " + Time.time  + ": " + i_currentUpdateStep ) ;
    28.                
    29.             i_currentUpdateStep ++ ;
    30.  
    31.             if ( i_currentUpdateStep >= 10 )
    32.             {
    33.                 i_currentUpdateStep = 0 ;
    34.             }
    35.  
    36.             return inputDeps ;
    37.             // throw new System.NotImplementedException ( );
    38.         }
    39. }
    In EntityDebuger I see stuff, so it work.
    upload_2019-8-29_5-19-32.png

    But indeed, I have noticed double calls in console. See also double "zonk" entities, rather one, which is called from OnCreate () in a system.
    upload_2019-8-29_5-20-0.png

    And
    upload_2019-8-29_5-30-42.png

    "AA" console log is called from MonoBehaviour, which executes when i_currentUpdateStep == 1, setting system bool, and uses OnUpdate return inputDep for early exit. That is rather using MySystem.Update () ;

    Code (CSharp):
    1. static public bool _UpdateAtStep ( ref bool isUpdated, int i_step )
    2.         {
    3.    
    4.             if ( i_currentUpdateStep == i_step )
    5.             {
    6.                 if ( !isUpdated )
    7.                 {
    8.                     isUpdated = true ;
    9.                     return false ;
    10.                 }
    11.  
    12.                 return true ;
    13.             }
    14.  
    15.             isUpdated = false ;
    16.  
    17.             return true ;
    18.         }
    I just add that method to relevant OnUpdate in system, I want to call with intervals.

    Code (CSharp):
    1. return _UpdateAtStep ( ref isUpdated, 1 ) ; // Step 1 of 10.
    I probably will change it to ICustomBootstrap, but so far it works ;)
     
    Last edited: Aug 29, 2019
  38. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    1,722
    I'm confused. Your system is definitely running more often than you want. It's running every Update and every FixedUpdate. This can't be intended behaviour.
     
  39. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,801
    That what I have noticed .. RubberDucking, as I mentioned, you should have had ignore my post :p
    I felt it worked once upon time, but nvm. I will go for ICustomBootstrap

    One thing is for sure that Debugger shows, even tho, they are duplicate entities.

     
  40. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,801
    My apology for making this a little oftopic now, but I want to clarify.
    Ok I know what was wrong. So I had it working initially.

    All mess start happening, after I added Group.
    Code (CSharp):
    1. SimulationSystemGroup systemGroup = World.Active.GetOrCreateSystem <SimulationSystemGroup>() ;
    2. systemGroup.AddSystemToUpdateList ( timetepSystem ) ;
    3. World.Active.AddSystem ( timetepSystem ) ;
    after
    Code (CSharp):
    1. timetepSystem = World.Active.GetOrCreateSystem <TimeStepSystem> () ;
    Once I comment out, that 3 lines, I got all working back.
    upload_2019-8-29_6-47-58.png

    Edit:
    In my case, I don't need really TimeStepSystem in EntiyDebugger, since I control other systems execution frequency from there and I have no entities in TimeStepSystem system.
    Other systems are displaying in EntityDebugger as normally.
     
    Last edited: Aug 29, 2019
  41. esc_marcin

    esc_marcin

    Joined:
    Sep 30, 2016
    Posts:
    19
    Inspector lock doesn't work. I frequently use 2 inspector tabs, lock one and compare GameObjects side-by-side. This doesn't work with the entity debugger, it ignores the lock.
     
  42. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,801
    Is searching Entity by ID a thing yet? I may be missing it? I know this was proposed by other user before.
    I have 10s of thousands of entities, where certain bug happens only, with large amount of them.
    I can get entity ID from job (console pause on error). Yet I would like now to inspect in the Entity Debugger, if the entity is actually what it suppose to be.
     
    Zadirion likes this.
  43. Kender

    Kender

    Joined:
    Nov 16, 2012
    Posts:
    163
    One thing that really confuses me is that Entity Debugger shows the wrong time spent by a system. If a system takes much time, it's, either, way smaller than it actually spent, or even NEGATIVE o_O
    How come?
    Also, if one system's waiting for another, the time accounts for the waiting system rather than the system that takes too long. It's is very confusing
     
    Jes28 likes this.
  44. Hans-D

    Hans-D

    Joined:
    Sep 24, 2013
    Posts:
    40
    Is there any way to register manually created and updated systems to the Entity Debugger so they show up on the system list? If someone could point me to the list of systems that the Entity Debugger looks at to populate its UI perhaps I could hack something in.
     
  45. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    395
    you can create group add it to some part of player loop disable it and update systems inside in any way you want :)
     
  46. wobes

    wobes

    Joined:
    Mar 9, 2013
    Posts:
    680
    Hacker :)
     
  47. Hans-D

    Hans-D

    Joined:
    Sep 24, 2013
    Posts:
    40
    Nice! Thank you!
     
  48. esc_marcin

    esc_marcin

    Joined:
    Sep 30, 2016
    Posts:
    19
    It'd be very useful for Entity Index to show up in the entities list always. When I Set a custom name I now have to click on the entity to see its index which makes finding an entity that is referenced in code (by an index) very difficult. Making ctrl+g as a goto entity by index would be helpful too.

    Being able to get at all components for an entity in the visual studio debugger watch window would greatly help. Since you can't use the inspector or entities debugger when you're stopped at a breakpoint it is very difficult to debugger many issues right now.
     
    Kender and Jes28 like this.
  49. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,801
    I like have entity index displayed too.
    For that reason, when creating custom named entity, I simply add entity index to the name. The only issue is, when using Comman Buffer for entity instancing, as we can not rename entities via ECB. So either renaming them, after they been created. Or, separate debugger column with entities indexes/version would be cool to see.
     
  50. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,356
    This will be in the next release.
     
    esc_marcin, Jes28 and Antypodish like this.