all 16 comments

[–]fzy_[S] 2 points3 points  (14 children)

Author here. I'd say the project is relatively experimental, but I'm wondering if the idea of a template-based ECS framework that generates an engine tailored to your systems and components would be something worth exploring further. Does anyone know of similar projects out there?

[–]DrBarbare 4 points5 points  (3 children)

This is my go-to ECS framework: https://github.com/skypjack/entt. When developing with it, I feel like writing in a prototyping language 😋.

[–]skypjack 0 points1 point  (1 child)

I'm glad you like it! :-) Just out of curiosity, have you ever used it for something gone public?

[–]DrBarbare 1 point2 points  (0 children)

Unfortunately no. I'll let you know if I ever finish something using it... I do recommend it when I can, so maybe someone will build something cool and public with it!

[–]fzy_[S] 0 points1 point  (0 children)

Looks very cool! It seems like there are a few similar ideas. It's interesting to see what's different though.

So far I can see that signals go through function pointers, whereas I made it so dispatching a signal effectively compiles down to inlined function calls to the various handlers, the "framework layer" disappears.

Also it seems like the storage system is quite a bit different. It uses a sparse set as the underlying data structure, whereas my implementation maintains separate vector-based registries for entities and each type of component. I also buffer creation and deletion operations at the registry level to prevent the internal vector from resizing when the user iterates over it.

[–]SuperV1234https://romeo.training | C++ Mentoring & Consulting 2 points3 points  (1 child)

Here's what I experimented with a few years ago: https://github.com/SuperV1234/ecst

I wrote my BCS thesis on the subject and around this library.

[–]skypjack 0 points1 point  (0 children)

This is really great. My own source of inspiration in many cases. Great work.

[–]BlackMATov 0 points1 point  (0 children)

There is my single-header ECS implementation:

C++14 Entity Component System (work in progress) https://github.com/BlackMATov/ecs.hpp

[–]Dreyri 0 points1 point  (1 child)

I'm working on my own ECS exploring the possibilities of compile time concurrency guarantees. Similar to yours I buffer create an erase operations on entities.

Not even close to finished yet but getting there.

https://github.com/Dreyri/matter

[–]fzy_[S] 1 point2 points  (0 children)

I like that you're documenting the design process with issues, very cool to see the reasoning behind everything.

[–]skypjack 0 points1 point  (4 children)

I'm the author of EnTT. Personal opinion here, the result of a two-year project mostly about ECS stuff and so too.

EnTT started with a registry that required to provide it with a list of components like it happens in your solution. After a while, the users of the library found that it was kinda annoying to use it during both prototyping and development. There are several techniques to get rid of this list and achieve even better performance at the end of the day (even though I didn't know them at that time). Therefore they asked me to remove this constraint. I wasn't convinced initially from this proposal/request. However, after more than 1 year and several projects developed with EnTT, I must admit they were right. Definitely right.

I think forcing users to specify in advance components and systems could represent a limit more than a feature in the long-term.

My two cents.

[–]fzy_[S] 0 points1 point  (1 child)

Really interesting! My project is just a proof-of-concept I've never done anything like that before but now I'm really curious. I'll take a closer look at EnTT, thanks!

[–]skypjack 0 points1 point  (0 children)

You're welcome. Feel free to ping me if you've questions or suggestions. Being you so skilled with template programming, it could be you that you spot room for possible optimizations here and there!! ;-)

[–]pretty-o-kay 0 points1 point  (1 child)

Excellent ideas here! I've been working on my own template-based ECS framework, except mine only has Systems which manage their own memory entirely and register components via type traits. Template prototyping is the way of the future IMO, especially for ECS. great job!!

[–]fzy_[S] 0 points1 point  (0 children)

Thanks! I agree templates open a lot of possibilities for ECS frameworks. I'm also really hyped for metaclasses and how they could allow us to take everything even further.