From 1fbd66095ce56af8e0e86636ebdd01aa49b5aec3 Mon Sep 17 00:00:00 2001 From: MelekTaus Moribundus Date: Mon, 6 Jul 2026 22:36:59 +0200 Subject: [PATCH] Radar ping: anchor sweeps to seek start so they stay in sync with the HUD RunSeekPhase fired the interval ping from an accumulating countdown that discarded each cycle's frame overshoot and drifted seconds late over a match, while the HUD ping countdown is anchored absolutely to _seekStartTime. Fire on absolute interval boundaries (n*interval from _seekStartTime) instead, sharing the HUD's anchor so the on-screen timer hits 0:00 the same moment the sweep fires. A missed boundary is skipped, never bursted. Co-Authored-By: Claude Opus 4.8 --- Assets/Scripts/Network/MatchManager.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/Network/MatchManager.cs b/Assets/Scripts/Network/MatchManager.cs index 906a7bf..8210a95 100644 --- a/Assets/Scripts/Network/MatchManager.cs +++ b/Assets/Scripts/Network/MatchManager.cs @@ -704,7 +704,7 @@ public class MatchManager : MonoBehaviour { _skipPhase = false; // drop a stale debug-skip from the previous phase; only this phase may set it float t = seconds; - float pingTimer = radarPingInterval; // first sweep one interval into Seek + int pingsSent = 0; // sweeps fired so far; boundaries anchored to _seekStartTime (the HUD's ping anchor) while (t > 0f) { if (_pendingHiders.Count == 0) yield break; @@ -712,11 +712,16 @@ public class MatchManager : MonoBehaviour if (radarPingInterval > 0f) { - pingTimer -= Time.deltaTime; - if (pingTimer <= 0f) + // Fire on absolute interval boundaries from Seek start (n*interval), sharing the exact anchor the + // HUD countdown uses (LocalNextPingIn's modulo) - so the on-screen ping timer hits 0:00 the same + // moment the sweep fires. An accumulating countdown would discard each cycle's overshoot and drift + // seconds late over a match (worse with frame spikes). A missed boundary (huge hitch) is skipped, + // not caught up - one late sweep, never a burst. + int due = Mathf.FloorToInt((Time.time - _seekStartTime) / radarPingInterval); + if (due > pingsSent) { BroadcastRadarPings(); - pingTimer = radarPingInterval; + pingsSent = due; } }