Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Broken baker with entities 1.0

Discussion in 'Entity Component System' started by instriker_911, Nov 24, 2022.

  1. instriker_911

    instriker_911

    Joined:
    Mar 31, 2022
    Posts:
    27
    Hi.

    I got a strange behavior using the new baking system in 1.0.

    The behavior was that my expected components where missing at runtime. After a bit of investigation, it seems that there are issues with the CreateEntityForGameObject in the BakedEntityData.cs, where the entity created do not match the expected one. In my case, Ithe CreateEntityForGameObject is returing a SystemInstance component:

    upload_2022-11-24_7-50-4.png

    I can reproduce this issue in only one of my subscenes. It was working until what seems until some unrelated changes (adding a single string field on an existing component).

    It looks like a kind of caching issue, so I tried to to Clear the Entity cache without successes.

    A bit more investigation show me that it's the EntityManager.CreateEntity that seems to do the wrong job. You can see below that the returned entity do not match the passed archetype:

    upload_2022-11-24_8-0-13.png

    Any other ideas of what can happen and what to do as a workaround?

    For reference, here are the versions i'm using:

     
  2. instriker_911

    instriker_911

    Joined:
    Mar 31, 2022
    Posts:
    27
    OK after some investigation, the issue is not what it seem:
    SO, for this bug, it seems to be debugging issue only where some process do the correct work after the end of the baking process, but the memory is most likely not cleaned at that point, which give great confusion while debugging.