Ukendio / jecs

A fast, portable Entity Component System for Luau
https://ukendio.github.io/jecs/
MIT License
121 stars 20 forks source link

Entity deletion #57

Closed Ukendio closed 1 month ago

Ukendio commented 2 months ago

Deleting an entity needs to remove their data and deallocate their corresponding data. Deletion of an entity will also propagate deletions to archetypes who are its dependents as mentioned in #56.

Deleting an entity is not trivial and will scale with the number of archetypes depending on it, and it needs to be removed from the sparse set in a way that will keep the dense array tightly packed. This will require cycling entity ids with generations in mind and some liveliness check for each entity operation.

Ukendio commented 1 month ago

Resolved in https://github.com/Ukendio/jecs/commit/735eb0152664f550be613f8299b1bc5ca1252e76