Search Unity

Change log for Entities 0.1?

Discussion in 'Entity Component System' started by jdtec, Jul 31, 2019.

  1. jdtec

    jdtec

    Joined:
    Oct 25, 2017
    Posts:
    302
  2. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    Compliments of 0lento in the discord server.
    I would also like an online official source so I can check out changes without being at my PC.
     
    NotaNaN and jdtec like this.
  3. runner78

    runner78

    Joined:
    Mar 14, 2015
    Posts:
    792
    And on PC you need installing/upgrade the package at least on time to read the changelog...
     
  4. GilCat

    GilCat

    Joined:
    Sep 21, 2013
    Posts:
    676
    Change logs are now always inside its own Package folder in the file CHANGELOG.md

    Yes you need to install the specific package version you want to see the changelog.
     
    xVergilx likes this.
  5. runner78

    runner78

    Joined:
    Mar 14, 2015
    Posts:
    792
    It's unhandy, if you want to read the change log before deciding to upgrade
     
    echeg, Shinyclef and Vanamerax like this.
  6. ScottyB

    ScottyB

    Joined:
    Apr 4, 2011
    Posts:
    146
    Your change log link is pointing to the wrong version, you want:
    https://docs.unity3d.com/Packages/com.unity.entities@0.1/changelog/CHANGELOG.html

    One neat trick to make sure you're always looking at the latest version of a package's documentation is to use "latest" instead of a specific version, e.g. https://docs.unity3d.com/Packages/com.unity.entities@latest

    EDIT: It is also important to note that Unity's online package documentation can take a while to update after a new package version has been published. Maybe they have some very aggressive caching going on? Hopefully they can speed up the publishing process in the future.
     
  7. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,759
    Yeah while he did link the wrong/old page this was not actually online when the post was made.

    You make an excellent point about latest. I'm hoping web crawlers start returning this rather than the old docs which seems to be a common issue on here.
     
    Last edited: Aug 1, 2019
    ChrisTsu likes this.
  8. jdtec

    jdtec

    Joined:
    Oct 25, 2017
    Posts:
    302
    Yea I was conscious of that when I linked it and did try changing the url version number. As @tertle says it wasn't there when I originally posted.

    Hopefully it will appear quicker in the future.

    As an aside I've heard EntityCommandBuffer supports burst in the new version with 2019.3, can anyone confirm that? Would have thought something like that would make the release notes.
     
    Last edited: Aug 1, 2019
  9. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    962
    Code (CSharp):
    1. Allow structural changes to entities (add/remove components, add/destroy entities, etc.) while inside of `ForEach` lambda functions. This negates the need for using `PostUpdateCommands` inside of ForEach.
    Is this more of a fix or something we should actively use now?
    PostUpdateCommands plays back commands later, is this now also true for EntityManager or are commands set right away, as it was before only that the iteration doesn't break?
    Are there differences in performance?
     
  10. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    ComponentSystem.Entities.ForEach is designed for ease of use. CommandBuffers are unnecessary now, all changes are applied immediately simplifying code that performs structural changes significantly. This is great for prototyping.

    If you want to write performant code use JobComponentSystem & IJobForEach & EntityCommandBuffer
     
  11. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    962
    That was a lightning fast response. Thanks, got it!
    With this change, will PostUpdateCommands be deprecated in the future or does it still have its usage? (Which I can't think of any now)
     
  12. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,116
    Sorry but I didn't get how do you add remove CD without the need of the PostUpdateCommands?
     
  13. elcionap

    elcionap

    Joined:
    Jan 11, 2016
    Posts:
    138
    EntityManager

    []'s
     
  14. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,116
    but what's the purpose of using the EntityManager knowing it will create sync points ?
     
  15. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,759
    If you're using component system and entities.foreach you've already triggered a sync point.
     
    Opeth001 likes this.
  16. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,116
    i didnt know about that, :p but using the EntityManager instead of the PostUpdateCommands will just create more sync points right ? otherwise why the PostUpdateCommands even exists ?

    so if i use ComponentSystems + EntityQuerie instead of the entities.foreach, will i still creating sync points ?
     
  17. elcionap

    elcionap

    Joined:
    Jan 11, 2016
    Posts:
    138
    PostUpdateCommands is an EntityCommandBuffer and requires an EntityManager to call Playback. Playback will be called after the OnUpdate on ComponentSystems.

    When in a ComponentSystem, your are locking the main thread. Calling the same sync point will have no effect after the first time because there is nothing scheduling new jobs (unless you are explicit doing it).

    Entities.ForEach uses EntityQuery. If you don't specify one, it will create one based on your parameters. There is no difference here.

    The problem with PostUpdateCommands vs EntityManager in Entities.ForEach wasn't sync point but structural changes. An structural change (create/destroy entities, add/remove components, changing shared components etc) invalidate your access to the data. So you need to use PostUpdateCommands or store your actions to be processed later.

    Just a heads up, AddBuffer before an structural change will invalidate your buffer. Here you will need to call GetBuffer after the structural change or still use PostUpdateCommands.

    []'s
     
    Opeth001 likes this.
  18. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,116
    awesome explanation, Thank you!
    but what happens if all CD needed are ReadOnly ? does the ComponentSystem still create Sync points ?
    if yes, do you think it will be a nice workarround if we create JobComponentSystems just to read data From EntityQueries ?
     
  19. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,759
    Well you can't use Entities.ForEach in JobComponentSystems

    However it doesn't matter really anyway. PostUpdateCommand just created a sync point at end of the ComponentSystem, whereas using an EntityManager will just create the sync point in the middle of the system. Unless your system is extremely heavy (in which case you're screwed on main thread performance so you should be doing something else anyway) the difference is going to be minimal syncing in middle vs end.

    If you care about performance, the actual solution is to just use jobs and not using Entities.ForEach at all or at the very least use batch operations.
     
  20. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,116
    i'm Confused :p this is not what @elcionap said.
    he said:
    When in a ComponentSystem, your are locking the main thread. Calling the same sync point will have no effect after the first time because there is nothing scheduling new jobs (unless you are explicit doing it).


    i still can use the Query.ToComponentDataArray to iterate over my Components, i think it's even possible to deffer some commands to a later System.
     
  21. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,759
    I don't see any contradiction.

    If you have a sync point, and then another sync point then the second sync point does nothing as you've already synced all the threads.

    ComponentSystem syncs all job dependencies as soon as Update is called. As far as I'm aware, though I've never tested, it'll only sync job chains that are required by the component system, it won't necessarily sync all jobs.

    ComponentSystem.Update (before OnUpdate) -> Sync point
    EntityManager.DoAnything (during OnUpdate) -> Sync point
    PostUpdateCommands (after OnUpdate) -> Sync point
     
    Opeth001 likes this.
  22. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,116
    i see now ^_^
    Thank you i got it!