From 423ff61e35dd0372f2cd5a4ede40e500f13f7913 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 d638b1796..340638140 100644 --- a/src/client/graphics/layers/TerritoryLayer.ts +++ b/src/client/graphics/layers/TerritoryLayer.ts @@ -632,7 +632,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;