junkdog / artemis-odb

A continuation of the popular Artemis ECS framework
BSD 2-Clause "Simplified" License
777 stars 112 forks source link

[FEATURE] Migrate to pure ECS #647

Open genaray opened 3 years ago

genaray commented 3 years ago

Artemis should make use of the full ecs approach. This way we could save a lot of memory and increase the performance. Currently the EntityManager still holds a list of "Entity"'s. So every single created entity allocs a new entity object which is a waste of resources. Especially if the user dont want that.

My two cents, we should replace the Bag<Entity> with a traditional IntBag to store the entities. On top of that we could still construct the Entity class if the user wants to really, really make use of it.

This way we could improve the ram usage and still keep the Entity class for those who want to use it.

DaanVanYperen commented 2 years ago

For desktop users the impact would probably be minimal, except for extreme use-cases. Can't say if it's worth it to fix for other platforms.

There's a couple of managers that still lean on entities also. https://github.com/junkdog/artemis-odb/issues/456

We PoC-ed this in 2017 (see PR https://github.com/junkdog/artemis-odb/pull/499), might contain some salvageable ideas if anyone decides to fork.