ECS: Low priority and scheduled tasks #812

Merged
SakulFlee merged 7 commits from feat/ecs_schedule into main 2026-09-30 03:08:03 +00:00
Owner
No description provided.
Systems can now declare a desired_interval() (default None = every tick).
The Schedule owns the bookkeeping: run_with_time(world, now_secs) only
executes a throttled system once its interval has elapsed since the last
run, always on the first tick, and at most once per call — missed ticks
after a stall are dropped, never replayed.

API:
- Schedule::add_system_with_interval / add_low_priority_system (1s)
- Schedule::add_system_boxed_with_interval
- with_interval / low_priority wrappers for Module::setup-returned systems
- Schedule::run unchanged: ignores intervals, runs everything (tests)

Only due systems participate in conflict batching.
game_schedule.run_with_time(now) replaces game_schedule.run(now) after
the core schedule has accumulated TotalTime, giving low-priority systems
their clock. Fallback to 0.0 if the resource is missing.
Demonstrates low-priority (1 Hz), explicit 250 ms interval, a boxed
with_interval system, and a normal per-frame system, all driven by
run_with_time over a simulated 10 FPS loop.
style: rustfmt interval scheduling code
Some checks failed
Lint / lint (pull_request) Has been cancelled
e7a815edee
Author
Owner

Closes #813

Closes #813
Author
Owner

Closes #814

Closes #814
Merge branch 'main' into feat/ecs_schedule
Some checks failed
Lint / lint (pull_request) Failing after 26m43s
26deeb2723
Merge branch 'main' into feat/ecs_schedule
All checks were successful
Lint / lint (pull_request) Successful in 4m27s
d0ed41f8a6
SakulFlee deleted branch feat/ecs_schedule 2026-09-30 03:08:03 +00:00
Sign in to join this conversation.
No description provided.