4 ms·
Where is the E? I only see the C and S. This also seems to be limited to components whose only useful data structure is an array and systems who only loop over
by charcircuit 3y ago
Where is the E? I only see the C and S. This also seems to be limited to components whose only useful data structure is an array and systems who only loop over the entire array.
- deleted 3y ago[deleted]
- qsort 3y agoArray-of-structs vs. struct-of-arrays is a well-known tradeoff that pops up very often, e.g. in row-oriented vs. column-oriented databases. If for your specific usage pattern, whatever it is, looping over entire "columns" is more common than insertions and deletions, then you're likely to benefit from this pattern due to locality, even though the theoretical complexity is the same.
- wegfawefgawefg 3y agoi think he just means the example code defines components, but doesnt have a entity modification code with queries and stuff. im pretty used to existing ecs libs and they all let you add entities as collections of components and do queries. without that, this is just a collection of structs
- deleted 3y ago[deleted]
- mort96 3y agoAn entity is a tuple of indexes into component arrays. Components aren't arrays, components are stored in arrays.