Search Unity

Feedback Request more control to Archetype

Discussion in 'Entity Component System' started by optimise, Apr 19, 2019.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Since keep changing Archetype is expensive, I think it should have the following 2 features to mitigate this problem:

    1) Add an API to map entity to a specified Archetype to avoid keep creating and destroy Archetype. Let's say u map an entity to ArchetypeX that has ComponentA, ComponentB and ComponentC. When you add ComponentA to the entity, it will still stay at ArchetypeX without creating new Archetype and move the entity to that Archetype.

    2) Add an API to set to always keep specified Archetype so even all the entities is no longer available, Archetype will still keep at there. This will prevent the Archetype from destroy and need to create the same Archetype again when the entity is created.
     
    JesOb and NotaNaN like this.