Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Unity Simulation ParamReader example

Discussion in 'Unity Simulation' started by punktiert, May 20, 2020.

  1. punktiert

    punktiert

    Joined:
    Feb 17, 2014
    Posts:
    6
    Hi! Amazing package - but unfortunately I cannot get the ParamReader example to run. I have already reduced my project, use only the scripts from the homepage, tried different machines (both Win 10, 2019.3, Simulation SDK v1.0.9) and always get the same error: DC[E]: Path to the app params is not valid
    However, I can access the path and file, also via other Unity scripts. Could you please help me? Thank you!
     

    Attached Files:

  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,372
    I can't quite make out the full path and file name in your screenshot, can you paste it here again?
     
  3. punktiert

    punktiert

    Joined:
    Feb 17, 2014
    Posts:
    6
    Hi Jeff! the full path and file name is:
    file://D:/Unity/Sandbox Unity Simulation/Assets/StreamingAssets/app_param_0.json
    this is the log from Unity, when I copy it into the explorer the file opens correctly but Unity throws the error at:
    ParamReader.cs:56 with
    appParams = Configuration.Instance.GetAppParams<CubeAppParam>();
    Thank you for looking into this!
     

    Attached Files:

  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,372
    I believe the following comment in ParamReader.cs should help regarding running locally

    // NOTE: AppParams can be loaded anytime except during `RuntimeInitializeLoadType.BeforeSceneLoad`
    // If the simulation is running locally load app_param_0.json

    Mentioned at

    https://github.com/Unity-Technologi...ting-application-parameters-with-data-capture

    I'm still testing myself, the files have moved a bit in recent releases. Please let me know if this helps?
     
  5. punktiert

    punktiert

    Joined:
    Feb 17, 2014
    Posts:
    6
    As I understand, I have to assure that the json should be loaded after runtime initialization. But even if I call the method during the Update after a few frames, so definitely after the initialization, I receive the same error.
     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,372
    I was able to get it work as documented, I'm attaching a Unity 2019.3.11f1 project, I had to change the namespace from Unity.AI.Simulation to Unity.Simulation in the code as I'm using the most recent version. Also, in your original screenshot, I didn't see where you added the cube to the scene?
     

    Attached Files:

    Last edited: May 28, 2020
  7. punktiert

    punktiert

    Joined:
    Feb 17, 2014
    Posts:
    6
    Thanks for the sample! After a long time back and forth I have now got your example running. Maybe it has something to do with my Windows settings, apparently the length of the path is important; also it works when you place the project under: C:/Users/... but not D:/etc...
    Thank you for your help, much appreciated!

    But still, with the SDK 1.09 version, in a new project with the same path I can't get the scene to run, same error message. Could you please make the Unity Simulation Capture Package available through the Package Manager too? Thanks!
     
    Last edited: May 29, 2020
  8. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,372
    Did you remember to add the Cube component and set the Layer properties as described in the documentation? I didn't see those in your first screenshot. You can install the Simulation Capture Package via the upper right "+" drop down of Package Manager, and choose "Add package from git URL" and enter in "com.unity.simulation.capture@0.0.10-preview.8" and it will install the package. The needed files are now under Packages/Unity Simulation Capture/Runtime/Convenience
     
  9. punktiert

    punktiert

    Joined:
    Feb 17, 2014
    Posts:
    6
    Thank you for the link! Unfortunately, I can't replicate the example within a new project. Same settings, packages, layers, tags etc. Even if I copy your scene, and folders over, I get the same error message as before. Anyhow, min, I can use your ParamTest project as a wrapper for now.
     
  10. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,372
    Please make a back up of your project, delete the /Library folder, zip it up and either attach here or through a private message. Thanks!
     
  11. punktiert

    punktiert

    Joined:
    Feb 17, 2014
    Posts:
    6
    Please find below the .zip. I literally copied over your folders, scripts, tags, cube everything the same. I'm using Unity Personal 2019.15, win10. Actually, I can also work around this and bring my project inside your test project. Could it be e.g. a firewall setting? Thank you!
     

    Attached Files:

  12. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,372
    It looks like it's the space in the path name! Sorry about that. Make sure your project path doesn't contain any spaces.
     
unityunity