From a8fc41f6bea04cdda70bd0d78ad8c4fec9cacf4f Mon Sep 17 00:00:00 2001 From: scamiv <6170744+scamiv@users.noreply.github.com> Date: Tue, 13 Jan 2026 04:58:53 +0100 Subject: [PATCH] Refactor interpolation logic in TerritoryLayer for accurate animation timing - Adjusted the denominator calculation for interpolation to use the actual tick interval, allowing animations to scale correctly with tick speed. - Removed the previous 250ms cap that caused early animation completion at slower tick speeds, improving visual fidelity during territory transitions. --- src/client/graphics/layers/TerritoryLayer.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/graphics/layers/TerritoryLayer.ts b/src/client/graphics/layers/TerritoryLayer.ts index 22326c23a..e2be025bd 100644 --- a/src/client/graphics/layers/TerritoryLayer.ts +++ b/src/client/graphics/layers/TerritoryLayer.ts @@ -638,7 +638,9 @@ export class TerritoryLayer implements Layer { toTime = this.tickTimeMsPrev; } - const denom = Math.max(1, Math.min(250, toTime - fromTime)); + // Use the real tick interval so interpolation duration scales with tick speed. + // The previous 250ms cap caused slow tick speeds (e.g. 0.5x) to finish animations early. + const denom = Math.max(1, toTime - fromTime); const progress = Math.max(0, Math.min(1, (renderTime - fromTime) / denom)); this.lastInterpolationPair = pair;