3 ms·
I spent quite a lot of time exploring ECS before building my own ECS library for developing 2D games. I have found that with my (minuscule) ECS library it great
by joeyjojo 9y ago
I spent quite a lot of time exploring ECS before building my own ECS library for developing 2D games. I have found that with my (minuscule) ECS library it greatly alleviates just about all of the issues I was facing with normal OOP. Everything scales extremely well, the code is almost crystal clear, and it makes code structure very simple. I'm not sure how you could effectively apply ECS outside of simulation style applications but I'm interested to see what influence it has in other domains such as UI.
- _pmf_ 9y agoIt's strange that ECSs only have traction in game development. I agree with all the advantages you mentioned, but additionally, they solve the structure-of-arrays/array-of-structures performance discrepancy; this is something Jon Blow is working on with his Jai language. > I spent quite a lot of time exploring ECS before building my own ECS library for developing 2D games. Is it publicly available?
- joeyjojo 9y agoIt is available on Github: https://github.com/jackwlee01/Easy-ECS https://github.com/jackwlee01/Easy-ECS It is an AS3 library that I use for my Adobe Air games.
- fuwafuwa 9y agoWell, of course ECS does that. It's ultimately the same approach to data as a normalized relational schema. It's a bit of upfront work but the flexibility of processing and optimization is awesome. For UI the issue is one of expressing lightweight dependencies, which may be detached and recombined easily. I am currently exploring an approach that combines "imgui" concepts with hierarchical path data, akin to the hard and symbolic links in Unix. Having the path as data allows assemblages of partial routes to be combined to express a "final" data point. The data itself may not entirely exist in a physical tree structure but instead be a combination of procedural data, stored data, and a parser.
- nikki93 9y agoThe extreme version of an ECS is an EAV: https://en.m.wikipedia.org/wiki/Entity–attribute–value_model https://en.m.wikipedia.org/wiki/Entity–attribute–value_model When you further qualify by time/transaction you get EAVT like Datomic and then just do queries (potentially recursive), and can implement semantics like "classes" over it.