diff --git a/include/game/entity.hpp b/include/game/entity.hpp index 74b1c1c1..27e47712 100644 --- a/include/game/entity.hpp +++ b/include/game/entity.hpp @@ -93,7 +93,9 @@ public: float impliedVX = (destX - fromX) / durationSec; float impliedVY = (destY - fromY) / durationSec; float impliedVZ = (destZ - fromZ) / durationSec; - // Exponentially smooth velocity so jittery packet timing doesn't snap speed. + // Exponential moving average on velocity — 65% new sample, 35% previous. + // Smooths out jitter from irregular server update intervals (~200-600ms) + // without introducing visible lag on direction changes. const float alpha = 0.65f; velX_ = alpha * impliedVX + (1.0f - alpha) * velX_; velY_ = alpha * impliedVY + (1.0f - alpha) * velY_; diff --git a/src/game/transport_manager.cpp b/src/game/transport_manager.cpp index 04284add..113dfad5 100644 --- a/src/game/transport_manager.cpp +++ b/src/game/transport_manager.cpp @@ -203,16 +203,17 @@ void TransportManager::loadPathFromNodes(uint32_t pathId, const std::vector(s.minFilter)); mix(static_cast(s.magFilter));