6 ms·
Put some CLOS in your ECS
- politelemon 3y agoEntity Component System, not Amazon's Elastic Container Service, if you were confused like me. It's a pattern used in game dev: https://en.wikipedia.org/wiki/Entity_component_system https://en.wikipedia.org/wiki/Entity_component_system
- charcircuit 3y agoWhere 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.
- brabel 3y agoWhere is the code for the with-component* macro and for the metaclass object?? That would be the most interesting part of this post!