Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Official Experimental Entities 1.0 is available

Discussion in 'Entity Component System' started by mfuad, Sep 26, 2022.

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

    TieSKey

    Joined:
    Apr 14, 2011
    Posts:
    231
    I know u have to put the limit somewhere but I am unpleasantly surprised at how entities 1.0 won't have a way to work with prefabs, which is arguably the most common/used feature in unity.

    Baking entities scenes are good for when u have static/regular content but it leaves all the procedural (or network streaming) use cases out.

    Looking forward to check the DOTS Addressables package (although working with regular prefabs is still the easiest and more "unity" way imho).
     
    koonm and LuisEGV like this.
  2. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,358
    Why entities 1.0 enforces jobs completion for no reason? Is this some kind of bug or it's by design?

    upload_2022-9-29_18-11-6.png

    It looks like currently running jobs are completed by other parts of game loop.
    Am I missing something?
     
  3. IsaacsUnity

    IsaacsUnity

    Unity Technologies

    Joined:
    Mar 1, 2022
    Posts:
    94
    Hey there! Entities Graphics will support Android Vulkan, GLES 3.1 and iOS with the pre-release of ECS for Unity 2022. We're currently resolving some of the bugs on Android GLES 3.1 and iOS, and we will update the documentation in our next release.
     
    PadelVR, lclemens and BuzzJive like this.
  4. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    335
    We will follow up in the near future with a dedicated communication and update of our plans to make this character controller well integrated into our package ecosystem. Plan is to bring compatibility with Entities 1.0.
     
  5. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    335
  6. WAYNGames

    WAYNGames

    Joined:
    Mar 16, 2019
    Posts:
    1,016
    The documentation you shared says

    How does the query system and dependancy management behave for Aspects that have both readonly components and readwrite component ? Does asking for the aspec as RW make the query consider all components as RW or does it take the RO and RW of each components correctly into consideration ?
     
  7. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    785
    This might be a stupid question... but my from my understanding when prefabs are baked into subscenes, their textures get stored in an uncompressed format, which could result in huge subscene files and cause problems on a mobile game, whereas addressables uses compression. Is that still the case, or does the binary format now handle compression? ( see this post: https://forum.unity.com/threads/subscene-entities-cache-loadable-at-runtime.704768/#post-8421147 )

    EDIT: This question was answered and it turns out that I was mistaken - the current and future versions of Entities use compression in the binary formats.
     
    Last edited: Oct 9, 2022
    SolidAlloy likes this.
  8. PublicEnumE

    PublicEnumE

    Joined:
    Feb 3, 2019
    Posts:
    729
    Two questions:

    1. Are nested Native Containers supported in 1.0?
    2. Is support for having Native Containers as members of component data coming to 1.0 at some point?

    Both of these features have been hinted at by DOTS devs in past ECS version threads (which are deleted now). And the 1.0 hangs log lists this note:
    • Nested native containers don't end up in component data types now that they are supported.
    Any more info on these two questions would be very much appreciated. :D I’m surprised more people aren’t talking about this.
     
    DatCong likes this.
  9. DatCong

    DatCong

    Joined:
    Nov 5, 2020
    Posts:
    88
    Bassiclly u can imple your own NestedContainer, like NativeArray<Ptr> where Ptr is pointer to NativeArray.
     
  10. PublicEnumE

    PublicEnumE

    Joined:
    Feb 3, 2019
    Posts:
    729
    That’s been true, and we could always use unsafe containers in those ways.

    But the release notes (and dev forum comments) seemed to imply that there would be official support for nesting native container types directly in other native container types.

    As well as support for declaring native containers (not unsafe containers) as members of an IComponentData struct.

    I’m hoping to get official info other either feature.
     
  11. Tony_Max

    Tony_Max

    Joined:
    Feb 7, 2017
    Posts:
    362
    Does it really mean that the only option to work with transforms we have is to fetch all this data even when we need just position?
     
  12. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,701
    Better answer is open codegened result (as Aspects is exactly syntax sugar for codegen). But first hint you can find here:
    https://docs.unity3d.com/Packages/com.unity.entities@1.0/manual/aspects-create.html
    upload_2022-9-30_12-3-53.png

    Lets compare two jobs, which both using aspect like this:
    upload_2022-9-30_12-4-26.png
    As you can see we using
    RefRW
    which is allow us access data through this aspect with read and write access rules.
    Now let's create system, with two jobs, one using
    IJobEntity
    which is accessing aspect through
    in
    and another through
    ref
    and check how it will be compiled.
    upload_2022-9-30_12-10-41.png

    We don't need to check all - aspect, job and system compiled code, as in compiled system alone you already will see the difference and the answer to your question:
    upload_2022-9-30_12-11-47.png
    I've highlighted most interesting part.

    The answer is:
    Depends on how aspect is accessed, query used for that, will resolve
    RO
    or
    RW
    pattern and will put proper Read or Write dependency to chain. All
    RefRO
    - always will be ReadOnly. All
    RefRW
    inside
    Aspect
    , depends on how Aspect is accessed can be all
    RW
    (
    ref
    access) or all
    RO
    (
    in
    access).
     
    Last edited: Sep 30, 2022
  13. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,701
    Yes
     
    lukereeves likes this.
  14. WAYNGames

    WAYNGames

    Joined:
    Mar 16, 2019
    Posts:
    1,016
    Thanks for the detailed answer and link to proper docs
     
  15. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,701
    For more info you can see generated aspect code and will see actual component access patterns for query:
    upload_2022-9-30_12-37-37.png
    As you can see depends on possible access RefRW type switch it's component type access pattern, and RefRO always ReadOnly
    upload_2022-9-30_12-38-39.png
     
  16. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,824
    Most likely sometime after 1.0 will officially get released. Even after that, it may be months to come, until animation package will be added. It has some breaking changes.

    Atm., it looks like DOTS team will be focused until end off the year, or so, on fixing 1.0 experimental bugs.
     
  17. DatCong

    DatCong

    Joined:
    Nov 5, 2020
    Posts:
    88
    1.0 Release will come with animator solution, u can check it in animation thread
     
  18. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,701
    It's not. In DOTS subforum Unity recommend still use Mechanim, and that they wouldn't release Animation for 1.0
    upload_2022-9-30_15-49-56.png
    And road map also tells us that 1.0 wouldn't have Animation.
    https://portal.productboard.com/wkjyyxmtns7dipwofp19pj8r/tabs/104-dots
     
    Antypodish likes this.
  19. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,824
    I don't know where you got your information from. Can you post a link?

    Last official statement on the animation is this :

     
  20. DatCong

    DatCong

    Joined:
    Nov 5, 2020
    Posts:
    88
  21. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,824
    eizenhorn and DatCong like this.
  22. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,236
    Woah, is this exactly what it sounds like, or some sort of word play/ruse?

    As in, can we now have the following?

    Code (CSharp):
    1. NativeList<NativeList<int>> myList = new NativeList<NativeList<int>>(Allocator.Temp);

     
    Last edited: Oct 1, 2022
  23. Armitage1982

    Armitage1982

    Joined:
    Jul 26, 2012
    Posts:
    38
    About Havok, there is a new pricing model on October 13 for Pro/Enterprise/UIC, but the package will only be released in the pre-release.

    Does that mean that the pre-release of ECS is for around that date?

    Using Havok, I'm currently stuck in Unity 2021 LTS with ECS 0.51.
    Transiting to Unity 2022, ECS 1.0 and potentially from HDRP to URP (because of update features of the latter) are important decisions.

    I would just like to know if we are in a waiting period of a few days or a few months?
     
  24. johnroodt

    johnroodt

    Joined:
    May 30, 2012
    Posts:
    14
    When installing Unity 2022.2.0b9 on a Windows 10 PC to get to grips with DOTS is it necessary add any other modules besides:
    - "Windows Build Support (IL2CPP)"
    ?
     
  25. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,824
    It never was few days between experimental, preview and stable.
    So you need expect months, if not years in some cases.

    It is safer to assume some time 2023. But that shouldn't be your major factor upon taking development decision.

    Always develop on what you have access now, not what you maybe can get in the future. Otherwise your project may get strangeled.
     
  26. Arathorn_J

    Arathorn_J

    Joined:
    Jan 13, 2018
    Posts:
    51
    I installed the latest 1.0 version Entities and Entities Graphics but after installing com.unity.physics the component of LocalToWorldTransform no longer exists on any of my entities and the type no longer exists in the Transform namespace. Is there some other step for installing the physics package?

    upload_2022-10-1_6-12-10.png
     
  27. tchamblee67

    tchamblee67

    Joined:
    Sep 2, 2017
    Posts:
    3
    I'm also having the same thing. I'm upgrading a project from 0.5, have installed Entities, Entities Graphics, and Unity Physics 1.0.0-exp.8. 'LocalToWorldTransform' cannot be found.
     
  28. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    882
    if physics(and/or netcode?) is present, the old transform system is used(v1)
     
  29. tchamblee67

    tchamblee67

    Joined:
    Sep 2, 2017
    Posts:
    3
    Thank you.

    It wasn't clear to me that `ENABLE_TRANSFORM_V1` gets set automatically if physics or netcode is present & that causes the new transform namespaces to be conditionally compiled out.

    Might be worth mentioning in the upgrade guide, since the first section in that guide recommends changing all the transforms to the new system, but doesn't mention the physics/netcode incompatibility nor the automatic setting of `ENABLE_TRANSFORM_V1`. (The forum posts do mention the incompatibility with physics/netcode)
     
  30. Krooq

    Krooq

    Joined:
    Jan 30, 2013
    Posts:
    196
    Since runtime conversion is deprecated, what is the way forward for converting things that are not yet supported?
    The main obvious one being the camera.
     
    ScallyGames and defic like this.
  31. PalmGroveSoftware

    PalmGroveSoftware

    Joined:
    Mar 24, 2014
    Posts:
    17
    Awesome news.
    Thanks Unity team !
    Just tested quickly to see if there is any progress on the terrain front... dropped quickly into a subscene, still no luck :p
    But still asking if this is normal at this stage still and planned for next drops or am I missing something ?
    Thanks !
     
  32. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    WebGL Tiny?
     
  33. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,824
    Not in the scope of 1.0 entities release.
     
  34. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    But it will work with WebGL?
     
  35. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,297
    I've been using custom runtime conversion from prefabs / MonoBehaviours / SO's in a hybrid manner for a couple of projects now, and it works like a charm. Subscene conversion never worked stable enough, and Unity Cloud Build never supported subscenes. So it was a no brainer to make one.

    Solution to archetype fragmentation is this:
    - Iteraterate over implemented component "ISuppliers", and get stable hashes from each one. [Editor Time]
    - Generate unique hash based on those stable hashes. Any hashing algorithm can be used. [Editor Time -> hash is serializable]
    - Use EntityArchetype lookup, and fetch EntityArchetype based on that unique hash. [Runtime onwards]
    - If not available - generate archetype based on stable component hashes, store & return.
    - Then Entity can be generated based on the archetype -> no fragmentation.

    No second world required :)

    In any case, personally, I'd wait for more stable Unity version to transition to.
    Transitioning production projects to the beta version of Unity -> Reaaaaly bad idea.
     
    Last edited: Oct 2, 2022
  36. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,701
    Much more effort and time and no benefits in the end :D Why spend time to hashing, why spend time to serialization and storing somewhere archetypes hash, why spend time to deserialization, why spend time to compare (and compute at runtime for comparison) hashes :D (by time I mean not the process time, but time to basically implement all of this)
    Just create world in one line and just add one system in one line which will convert and add components, that's it. In this world archetypes will be fragmented, but that's not a problem at all, as when you'll move entities to another world (1 line again) final world will have only final defragmented archatypes, and after that you safely dispose conversion world with all fragmented archetypes.
    Well most of the time our game been on beta Unity versions without any problems :)
     
    Last edited: Oct 3, 2022
    Prince_of_Persia likes this.
  37. Creasu

    Creasu

    Joined:
    Feb 1, 2020
    Posts:
    7
    Hello, I was wondering once DOTS has a stable release will something like an example project be considered? Something similar to one of the microgames unity has. I think it would be a great help to understand how to use DOTS to your advantage in a project.
     
  38. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,297
    Full runtime conversion support, that is a benefit. With no codebase changes basically throughout 0.17-0.51 (probably will work without changes in 1.0, haven't tested yet). And, no subscenes. That's a pretty big benefit in my book. It works pretty much as you've described, except for the world point.

    Also, it seems like conversion flow and its systems and such will be removed in the future (its there for now to support transition from one version to another). Or, it will not be accessable in runtime. So its pretty bad idea to rely on it. But then, who knows what will be in the next version.

    Yeah, I'm not so sure anymore, judging by 2021 LTS state. But then again, if you're not using Unity's solutions, it may not affect your experience at all.

    Anyways, you do you :)
     
    Last edited: Oct 3, 2022
  39. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,824
    Did you checkout Unity DOTS samples on github?
     
  40. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,701
    It seems you've missed the flow of the conversation:) We speaking about own custom conversion processes, not Unity one, I don't know why you decided to mention Unity runtime conversion and Unity conversion systems :). What we talking about is your approach have no benefits against custom user conversion World (not Unity one) with user own conversion system (not Unity one), and to be fully clear that system not necessary Entities system, it can be just one MonoBehaviour which is responsible for creating World, calling conversion on authorings, moving entities to main world and releasing conversion world. You just introduce absolutely unnecessary steps with hashig, storing that hash, serialization and deserialization, comparing hashes where they serves no purpose :)
     
    Last edited: Oct 3, 2022
  41. IsaacsUnity

    IsaacsUnity

    Unity Technologies

    Joined:
    Mar 1, 2022
    Posts:
    94
    Thank you for the message! To start, we do not recommend using experimental packages for production, including Havok Physics for Unity experimental package. The new pricing model takes effect on October 13th, but ECS for Unity (including the full release of Havok Physics for Unity) will only be available when Unity 2022.2 is released.

    The release date for 2022.2 is to be determined, but based on historical trends, 2021.2 was released in Q4 of 2021, so Q4 of 2022 would be a relative timeline to look at for 2022.2. This is of course, subject to change. I hope that helps!
     
  42. TieSKey

    TieSKey

    Joined:
    Apr 14, 2011
    Posts:
    231
    Mmmm I think you were talking about about own/user "conversion" but others (including me) were talking about unity keeping their conversion API.
    Btw, remember that conversion is not just "calling conversion on authorings". For example, I don't have authorings, I don't want nor need them, I just need a bunch of arbitrary/user provided prefabs with unknown hierarchies of GO with usual rendering and physics elements to be turned into an entity prototype/prefab.
     
    xVergilx likes this.
  43. IsaacsUnity

    IsaacsUnity

    Unity Technologies

    Joined:
    Mar 1, 2022
    Posts:
    94
    Thank you for the message! It should be possible to work with WebGL, and we're currently developing more documentation and samples to illustrate how a user can achieve this in the pre-release of ECS of Unity.
     
  44. IsaacsUnity

    IsaacsUnity

    Unity Technologies

    Joined:
    Mar 1, 2022
    Posts:
    94
    Thanks for the message. Your intuition is spot on, we're working hard to provide more samples and documentation with the pre-release of ECS for Unity, so that users can easily learn about the advantages of ECS and understand how it can be used. @LaurentGibert's post here covers some of the additional scope we're looking to complete with the pre-release of ECS for Unity.
     
  45. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,701
    We speaking about custom runtime conversion with @xVergilx . I already answered to you pretty clear about Unity built-in runtime conversion:
    Period. That part of discussion closed.

    Then I've provided you example of how you can create your own:
    You ALWAYS have them, they were in all versions before 1.0 (for both - runtime conversion and Editor AOT conversion through subscenes) they're here in 1.0 (AOT subscenes only) and example you're described - also have authorings, just Unity one, and if you want runtime conversion for them you also should reimplement that.
    Have you read my answer? :) Specifically:
    Btw @xVergilx just in case - my answers to you just good old discussion :D (without any negatives)
     
    xVergilx likes this.
  46. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,297
    So here's the thing, I don't have authoring components. Like at all. There is none written.
    I need to somehow convert MonoBehaviours to EntityArchetypes. To ensure instantiated entity has proper components added before any other data is written via ECB. This is done to avoid moving entity from one archetype to another when "building" it. Plus, less typing. Plus, editor inspector display of what's been added to the resulting entity.

    Objects we use are hybrid anyways, since there's no sane time spent to tackle multiple parts of the engine that aren't available yet. Such as animations, vfx, sfx etc. Not everyone will is able to write their own engine from ground up, and as for the freely distributed packages -> they're okay as long as you're not doing stuff commercially. Otherwise, managers (people) does not want to deal with the risks of using one. And it works. Its not the fastest solution, but its miles ahead of what basic MonoBehaviours are.

    As long as simulation is blazing fast - nobody cares about loading.
    Unless its above 15s, which is usually caused by native plugins & libraries, rather than converting entities.
    (Mobile targets)

    With prior conversion flow there's zero control over:
    - Whether subscenes should be used -> impossible to build via Unity Cloud Build;
    - Stability issues and crashes due to subscenes;
    - How GameObjects / MonoBehaviours are handled (no pooling?);
    - Transform handling (Transforms system GC is abysmal, plus overall being unoptimized);


    Tl;DR: Its way easier to maintain custom runtime conversion. It probably easier than using prior conversion flow. But its not as performant as full pure subscene conversion. Its a tradeoff which is fine right now, since industry is not all "pure" entities (and probably won't be in a couple of years from) and more MonoBehaviour + Job / Burst based aligned.

    So overall, I hope Bake(r) flow is better. Removing platforms package from the mix helps UCB. But as for the overall stability - I'm not certain until I test it. There probably would be a bunch of edge cases for mobile. Hybrid objects & Transforms are two main issues remaining still. And a bunch of other parts of the engine.
     
    Last edited: Oct 3, 2022
    TieSKey likes this.
  47. TieSKey

    TieSKey

    Joined:
    Apr 14, 2011
    Posts:
    231
    Ofc I can "just implement my own things", I'm just expressing my desire as user that the engine continue to provide such a functionality.
    I don't want to sound rude but please realize that "u can implement your own" is not something we devs are exited hear, we use an engine precisely so we don't have to implement things ourselves. Specially so when the feature is there today and works just fine for our use cases :shrugh:

    (If I don't see and don't interact in any direct way with "build in authorings" as you call them, then they become an engine implementation detail and might as well do not exist from my perspective.


    Back on topic, for unity staff, any news on DOTs addressables preview you could share? Even a vague time frame would be handy to help schedule work from our side. Thx.
     
    Krooq and xVergilx like this.
  48. Krooq

    Krooq

    Joined:
    Jan 30, 2013
    Posts:
    196
    I think this conversation has gone on a bit of a tangent about custom runtime conversion, I don't think this thread is the correct place for such a discussion.
    I do have similar concerns to @TieSKey, Unity has removed runtime conversion for a reason.
    We want to know why it was removed and hear the alternative workflow that Unity suggests we use for all the things that cannot be thrown into a subscene.
    How are we supposed to work with GUI, Animations, Cameras, Particle Systems etc in 1.0?
     
    shotoutgames, Greexonn and lclemens like this.
  49. rauiz

    rauiz

    Joined:
    Mar 19, 2013
    Posts:
    44
  50. djhatvr

    djhatvr

    Joined:
    Sep 22, 2019
    Posts:
    58
    Has ANYONE been able to build 0.50, 0.51, or 1.0 with an IL2CPP backend without crashing when run on a Quest 2?
     
Thread Status:
Not open for further replies.