Search Unity

Official Experimental Entities 0.50 is Available

Discussion in 'Entity Component System' started by mfuad, Mar 16, 2022.

Thread Status:
Not open for further replies.
  1. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    335
    Hi everyone! We have just published a new experimental version of Entities and other ECS-based packages that include nearly 1.5 years worth of bug fixes, API cleanups, and performance improvements. If you are just getting started, refer to our installation & setup guide. For those who will be upgrading from Entities 0.17 to Entities 0.50, we have put together an upgrade guide that includes common tips during that process. Additionally, this release is requires the use of Unity 2020 LTS (min. version Unity 2020.3.30).

    As a reminder: Experimental releases are not supported or recommended for production, but provide early access for those who want to try out ECS in their projects. This also helps us make progress on development through everyone’s feedback.

    What's new
    As part of this Entities 0.50 release, the following packages have been tested together with Unity 2020 LTS. For a full list of changes in each package, refer to the changelogs in our documentation (linked below):
    We have also updated the following packages, which are automatically included when installing the Entities package:
    Many of the changes and fixes in this release were a direct result of feedback we received from the forum and from reported bugs. Thank you to everyone who took the time to make these issues known to our teams and for your feedback!

    Notable Highlights

    upload_2022-3-15_17-1-30.png

    Entity Authoring
    • The Entity Debugger window has been replaced with several new windows that are now more embedded within the Editor:
      • Entities, Components, and Systems windows to search, select, and inspect via the Inspector
      • A Hierarchy window that shows the full Entities hierarchy and allows for selection of entities
      • Archetypes window to show all current archetypes and details for each
    • Two new Profiler modules to profile ECS structural changes and memory:
      • Entities Structural Changes profiler module can record which world/system produced a structural change, and how much time it cost per frame
      • Entities Memory profiler module can record which world/system allocates memory chunks, with additional details per archetype
    • Entities Journaling to record and explore ECS events, using static APIs and the IDE Watch window, and understand data lifecycles and debug your game
    • Note: The com.unity.dots.editor package has been merged with com.unity.entities
    System and Entities API Improvements
    • A new simplified
      SystemBase
      type that allows for implicit job scheduling and the ability to schedule jobs to run both sequentially and in parallel
    • Entities.WithFilter(NativeArray<Entity> entities)
      allows filtering
      Entities.ForEach
      so that it only iterates over a set of entities
    • New
      IJobEntity
      job interface, for implementing re-usable and burstable jobs that iterate over entities
    • The list of chunks matching an EntityQuery is now automatically cached internally, significantly improving the performance of most EntityQuery operations between structural changes (especially in titles with high empty archetype counts)
    Improved Debugging
    • Visibility into the generated C# code for inspection and debugging
    • The most commonly-used Entities types now have debugger type proxies, significantly improving the ease of inspecting their state during in-IDE debugging sessions
    • More debug functionality is available in standalone builds, including debug checks and per-Entity debug names
    Netcode Updates
    • Physics can be predicted, making it possible to build games where players are directly interacting with and affecting physics objects in the world.
    • Ghosts can switch between being interpolated and predicted at runtime. This allows a client to dynamically predict everything that is close or important without paying the cost of predicting everything.
    • Improved support for streaming sub-scenes and loading prefabs on demand across various client-server configurations.
    • Commands can be sent without explicitly setting the command target on the connection, enabling a client to control multiple ghosts. This also enables changing which ghost a client is controlling at runtime - for example when entering a vehicle.
    • The code-gen has changed to source-generators, making them more robust and less likely to go out of sync.
    Rendering Updates
    • Hybrid Renderer V2 (HRV2) is now the default option and replaces Hybrid Renderer V1 (HRV1), which has been removed. This ensures users are now supported with a GPU-persistent data model, removing the main thread bottleneck of HRV1, and improving render thread performance.
    • HRV2 also has a broader compatibility with a range of shaders, and equips users with previously missing HDRP and URP features.
    Unity Physics and Havok Updates
    • Collision and trigger events now share a common interface, and simulation systems have been refactored to allow multiple physics worlds.
    • Integration between Unity Physics and the Universal Render Pipeline (URP) has been improved, with new shaders in the sampler, and URP compliant materials.
    Sharing feedback
    As mentioned earlier, a lot of the changes in this experimental release are a direct result of shared feedback. This forum is the best place to open discussions and ask questions. If you encounter a bug, please use the Unity Bug Reporter in the Unity Editor, accessible via Help > Report a Bug. Include the name of the package (with version number) in the title to help our team triage things appropriately!

    Looking ahead
    To learn more about what we are working on, you can refer to this post where we share information regarding our DOTS roadmap.

    Thank you again to everyone who has continued to take the time to share feedback. We look forward to hearing from you!
     
  2. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    482
    When can we expect update of animation package?
     
  3. Krajca

    Krajca

    Joined:
    May 6, 2014
    Posts:
    347
    Should we expect any 0.50 samples?
     
  4. InnovativeName

    InnovativeName

    Joined:
    Oct 28, 2020
    Posts:
    2
    I just wanted to say, that when you click on the more Eitites packages some redirect you to the .60 versions
     
    Zerio777 likes this.
  5. Lapsapnow

    Lapsapnow

    Joined:
    Jul 4, 2019
    Posts:
    51
    Woo! A long time coming, glad to have some new air in the DOTS sails!
     
  6. Aleksander_Wit

    Aleksander_Wit

    Joined:
    Dec 13, 2020
    Posts:
    19
    We have definitely been waiting for this!
     
  7. RPGameOfficial

    RPGameOfficial

    Joined:
    Nov 25, 2020
    Posts:
    7
    Thanks for your job, guys! Will try it soon :)
     
    Ronsu900 and mfuad like this.
  8. jivalenzuela

    jivalenzuela

    Unity Technologies

    Joined:
    Dec 4, 2019
    Posts:
    76
    > I just wanted to say, that when you click on the more Eitites packages some redirect you to the .60 versions

    Hi! When you click where exactly?
     
  9. BelkinAlex

    BelkinAlex

    Joined:
    Sep 28, 2015
    Posts:
    9
  10. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    335
  11. Zec_

    Zec_

    Joined:
    Feb 9, 2017
    Posts:
    148
  12. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    335
    We're in the process of updating existing samples to this 0.50 release and will share back when these are available.
     
  13. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    335
    Yes, Mathematics 1.2.5 is the correct version and we've got a documentation update lined up to fix this. The key is, downloading Entities 0.50 will automatically download the compatible version of Mathematics for you.
     
  14. Zec_

    Zec_

    Joined:
    Feb 9, 2017
    Posts:
    148
    The documentation is a wee bit lacking in specifics regarding version requirements. Here's some info in case anyone else gets stuck on this.

    I was running Unity 2020.3.19f (which I assumed matched the specified required 2020 LTS) but was greeted by a bunch of errors about missing APIs. They were resolved when I upgraded to 2020.3.30f.

    Here's a screenshot of a sample of the errors:
    upload_2022-3-17_0-35-19.png

    Edit: I just realized the top post in this thread actually specifies the required version. I was purely following the installation guide here which only specified 2020 LTS
     
    IliqNikushev likes this.
  15. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    335
    Yes, this requires Unity 2020.3.30. We'll update our documentation to make this clear.
     
  16. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    982
    Is it compatible with Unity 2021 now or should we stick with 2020?
     
    rtytewfdfgfhfgkuio likes this.
  17. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    335
    Entities 0.50 release is only compatible with 2020 LTS. We're preparing a minor update (Entities 0.51) to reach compatibility with 2021 LTS. You can read more about that in this post.
     
  18. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,264
    Found a couple of regressions so far.

    First, this syntax is now broken:
    Code (CSharp):
    1. SetComponent(targetEntity, GetComponent<Translation>(sourceEntity));
    Second, ExclusiveEntityTransaction is completely broken. It seems that nearly all EntityManager methods call AssertMainThread() which prevents EET from being used in those contexts. Is this just not supported anymore?
     
    Mockarutan likes this.
  19. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    335
    After Entities 1.0, no specific details to share beyond that.
     
  20. mikaelK

    mikaelK

    Joined:
    Oct 2, 2013
    Posts:
    284
    Got huge pile of errors after upgrading. Reported this as a bug.
    upload_2022-3-17_9-33-19.png
    Also entities are not rendering (but they do work otherwise) in build after importing my plugin to a new project. They do render on the editor
    Reported this as well(not sure if its related to 0.50.0 but quite sure the same issue is still there).
     
  21. Fabrice_Lete

    Fabrice_Lete

    Unity Technologies

    Joined:
    May 5, 2018
    Posts:
    55
    Looks like you need to remove platform-specific Platforms packages and add com.unity.platforms instead.
    https://docs.unity3d.com/Packages/com.unity.entities@0.50/manual/upgrade-guide.html#platforms
     
  22. Fabrice_Lete

    Fabrice_Lete

    Unity Technologies

    Joined:
    May 5, 2018
    Posts:
    55
    Could you provide an example of the incorrect behavior you've observed about GetComponent/SetComponent?
    I couldn't reproduce it on a simple test, I must be missing some context.

    Code (CSharp):
    1. public partial class TestSystem : SystemBase
    2. {
    3.     private Entity targetEntity;
    4.     private Entity sourceEntity;
    5.  
    6.     protected override void OnCreate()
    7.     {
    8.         targetEntity = EntityManager.CreateEntity(typeof(Translation));
    9.         sourceEntity = EntityManager.CreateEntity(typeof(Translation));
    10.     }
    11.  
    12.     protected override void OnUpdate()
    13.     {
    14.         SetComponent(sourceEntity, new Translation { Value = GlobalSystemVersion });
    15.         SetComponent(targetEntity, GetComponent<Translation>(sourceEntity));
    16.         Debug.Log(GetComponent<Translation>(targetEntity).Value);
    17.     }
    18. }
     
  23. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    Probably inside ForEach? As in OnUpdate it's EntityManager and inside ForEach it's CDFE and codegen
     
    Last edited: Mar 17, 2022
    DreamingImLatios likes this.
  24. Fabrice_Lete

    Fabrice_Lete

    Unity Technologies

    Joined:
    May 5, 2018
    Posts:
    55
    Ah yes, indeed! Thanks eizenhorn!

    In a codegen context (like Entities.ForEach or Job.WithCode), having multiple calls in the same expression can trigger a compiler error. The workaround is to turn this:

    Code (CSharp):
    1. SetComponent(targetEntity, GetComponent<Translation>(sourceEntity));
    Into this:

    Code (CSharp):
    1. var value =  GetComponent<Translation>(sourceEntity);
    2. SetComponent(targetEntity, value);
    We should add a note to the upgrade guide, thanks!
     
  25. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,759
  26. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,116
    this is very important for 2021 LTS users because many features on URP are compatible with 2021+ (like URP decals...)
     
  27. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    @Fabrice_Lete Is that possible to improve this? Now become more typing seems not really nice.
     
  28. Fabrice_Lete

    Fabrice_Lete

    Unity Technologies

    Joined:
    May 5, 2018
    Posts:
    55
    This is a known issue and not an intentional change. It will get fixed but the only thing I can suggest for now is the workaround of splitting those expressions into multiple ones.
     
    NotaNaN and optimise like this.
  29. amittelbach

    amittelbach

    Joined:
    Oct 25, 2021
    Posts:
    2
    First, its great to see a new Entities release after so long. Regrettably, it includes a decision that, for us, effectively makes ECS unusable for now. The decision to only support Vulkan (and no longer OpenGL) with Hybrid Renderer V2 and to remove V1 means that ECS can effectively not be used together with ARFoundation when targeting Android as ARCore at this point does not support Vulkan (and it seems that there is not much willingness to support it: https://github.com/google-ar/arcore-android-sdk/issues/258).

    Are there any plausible workarounds which provide an upgrade path from older ECS versions when using ARFoundation?
     
  30. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    The plan is to support GLES 3.1 and up with Entities 1.0. So if you need GLES support during development or before Entities 1.0 ships then your best option is to stay on 0.17 (And continue to use Hybrid Renderer V1) until we release Entities 1.0.
     
    mariandev and Opeth001 like this.
  31. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,116
    we are planning to release our game around 01/2023, we have created a custom hybrid renderer based on DrawMeshInstancedIndirect and compute shaders for frustum culling…
    we already support GLES 3.1+ and Vukan, but we will have endless work to keep up with new ECS/URP features.
    I don't want to ask for the release date of Entities1.0 as I know it's not that simple but could you advice us to keep developing our custom hybrid renderer or just focus on the game and wait the official hybrid renderer 1.0.

    Thank you!
     
    Last edited: Mar 18, 2022
    lclemens likes this.
  32. cort_of_unity

    cort_of_unity

    Unity Technologies

    Joined:
    Aug 15, 2018
    Posts:
    98
    We discovered this issue ourselves just a short while ago; sorry about that. Yes, using EET from worker threads is still intended to work; it just didn't have sufficient internal code coverage to catch this issue. We'll fix it in a patch release.
     
  33. coolazura

    coolazura

    Joined:
    Nov 22, 2019
    Posts:
    1
    This is such an awesome thing to see. Especially with how long there wasn't much news. :) I can't wait to get back into using DOTS again. I have found a massive love for DoD and ECS design systems, so thanks for all the hard work.
     
    Ronsu900, Krajca and mfuad like this.
  34. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,264
    This was the issue and the workaround I implemented. It is not that big of a deal. But it caught me off guard and the error was not helpful.

    Yeah. My use case is doing a series of instantiations and such in a Burst context using IJob.Run(). Turns out I can just pass in the EntityManager directly without having to go through EET. That used to not be allowed. So fortunately that was another easy workaround.

    I did find a third issue and workaround. Entities.WithChangeFilter now forces a sync point on that component on the main thread. So I had to switch all instances of this to use IJobEntityBatch and use batchInChunk.DidChange

    Right now my biggest issue is with Burst when safety checks are enabled. Burst throws an internal exception for some of the jobs in my project.

    There's a few transform bugs and regressions lingering. I'll try to make proper bug reports for those in the near-ish future. But the big one that I called out in a previous thread is that change filtering in LocalToParentSystem is non-deterministic.

    Also the Systems window is broken for me still. Though this time it might be my fault so I still need to investigate. EDIT: It is broken. Using ScriptBehaviourUpdateOrder.AppendSystemToPlayerLoop to add a system that isn't one of the blessed root system groups causes the Systems window to just not show anything.

    All in all, I got my little test game of 60-some odd systems running against the latest DOTS already. That's a lot better than I expected! Even audio is working thanks to the DSPGraph patch release that no one is talking about!
     
    Last edited: Mar 18, 2022
    mariandev likes this.
  35. Hertzole

    Hertzole

    Joined:
    Jul 27, 2013
    Posts:
    422
    Ever since I heard that Entities was being re-written with source generators I've been anticipating this day!

    I would love to know more about how Entities pulled it off and if there's some way we can do source generators like this in 2020.3! I know it's supported in 2021.2 but the workflow is far from ideal. I don't suspect this will be easier, but would still be super interesting!
     
  36. SLGSimon

    SLGSimon

    Joined:
    Jul 23, 2019
    Posts:
    80
    The package uses some obsolete methods from Collections, which is fine normally but breaks if you are using warnings-as-errors
     
  37. amittelbach

    amittelbach

    Joined:
    Oct 25, 2021
    Posts:
    2
    That is great to hear.

    Will Entities 0.17 work with 2021.3 LTS? And do you already have a ballpark target for when Entities 1.0 should be out?
     
  38. BuzzJive

    BuzzJive

    Joined:
    Mar 6, 2014
    Posts:
    75
    Are there package installs for com.unity.platforms.XX? Specifically I want to test the Android ECS build and I can't get subscenes to build without updates to those packages. I was using Entities 0.17 with Hybrid Renderer 0.11 and Android platforms 0.10 and it was working but I'd like to try Entities 0.50
     
  39. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,759
    These packages no longer exists. There is only a single com.unity.platform package now.
     
    oAzuehT, mariandev and bb8_1 like this.
  40. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
    Am I the only one who gets the following error with no further explanation?

    Code (CSharp):
    1. Microsoft (R) Visual C# Compiler version 3.8.0-dev.20527.1 (53dc6556)
    2. Copyright (C) Microsoft Corporation. All rights reserved.
    3. error SGJE0003: The parameter 'index' of type int will be ignored.
    This is after fixing a lot of issues logged on the console such as nested ForEach and AddComponent(query). There is no way for us to understand what's wrong / what to do to fix the problem.
     
  41. DrBoum

    DrBoum

    Joined:
    Apr 19, 2020
    Posts:
    26
    are you using Unity 2020.3.30 ?
     
  42. Fabrice_Lete

    Fabrice_Lete

    Unity Technologies

    Joined:
    May 5, 2018
    Posts:
    55
  43. Fabrice_Lete

    Fabrice_Lete

    Unity Technologies

    Joined:
    May 5, 2018
    Posts:
    55
    Chances are that you are missing an `[EntityInQueryIndex]` on an integer parameter to the Execute method of an IJobEntity.

    Look at point 6 of "Replace IJobForEach with IJobEntity" in the upgrade guide:
    https://docs.unity3d.com/Packages/com.unity.entities@0.50/manual/upgrade-guide.html#ijobentity
     
  44. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    Ah beaten me :p Just checked that theory :D

    Yes, that's exactly what happens if you miss that attribute @alexandre-fiset .

    @Fabrice_Lete anyway better to have better error about that :)
     
    alexandre-fiset and Fabrice_Lete like this.
  45. Fabrice_Lete

    Fabrice_Lete

    Unity Technologies

    Joined:
    May 5, 2018
    Posts:
    55
    For more details, check the point "Remove platform-specific Platforms packages and add com.unity.platforms" in the upgrade guide here:
    https://docs.unity3d.com/Packages/com.unity.entities@0.50/manual/upgrade-guide.html#platforms
     
    BuzzJive likes this.
  46. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
  47. Shudrum

    Shudrum

    Joined:
    Apr 3, 2011
    Posts:
    63
    Hello and thank you for the work done!

    I loved the upgrade guide. Clear, simple to follow, and I achieved the migration without a single issue.

    <3
     
    Ronsu900, Krajca, Krooq and 1 other person like this.
  48. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
    Is it possible that the compiler is now much more strict with namespaces?

    Code (CSharp):
    1. using Unity.Entities;
    2.  
    3. namespace MyNamespace.System
    4. {
    5.     public partial class BrokenSystem : SystemBase
    6.     {
    7.         protected override void OnUpdate()
    8.         {
    9.             Entities.ForEach((MyComponent c) => {}).Run();
    10.         }
    11.     }
    12.     public struct MyComponent : IComponentData { }
    13. }
    14.  
    This won't compile as the System clash with the generated code and throws these errors:

    Temp\GeneratedCode\Assembly-CSharp\BrokenSystem__System_1787913306.g.cs(5,13): error CS0234: The type or namespace name 'Runtime' does not exist in the namespace.

    This also happens with any combination of namespaces sharing a hiearchy member of the same name. So if you have Views.Interaction and Player.Interaction in the same ForEach, this will break codegen.
     
    Last edited: Mar 18, 2022
    Mockarutan likes this.
  49. elliotc-unity

    elliotc-unity

    Unity Technologies

    Joined:
    Nov 5, 2015
    Posts:
    230
    @DreamingImLatios
    If you haven't already, could you make a bug report for this one, or else paste the job and the error message? The Burst team will be interested in fixing that for sure, if they haven't already in an upcoming release.
     
    Krajca likes this.
  50. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,264
    Walter_Hulsebos likes this.
Thread Status:
Not open for further replies.