Search Unity

Entities preview.23 package contains invalid references

Discussion in 'Entity Component System' started by snacktime, Jan 17, 2019.

  1. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    The asmdef is referencing the performance testing package, which I don't even see in the package manager. I'm assuming it probably works either in staging or with an explicit reference in the manifest, but it shouldn't just break like it's doing on a simple upgrade.
     
  2. GilCat

    GilCat

    Joined:
    Sep 21, 2013
    Posts:
    676
    I also have the same error.
    Assembly has reference to non-existent assembly 'Unity.PerformanceTesting' (Packages/com.unity.entities/Unity.Entities.PerformanceTests/Unity.Entities.PerformanceTests.asmdef)
    I've cleaned up my Library folder and the problem persists.
     
  3. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Weird, I didn't have to do anything extra myself, but I've also only tried it on 2019.1.a13 and a14.
    It is incompatible with some older dependencies but your error doesn't look like related to that.
     
  4. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    I wonder if the dependency is part of some other package that not everyone has installed?
     
  5. GilCat

    GilCat

    Joined:
    Sep 21, 2013
    Posts:
    676
    I've started an empty project in Unity 2018.3.2f1 and then added "Entities" package and i got the same error.
    Using Unity 2019.1.0.a14 all seems to be fine.
    It seems like it's and issue with Unity 2018.
     
  6. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Ya should have mentioned I'm also on the latest 2018.
     
  7. Jay-Pavlina

    Jay-Pavlina

    Joined:
    Feb 19, 2012
    Posts:
    195
    It works in 2018.3 if you add the following two entries:
    Code (CSharp):
    1. "dependencies": {
    2.     "com.unity.test-framework.performance": "0.1.50-preview",
    3.   },
    4. "testables": [
    5.     "com.unity.test-framework.performance"
    6. ]
    More info here.
     
    Deleted User and GilCat like this.
  8. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    Roughly skimmed through the diff, don't want to start a new thread so a summary maybe anyone interested

    - https://github.com/Unity-Technologies/EntityComponentSystemSamples/blob/master/ReleaseNotes.md
    - Each chunk now gains innate entity, "meta chunk entity" where you could store data per chunk
    - Chunk component get/set able from both entity (will be forwarded to its meta chunk entity) and ArchetypeChunk.
    - Chunk more accessible/less transparent via EntityManager
    -- Get chunk owning any Entity
    -- Lock the chunk
    -- Create just an empty chunk explicity
    -- Power method GetAllChunks to match with GetAllEntites
    -- Swap component data between 2 chunks with the same archetype (what if entity number does not match?)
    - New built-in system state component ChunkHeader where you can then get ArchetypeChunk via the component. This is already attached to all "meta chunk entity". It acts like Prefab/Disable component where if you don't say you want it you will not get a match at all. So you can for example use IJPCD to process meta chunk entity instead of normal entity by including ChunkHeader in the CG generic, they will come out from hidden. (apparently ChunkHeader also provide civilized serialization)
    - Something about singleton data per system
    - I see ForEach syntax as demoed in Unite but surprised it is not in the official patch note. (is it usable?)
    - MoveEntities from the other world now able to move to native array instead of pouring into an another world. (what about remapping? because remap works because you used to provide it 2 EMs)
    - Mass add/remove component to all things matching a ComponentGroup
    - Chunk header structure changed, maybe fixed the cross-architecture deserialize problem
    - AddJobHandleForProducer public, can make the barrier wait for job manually without [Inject]
    - Tiny mode code added throughout
    - Each entity can be named for debugging purpose using EntityManager.Get/SetName
    - String as struct NativeString of various length
    - Code generators for IJPCD / ForEach syntax
    - Something about game object conversion
    - Get/Has SCD for ArchetypeChunk (what happen if used in a job?)
    - Get managed object from ArchetypeChunk without help from EntityManager
    - Query Any/All/None left empty will become Array.Empty instead of null
    - CG -> ACA -> To-prefixed linearized component array methods without having to iterate through chunks. This is a copy not a mirror of database like chunk."Get"NativeArray.
    -- CG -> Entity array, previously must do combo CG -> ACA -> ( AC + ACET -> EA )*chunks
    -- CG -> NativeArray<IComponentDataType>
    - Type hashing change
    - Chunk DidChange now has the same function as DidAddOrChange was, then the latter removed.
     
    Last edited: Jan 20, 2019
  9. JooleanLogic

    JooleanLogic

    Joined:
    Mar 1, 2018
    Posts:
    447
    Thanks Jay

    Could you elaborate what this means?
    Do you know how this works? I see there is new ComponentGroup.ToEntityArray and ComponentGroup.ToComponentDataArray<T>() which returns NativeArray but I don't get how this handles multiple chunks. Or is it a replacement for GetComponentDataArray and NativeArray now does cross chunk magic like that did?
     
  10. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    (I did not update and use the package yet) Similar to the previous CreateArchetypeChunkArray where it schedule and complete a stealth job to "gather" things for you this one goes a step further. It has a new job (IJobChunk) which take chunks from ACA to iterate and collect stuff to a NativeArray new-ed from inside.

    How it collect stuff uses MemCpy, it is an unsafe job in a new file ChunkDataGatherJob.cs. That means the returned array is a duplicated data not the same data in ECS database (so cannot edit content and expect it to change the real data) and you will have to release it (as opposed to NA from chunk.GetNativeArray that you should not release) So probably bad for general usage and you better do the normal chunk iteration for data processing. But in situation that you want to invalidate mid-chunk iteration it might be handy. I guess that's the meaning of ToComponentDataArray,ToEntityArray To = copy?
     
    Last edited: Jan 18, 2019
  11. JooleanLogic

    JooleanLogic

    Joined:
    Mar 1, 2018
    Posts:
    447
    Ah thanks 5argon. That occurred to me but I couldn't fathom the point of it. I'm sure there are use cases for it though.
     
  12. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,759
    They made this consistent as well which I requested a while back, depreciated DynamicBuffer.ToNativeArray() and renamed it to AsNativeArray().
     
    5argon likes this.
  13. JooleanLogic

    JooleanLogic

    Joined:
    Mar 1, 2018
    Posts:
    447
    Oops yes I missed that naming part. I'm not used to such convention so wasn't obvious to me. I just read that as it's converting the component data To a NativeArray as in wrapping it, not copying it.
    To and As is probably good convention but it's still GetNativeArray() in ArchetypeChunk.
     
  14. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    AC ones being still "Get" is correct as the NA returned is a mirror to the real stored data and hence no copy + changes write back to the data do reflects to the database (NA allowed you to only if isReadOnly:false at ACCT). Also the reason you cannot Dispose that NA from AC because you would be disposing the real data if that is allowed.
     
  15. JooleanLogic

    JooleanLogic

    Joined:
    Mar 1, 2018
    Posts:
    447
    I was referring to Tertles example where DynamicBuffer.AsNativeArray is doing the same thing as ArchetypeChunk.GetNativeArray. They both return NativeArray wrappers to the real data.
    But I can see that there's still a semantic difference between 'As' and 'Get' anyway so ArchetypeChunk.GetNativeArray makes sense.
     
  16. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,684
    This is correct semantic, and you right, they are different meaning, even if they do closest things. In buffer case you “represents buffer itself, AS native array”, in chunk case you “GET some native array from chunk” you not represent chunk AS native array, you get some part of data in this chunk :)
     
    5argon likes this.
  17. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    543
    Thanks for the info. This is very bad. I've removed most of the packages I didn't need and now I'm adding them again. Hopefully this will be removed again in a future release.