Replies: 1 comment 4 replies
-
The arrays are dense. The order of components inside them depends on the order in which the corresponding entities are inserted into/removed from the given table: inserting a new entity puts it at the end of the dense array, while removing it will result in moving the last element of the dense array in its place. Note these operation can also happen when components are inserted/removed, since that will change the entity's table which is equivalent to removing the entity from the old table and inserting it in the new one. In general I would suggest you not to try to rely on the order components are stored in tables, as this can change very easily under your nose. The current order is also an implementation detail and may change in the future. |
Beta Was this translation helpful? Give feedback.
-
I can't really understand how components and entities are store when i use table storage. I have seen that the table is saved like a stucture of array, where each array saves a type of components. But i can't understand if it is a sparse array or a dense array, so i can't understand if there are some unused components between the used components.
If it is a dense array, i can't understand in what order they are stored in each buffer. Is it possible to get more information about that?
Beta Was this translation helpful? Give feedback.
All reactions