3 ms·
I don't think the idea is difficult actually. What I've found difficult when I decided to implement my own tool (https://github.com/skypjack/entt https://github
by skypjack 8y ago
I don't think the idea is difficult actually. What I've found difficult when I decided to implement my own tool (https://github.com/skypjack/entt https://github.com/skypjack/entt) was that technical details on how to design something that was both easy to use and with good performance were scattered all around the web. I'm just trying to summarize what I've discovered so far for the "future me". :-)
- ah- 8y agoSadly the article doesn't mention how ECS typically solve the "holes" problem, where your arrays might be quite sparse which leads to inefficiency. Do you happen to know how that's usually done?
- skypjack 8y agoYeah, I'm the author of EnTT C++ ECS (https://github.com/skypjack/entt https://github.com/skypjack/entt) and I can guarantee you there are no holes there. :-) The next post (part 2 of the series) will be more or less all about this point. I hope to publish it as soon as possible. The idea is exactly to guide the reader through different models, from the easiest to implement to the ones that are probably hardest to develop but have no holes, perfect matches, higher performance and so on. Stay tuned.
- fenomas 8y agoIn my ECS I do this by storing the actual data in a dense array, alongside a hash that maps entity IDs to array indexes. If you want to see the (javascript) innards: https://github.com/andyhall/ent-comp https://github.com/andyhall/ent-comp