MineInAbyss / geary

ECS framework made for Kotlin
https://docs.mineinabyss.com/geary/
MIT License
49 stars 11 forks source link

feat(engine): Archetype garbage collection #68

Closed 0ffz closed 5 months ago

0ffz commented 2 years ago

Our use of relations and events means at all times, there are far more archetypes than entities, somewhat defeating the purpose of an archetypal ECS.

No archetypes

Archetypes as a temporary cache

Archetypes as a permanent cache

0ffz commented 5 months ago

Pretty much the Archetypes as a temporary cache idea was implemented a while back to remove empty archetypes by default, optionally letting you mark archetypes to keep.

I'm questioning whether the extra code to maintain is worth it especially if we ever get archetypes to hold multiple added component types (i.e. only batching components with data) since this would solve the overhead with relations.