From f072c162449401180fa54a50f39aeaeea660297d Mon Sep 17 00:00:00 2001 From: WiseDev <83840010+wisedevik@users.noreply.github.com> Date: Sun, 23 Aug 2026 16:34:07 +0300 Subject: [PATCH] make the snapshot interval settable to test the model theory two results this round, both negative and both useful. the account ids are right end to end, so isOwnedByBottomPlayer picks the branch it should. and every character row carries the export names it needs - knight, goblin and barbarian all have a filename, a blue and a red prefix and UseAnimator set - so neither "empty prefix" nor "wrong row" survives. Debugger::error is __noreturn, and the client does not abort, so Character::Character is not failing to build animations either: reached, it works. with the checksum agreeing byte for byte, the objects in the client are identical to ours. that leaves only the sprite never being made, or being made and torn down again - and every push re-runs decode, which destroys whatever it cannot match. five times a second nothing would ever be seen. SCROLL_SNAPSHOT_INTERVAL_TICKS widens the gap so one run can tell. --- crates/game-service/src/battle_session.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/game-service/src/battle_session.rs b/crates/game-service/src/battle_session.rs index 17c74c9..4e11cee 100644 --- a/crates/game-service/src/battle_session.rs +++ b/crates/game-service/src/battle_session.rs @@ -1,6 +1,13 @@ use std::collections::HashMap; use std::sync::Arc; pub const SNAPSHOT_INTERVAL_TICKS: i32 = 4; +pub fn snapshot_interval_ticks() -> i32 { + std::env::var("SCROLL_SNAPSHOT_INTERVAL_TICKS") + .ok() + .and_then(|value| value.parse::().ok()) + .filter(|ticks| *ticks > 0) + .unwrap_or(SNAPSHOT_INTERVAL_TICKS) +} pub const MAX_CATCH_UP_TICKS: i32 = 40; use std::time::Instant; use logic::battle::{ @@ -51,7 +58,7 @@ impl BattleSession { random, taunts, next_bot_emote, - next_snapshot: SNAPSHOT_INTERVAL_TICKS, + next_snapshot: snapshot_interval_ticks(), next_bot_play: crate::bot::BOT_OPENING_DELAY_SECONDS * BATTLE_TICKS_PER_SECOND, pushed_snapshots: 0, next_instance: first_instance, @@ -256,7 +263,7 @@ impl BattleSession { self.release_queued(self.tick); self.mode.battle.tick(self.tick); if self.pushes_snapshots() && self.tick >= self.next_snapshot { - self.next_snapshot = self.tick + SNAPSHOT_INTERVAL_TICKS; + self.next_snapshot = self.tick + snapshot_interval_ticks(); if let Some(message) = self.snapshot_message() { self.pushed_snapshots += 1; self.outbound.push(message);