Add lifetime component to entities by default #14

Open
opened 2026-05-27 23:37:07 +00:00 by larssonmartin1998 · 0 comments

This is just an idea for now.

But since were doing batched updates of all operations, meaning we delay destructions of entities, a system could run with an entitty that is queued for destruction and run updates on it expecting behavioral changes and even pass events using that entity.

This is my first idea to stop this behavior without introducing cache breaking or ideology breaking flow.

Have a default Lifetime Component added to ALL entities that contains state such as QueuedForDestruction which the systems can query for and check. It would then also be used internally with the event system and destroy functionality etc. More states could be added as needed in the future.

This goes very well with the native workflows of the ECS.

This is just an idea for now. But since were doing batched updates of all operations, meaning we delay destructions of entities, a system could run with an entitty that is queued for destruction and run updates on it expecting behavioral changes and even pass events using that entity. This is my first idea to stop this behavior without introducing cache breaking or ideology breaking flow. Have a default Lifetime Component added to ALL entities that contains state such as `QueuedForDestruction` which the systems can query for and check. It would then also be used internally with the event system and destroy functionality etc. More states could be added as needed in the future. This goes very well with the native workflows of the ECS.
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
larssonmartin1998/atlas#14
No description provided.