Search Unity

Is there a data/entity storage system for none active data?

Discussion in 'Entity Component System' started by Arowx, Nov 29, 2018.

  1. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Some aspects of games require none active data.

    What is the best way to store data in a format that can be easily converted into active entities/chunks?

    It seems that storing inactive data in a format/pattern that is easily activated into chunks would be ideal.
     
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    I don't think individual entity / chunk serialization is implemented yet but is probably coming at some point.

    For now, you'd probably just do something like create an 'InactiveTag' component on entities and subtract it from queries/jobs to ignore entities.
     
  3. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    How about attaching the built in Disabled IComponentData so no one can get it?
     
  4. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    Oh for some reason i thought Disabled had been removed. It has not, that is good to know.

    I was basically suggesting replicating that behaviour, but it's much easier to just use that component.
     
  5. SubPixelPerfect

    SubPixelPerfect

    Joined:
    Oct 14, 2015
    Posts:
    224
    I wonder how to enable disabled entities... how to remove
    Disabled
    component if all systems ignore it...
     
  6. julian-moschuering

    julian-moschuering

    Joined:
    Apr 15, 2014
    Posts:
    529
    Explicitly querying them still works. Eg an query having Disabled in the All list will return disabled chunks.
     
    eizenhorn and SubPixelPerfect like this.