I've read some articles about Entity Component System and I like this idea of "entities" having lots of "components" to define them, so I tried to implement it. Here is an simple overview of what i've got so far:
Also, each entity keeps tack of all components it has with a bitset
So in the final result, each index of all component containers belongs to an entity
I know that this causes a problem than, not all entities have all components, so it causes a waste of space... But for now, I can (saldy) live with it
But the real issue for me here is that some components will have same data, and if each entity have a component for that data, this data will be duplicated unnecessary
Even worst, it would require OpenGL to have different objects in memory that are exactly equal and having to enable those objects and disable them many times is not desirable at all.
I've been scratching my head to figure out a solution for this issue but I can't find any. Could someone give me an advice please?
If you've read this far, Thank You!