3 ms·
Hah, this reminds me a lot of ECS (Entity-Component-System) architectures [1] The first time I read about ECS I thought it was a completely crazy idea, but aft
by ratww 7y ago
Hah, this reminds me a lot of ECS (Entity-Component-System) architectures [1]
The first time I read about ECS I thought it was a completely crazy idea, but after trying it I realized that I was able to have extreme low-coupling and complete separation of concerns. It was great for hacking things, but in the long term it was also great for maintenance and code reuse! I never felt this way about OOP, ever.
In this case however it seems that the "Entity Management" part is ad-hoc, with Editors themselves putting things on the dictionaries. Ooops :)
EDIT: I think one can get a lot of mileage out of something like this if the dictionary management code is properly encapsulated in an isolated module/class. Just an idea.
[1] https://en.wikipedia.org/wiki/Entity_component_system https://en.wikipedia.org/wiki/Entity_component_system
- gitgud 7y agoWow, that's a brilliant way to manage and scale a complex application. I guess game software is kind of at the forefront of software architecture ...
- TeMPOraL 7y agoECS is a hodge-podge of concepts, each implementation mixing in different proportions some or all of the following: relational data model, data-oriented architecture, flexible recombination at runtime, removing the fixed inheritance graph, cache-friendly flow. What's in the article is really closer to "relational data model" than all of these above. All these dictionaries are essentially implementing SQL selects. The "relational data model" lens to viewing ECS is that it's essentially giving each component its own table, and doing plenty of joins. I find this really interesting, and my current side project is a roguelike game that focuses only on that part - relegating all game ECS into an in-memory SQLite database. I decided to go that way after trying to improve my last attempt at an ECS framework, only to realize I'm essentially hand-coding SQL indexes, and that's not something I want to do when I'm prototyping a game.
- atroche 7y agoThat's very cool. It reminds me of a game someone built with DataScript (an in-memory relational data store based on Datomic): http://www.zetawar.com/blog/2016/05/17/technology-choices/ http://www.zetawar.com/blog/2016/05/17/technology-choices/
- kd5bjo 7y agoThey both are bringing concepts from relational algebra/databases into memory management for globals, but different parts: An ECS is fundamentally a column store for one really wide table. It’s optimized for performing batch operations on sparsely-populated columns in that table. This is more like defining a database index: these dictionaries are using some kind of computed result as the key, allowing you to lookup objects by this result without a linear scan through all relevant objects.