Simulation runs in fixed steps of 1/50 s (50 steps a second) instead of 1/20 s, with at most twelve catch-up steps in one frame

This commit is contained in:
Richard Zink committed 2026-11-04 10:04:44 +01:00
1 parent dd4bb75b24
commit 35ddfa134c
4 files changed
+9 -9

No files matched your search

+2 -2
View File
@@ -605,9 +605,9 @@ fn hint_times() -> [f32; 32] {
// every simulation step has the same length: on every client of a match the same commands are
// applied and then the same number of steps runs, so the worlds stay identical
pub const STEP: f32 = 0.05;
pub const STEP: f32 = 1.0 / 50.0; // 50 steps a second
// one frame never runs away into the future (a lagging tab catches up at most this much)
const MAX_STEPS_PER_FRAME: usize = 4;
const MAX_STEPS_PER_FRAME: usize = 12;
// torch on a wall face: wall tile + direction (index into DIR4) towards the open side
#[derive(Clone, Copy, PartialEq, Serialize, Deserialize)]