4 ms·
The talk presents a fairly simplified version of what game engines actually do. Components that are only used by a minority of entities can be kept in a map. T
by djur 8y ago
The talk presents a fairly simplified version of what game engines actually do.
Components that are only used by a minority of entities can be kept in a map. The talk refers to `specs`, which is an ECS system implemented in Rust. It allows you to use different backends (a vector, a couple types of map, etc.) and it uses bitsets to optimize determining which entities have which components: https://slide-rs.github.io/specs/05_storages.html https://slide-rs.github.io/specs/05_storages.html
As to why "struct of arrays" might be preferred to "array of structs", it's all about locality of data. Game Programming Patterns explains it way better than I possibly could: http://gameprogrammingpatterns.com/data-locality.html http://gameprogrammingpatterns.com/data-locality.html