feat(simulation): add tick rate scaling system

Replace binary paused flag with TickRate enum (Full/Half/Paused)
per D-052. Full rate advances every frame, Half every 2 frames
via fractional accumulation, Paused blocks all advances. Add
SetTickRate player action for client-driven rate changes.
Implements ticket #406.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-12 19:48:43 +01:00
co-authored by Claude Opus 4.6
parent ad55dfaa72
commit 5afea99622
3 changed files with 132 additions and 67 deletions
+2 -2
View File
@@ -260,7 +260,7 @@ mod tests {
world.insert_resource(thresholds);
// Tick 7: not a multiple of 10, decay should NOT run
world.insert_resource(SimulationTime { tick: 7, paused: false });
world.insert_resource({ let mut t = SimulationTime::default(); t.tick = 7; t });
let mut schedule = bevy_ecs::schedule::Schedule::default();
schedule.add_systems(decay_knowledge);
schedule.run(&mut world);
@@ -273,7 +273,7 @@ mod tests {
);
// Tick 10: multiple of 10, decay SHOULD run (age = 10 > decay_after = 5)
world.insert_resource(SimulationTime { tick: 10, paused: false });
world.insert_resource({ let mut t = SimulationTime::default(); t.tick = 10; t });
let mut schedule2 = bevy_ecs::schedule::Schedule::default();
schedule2.add_systems(decay_knowledge);
schedule2.run(&mut world);