Skip to content
This repository was archived by the owner on Jun 28, 2026. It is now read-only.

Add StaggeredUpdateTracker for tick spreading#23

Closed
Illiux wants to merge 4 commits into
Space-Wizards-Federation:masterfrom
Illiux:staggered-update
Closed

Add StaggeredUpdateTracker for tick spreading#23
Illiux wants to merge 4 commits into
Space-Wizards-Federation:masterfrom
Illiux:staggered-update

Conversation

@Illiux

@Illiux Illiux commented Jun 17, 2026

Copy link
Copy Markdown

Add an entity system helper designed to be used where a component is updated on a regular interval greater than one
tick, with updates intended to be spread across multiple ticks. This is intended to replace several places today where
content records a next update field on a component, then iterates all entities every tick checking to see if it is time
to update that component.

The implementation in this commit efficiently keeps a sorted schedule of updates and allows the entities due to update
(and only those entities) to be enumerated in amortized constant time for each. Removed components are handled lazily,
and new components are handled via a priority queue. The schedule itself is implemented as a ring buffer.

A limitation of the approach is that the update interval cannot vary across individual instances of tracked components.

Illiux added 4 commits June 11, 2026 20:27
Add an entity system helper designed to be used where a component is updated on a regular interval greater than one
tick, with updates intended to be spread across multiple ticks. This is intended to replace several places today where
content records a next update field on a component, then iterates all entities every tick checking to see if it is time
to update that component.

The implementation in this commit efficiently keeps a sorted schedule of updates and allows the entities due to update
(and only those entities) to be enumerated in amortized constant time for each. Removed components are handled lazily,
and new components are handled via a priority queue. The schedule itself is implemented as a ring buffer.

A limitation of the approach is that the update interval cannot vary across individual instances of tracked components.
@Illiux Illiux requested a review from DrSmugleaf as a code owner June 17, 2026 04:49
@Illiux Illiux closed this by deleting the head repository Jun 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants