wait hang on. why does ECS always use bare arrays for holding structs? that makes the bookkeeping way more difficult. wouldn't it be easier to use a simple array based hash table, so that every entity can simply store their data using their ID as the key?

that way iterating over all the values in the table is still fast and cache coherent (it's still just an array) but all the bookkeeping becomes way less complex. no more need for archetypes, just have one hash table per struct and if an entity doesn't have that component, it's as simple as just not adding it to the table

... am i missing something here? O_o i feel like i'm missing something obvious

@eniko I think that is how ECS often stores structs in a few implementations.
@boggo oh i thought they all did the thing where they have one tightly packed struct of arrays per archetype (combination of components)
@eniko Well that definitely sounds more efficient to me as even if you just used a simple array hash table you'd eventually have quite a bit of fragmentation without having a really big table. But you can probably still use some sort of indirection table. I'm far from an expert on it though.