Search Unity

Resolved (Case 1287632) Havok Visual Debugger fails to connect

Discussion in 'DOTS Physics' started by MNNoxMortem, Oct 25, 2020.

  1. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    685
    Code (CSharp):
    1. Havok.Physics 0.4.0-preview that is compatible with this release of Unity Physics is also out now!
    Is the Havok Visual Debugger expected to work in the current version? It never succeeds to connect for me.


    Code (CSharp):
    1. {
    2.   "dependencies": {
    3.     "com.cysharp.unitask": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask/#2.0.30",
    4.     "com.havok.physics": "0.4.0-preview.1",
    5.     "com.neuecc.messagepack": "https://github.com/neuecc/MessagePack-CSharp.git?path=src/MessagePack.UnityClient/Assets/Scripts/MessagePack#4db29d3bec0ab44f88c3c2c720ec83d0381bb96b",
    6.     "com.neuecc.unirx": "https://github.com/neuecc/UniRx.git?path=Assets/Plugins/UniRx/Scripts/#master",
    7.     "com.unity.2d.sprite": "1.0.0",
    8.     "com.unity.2d.tilemap": "1.0.0",
    9.     "com.unity.build-report-inspector": "0.2.2-preview",
    10.     "com.unity.burst": "1.3.9",
    11.     "com.unity.collections": "0.12.0-preview.13",
    12.     "com.unity.dots.editor": "0.10.0-preview",
    13.     "com.unity.editorcoroutines": "1.0.0",
    14.     "com.unity.entities": "0.11.0-preview.7",
    15.     "com.unity.ide.rider": "1.2.1",
    16.     "com.unity.ide.visualstudio": "2.0.3",
    17.     "com.unity.ide.vscode": "1.2.2",
    18.     "com.unity.inputsystem": "1.0.0",
    19.     "com.unity.jobs": "0.2.10-preview.11",
    20.     "com.unity.mathematics": "1.2.1",
    21.     "com.unity.memoryprofiler": "0.2.6-preview.1",
    22.     "com.unity.performance.profile-analyzer": "1.0.3",
    23.     "com.unity.physics": "0.3.2-preview",
    24.     "com.unity.platforms": "0.5.0-preview.6",
    25.     "com.unity.quicksearch": "1.5.4",
    26.     "com.unity.render-pipelines.universal": "9.0.0-preview.55",
    27.     "com.unity.rendering.hybrid": "0.8.0-preview.19",
    28.     "com.unity.scriptablebuildpipeline": "1.7.3",
    29.     "com.unity.searcher": "4.3.1",
    30.     "com.unity.test-framework": "1.1.18",
    31.     "com.unity.test-framework.performance": "2.3.1-preview",
    32.     "com.unity.testtools.codecoverage": "0.3.1-preview",
    33.     "com.unity.textmeshpro": "3.0.1",
    34.     "com.unity.ugui": "1.0.0",
    35.     "nuget.mono-cecil": "0.1.6-preview",
    36.     "com.unity.modules.ai": "1.0.0",
    37.     "com.unity.modules.androidjni": "1.0.0",
    38.     "com.unity.modules.animation": "1.0.0",
    39.     "com.unity.modules.assetbundle": "1.0.0",
    40.     "com.unity.modules.audio": "1.0.0",
    41.     "com.unity.modules.cloth": "1.0.0",
    42.     "com.unity.modules.director": "1.0.0",
    43.     "com.unity.modules.imageconversion": "1.0.0",
    44.     "com.unity.modules.imgui": "1.0.0",
    45.     "com.unity.modules.jsonserialize": "1.0.0",
    46.     "com.unity.modules.particlesystem": "1.0.0",
    47.     "com.unity.modules.physics": "1.0.0",
    48.     "com.unity.modules.physics2d": "1.0.0",
    49.     "com.unity.modules.screencapture": "1.0.0",
    50.     "com.unity.modules.terrain": "1.0.0",
    51.     "com.unity.modules.terrainphysics": "1.0.0",
    52.     "com.unity.modules.tilemap": "1.0.0",
    53.     "com.unity.modules.ui": "1.0.0",
    54.     "com.unity.modules.uielements": "1.0.0",
    55.     "com.unity.modules.umbra": "1.0.0",
    56.     "com.unity.modules.unityanalytics": "1.0.0",
    57.     "com.unity.modules.unitywebrequest": "1.0.0",
    58.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    59.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    60.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    61.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    62.     "com.unity.modules.vehicles": "1.0.0",
    63.     "com.unity.modules.video": "1.0.0",
    64.     "com.unity.modules.vr": "1.0.0",
    65.     "com.unity.modules.wind": "1.0.0",
    66.     "com.unity.modules.xr": "1.0.0"
    67.   },
    68.   "testables": [
    69.     "com.unity.test-framework.performance"
    70.   ]
    71. }
    72.  
     
  2. petarmHavok

    petarmHavok

    Joined:
    Nov 20, 2018
    Posts:
    461
    Did you add the HavokConfiguration to your scene and enable the visual debugger in it?
     
  3. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    685
    I would say so? Maybe I have missed something:
    upload_2020-10-26_14-22-39.png
     
  4. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    685
    Unity 2020.1.10f1 it works. No change to the project. So much stuff not working here, then mysteriously working with the next version... What the hell have I driven myself into doing something with dots at this point...
    upload_2020-10-26_15-13-54.png
     
  5. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    685
    The project I have attached for the bug report linked in this comment also does succeed to connect for some reason. I really wonder what causes it to work/fail: https://forum.unity.com/threads/cas...ity-physics-meshcollider.994216/#post-6459259

    Reproduce:
    * Open project and SampleScene (only scene)
    * Start
    * Open Havok Visual Debugger

    Settings are on the "Havok" GameObject.

    There should be at least one BoxCollider from the conversion and every button click will add more (but on the same position at 0,0,0)
     
  6. petarmHavok

    petarmHavok

    Joined:
    Nov 20, 2018
    Posts:
    461
    Took a quick look at this, and have some thoughts.

    Havok Visual Debugger works under 2 assumptions - Havok is set as the underlying physics engine, and physics is stepped. While I assume you tried with Havok as a physics engine, you need to also make sure you are stepping physics, because that's the only thing that triggers the connection to the Visual Debugger. I assume this is why you were seeing this work sometimes, and sometimes not.

    Does that sound reasonable?
     
    MNNoxMortem likes this.
  7. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    685
    I will test this, that sounds incredibly reasonable.
     
  8. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    685
    @petarmHavok still no way to get this reliably to work with the attached project. How do I guarantee it steps? Already tried
    * Changing ports
    * stepPhysicsWorld.FinalSimulationJobHandle.Complete(); from a SystemBase on Update.

    The HVD remains stuck at yellow state "Trying to Connect"
     
  9. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    685
    @petarmHavok created a minimalistic Project and attached it. Reproduceable for me 100% of the time:
    * Window 10 x64
    * Unity Hub 2.0.0-beta-4
    * Unity 2020.1.13f1
    * Target Platform Windows 64-bit
    * Open Project
    upload_2020-11-14_22-54-6.png
    * Press Play
    * Click Button
    * Log shows "Button Clicked"
    * Entity Window shows created Entity
    ** Inspector shows PhysicsCollider
    ** Inspecotr shows LocalToWorld with TRS ((0,0,0), quaternion.identit, (1,1,1))
    * PhysicsSettings shows enabled HVD and port 25001
    upload_2020-11-14_22-55-23.png
    * Window > Analysis > Havok Visual Debugger
    * HVD opens but does not connect and loops retrying
    upload_2020-11-14_22-55-0.png
    * Entities shown
    upload_2020-11-14_22-56-44.png
    * BuildPhysicsWorld should consider them as well
    upload_2020-11-14_22-57-1.png
     
  10. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    685
    Attached project (5 files per post):
     

    Attached Files:

  11. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    685
    Maybe this helps
    Code (CSharp):
    1. Asset Packages/com.havok.physics/Tools/VisualDebugger/d3dcompiler_47.dll has no meta file, but it's in an immutable folder. The asset will be ignored.
    or this
    upload_2020-11-14_23-16-45.png
     
    Last edited: Nov 14, 2020
  12. petarmHavok

    petarmHavok

    Joined:
    Nov 20, 2018
    Posts:
    461
    I'll try your repro project and let you know. Thanks for the repro!
     
    MNNoxMortem likes this.
  13. petarmHavok

    petarmHavok

    Joined:
    Nov 20, 2018
    Posts:
    461
    One of my colleagues was kind enough to take a look at this and it turns out that the reason you are not able to connect Havok Visual Debugger is the fact you don't have "Convert To Entity" on your object that contains the HavokConfiguration script (check the second screenshot of the HavokConfiguration you posted above - the first one is fine). That means it doesn't end up in ECS world and you get a default configuration, which disables the visual debugger.

    We've verified that ticking "Convert To Entity" fixed this on your repro project. Let us know if it works for you!
     
    MNNoxMortem and steveeHavok like this.
  14. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    685
    Wait... what?! I will test that and am really sorry if this is what happened...
     
  15. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    685
    @petarmHavok, @steveeHavok confirmed, this was indeed the culprit. Thank you very much for solving this. Did I miss some kind of documentation about this, or was this just expected?
     
  16. petarmHavok

    petarmHavok

    Joined:
    Nov 20, 2018
    Posts:
    461
    Well it could be that we should document this, but the same applies for every script you add to your scene, body, shape, physics step, everything needs this in order to appear in the ECS world...
     
    MNNoxMortem and steveeHavok like this.
  17. steveeHavok

    steveeHavok

    Joined:
    Mar 19, 2019
    Posts:
    480
    We should certainly add errors/warnings to the HavokConfiguration script if there is not a ConvertToEntity component attached.
     
    MNNoxMortem likes this.
unityunity