5 ms·
ECS is less about access patterns (relationships and queries) and more about efficient storage. Games care about page faults still so making your tight loop exe
by gravypod 5y ago
ECS is less about access patterns (relationships and queries) and more about efficient storage. Games care about page faults still so making your tight loop execute quickly on many smaller pieces of data and "do the right thing" is a win. Also, from an architectural perspective it's easier to write abstract code like `Health.value -= 10` instead of PlayerHealth.value -= 10`. By coding against a single components interface you can get consistent behavior across all entities with that component. You could also do this with inheritance but that becomes complex and (the real killer) very slow. jblow has some rants about this in the witness.
- fault1 5y agoSome compilers also use the ECS "pattern" quite heavily. Case in point: rustc: https://www.youtube.com/watch?v=N6b44kMS6OM&t=1263s https://www.youtube.com/watch?v=N6b44kMS6OM&t=1263s