Download Asahi — Minecraft Mods — MetaMods
Asahi

Asahi

Active

Downloads

0

Last update

8 months ago

Versions

1.14 — 1.21.4
Client
Fabric
Utils

Asahi - Smooth Daylight Cycle Without Jitters

A client-side Minecraft mod that eliminates unpleasant jerks and stutters of the sun during daytime changes caused by server delays!

If you ask for forge I'll steal your kneecaps

What's the Problem?

Every second (20 ticks), the server sends a data packet to synchronize time between the client and server. Since the client doesn't know the server's actual performance speed, it assumes the standard 20 ticks per second. When the server runs slower due to lag, the client displays the sun ahead of its actual position on the server. Upon receiving synchronization, the vanilla client abruptly moves the sun to the correct position, creating that jerking effect that this mod fixes.

How Does the Solution Work?

We use a weighted moving average and interpolation! First, we collect data about the number of server ticks over the last 10 seconds. Since older data is less important than fresh data, we assign them exponentially decreasing weights. By calculating the average value from this weighted sample, we can accurately predict the sun's movement for the next second. The prediction error is minimal and completely unnoticeable compared to the sharp jumps in the vanilla version.

Without Asahi:

Daylight cycle without Asahi

With Asahi:

Daylight cycle with Asahi

Please note that this GIF animation was made in an earlier version of the mod - the interpolation algorithm has become even better since then!

The circular sun is part of a resource pack from vanillatweaks.net

Configuration

{
  // If the time received from the server differs from the client time by skipDuration seconds or more,
  // switch to server time, skipping interpolation.
  // Experiment with this value if the daylight cycle moves too fast.
  "skipDuration": 60,
  // Number of previous values to use in the moving average interpolation.
  // Change this value if you notice the sun oscillating heavily without stabilizing position.
  "interpolateSamples": 10,
  // Initial daylight cycle speed in ticks per game tick.
  // Increase/decrease this value if another mod speeds up/slows down the daylight cycle
  "initialFactor": 1.0,
  // Standard tick rate relative to daylight cycle resolution.
  // Change when using mods that increase/decrease standard tick rate OR daylight cycle resolution (24000 ticks).
  // To my knowledge, no such mods exist.
  "standardTickRate": 20
}
Project members
hugeblank

hugeblank

Developer

Created: 17 Aug 2023

ID: 11340