You are viewing a potentially older version of this package. View all versions.
Wubarrk-DvergrAstrolabe-0.1.0 icon

DvergrAstrolabe

Strictly server-side Valheim 1.0 mod - no client install ever. Set how many real minutes daylight and night each last; the server paces the world clock and every client follows.

Date uploaded 2 weeks ago
Version 0.1.0
Download link Wubarrk-DvergrAstrolabe-0.1.0.zip
Downloads 21
Dependency string Wubarrk-DvergrAstrolabe-0.1.0

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2350 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Preferred version: 5.4.2350

README

๐Ÿ”ญ Dvergr Astrolabe

Valheim Mod Server Side Framework Crossplay Version Valheim 1.0

Daylight and night, in real minutes, set once on the server. No client install, ever.

A vanilla Valheim day is 30 real minutes: 21 of daylight and 9 of night. Dvergr Astrolabe lets the server decide those two numbers - a lazy hour of daylight with a 5-minute night, or a 10-minute day and a 20-minute night for a horror server - and every player sees it with nothing installed on their side. Steam, Xbox, PlayFab and crossplay parties alike, because the server is the only machine that owns the world clock.


โš™๏ธ Settings

BepInEx/config/wubarrk.dvergrastrolabe.cfg on the server. Edits are picked up within 5 seconds, no restart. The defaults are vanilla, so installing the mod changes nothing until you set them.

Setting Default What it does
[2 - Day And Night] DayMinutes 21 Real minutes from sunrise to sunset: the whole stretch in which the sun is above the horizon and the game counts as day (the Day N banner fires at its start). 0.5 to 180.
[2 - Day And Night] NightMinutes 9 Real minutes from sunset to sunrise: dusk, the midnight day-counter tick and dawn. 0.5 to 180.
[3 - Client Sync] ClockPushInterval 0.5 Seconds between extra pushes of the clock to clients (vanilla pushes every 2 s). Keeps the sun moving smoothly when the rate is far from 1x. 2 adds no extra traffic.
[1 - General] Enabled true Master switch. Off = vanilla 21 + 9.
[1 - General] VerboseLogging false Log every sunrise and sunset with the day number and the rate that just took effect.

A few starting points:

Feel DayMinutes NightMinutes Full day
Vanilla 21 9 30 min
Long lazy days 45 10 55 min
Builders' server 60 5 65 min
Horror server 10 20 30 min
Quick test 1 1 2 min

๐Ÿ”ญ How it works

Every machine in a Valheim game turns one number into the time of day: the world clock, in game-seconds. Only the server advances it, and every 2 seconds it pushes the value to each client, which simply adopts it. Time of day is that clock modulo the day length, 1800 game-seconds: the stretch from 0.15 to 0.85 of each day (1260 seconds) is daylight, the remaining 540 seconds are night. That is where vanilla's 21 + 9 comes from.

The server cannot change the 1800 baked into an unmodded client. It can change how fast the clock runs. Astrolabe scales the server's clock tick to 1260 / (DayMinutes x 60) game-seconds per real second while the sun is up and 540 / (NightMinutes x 60) while it is down, switching exactly at sunrise and sunset (a tick that straddles the boundary is split so each side runs at its own rate). A day is still 1800 game-seconds, the clock still only counts up, the world save stores it unchanged. It just takes as long as you said.

Between pushes an unmodded client runs its own copy of the clock at 1x, so each push applies a small correction, which the game already smooths over about 2 seconds. Astrolabe pushes every 0.5 s by default so that correction stays under a degree of sun movement at any sane setting, at the cost of one tiny packet per client per half second.


๐Ÿ“ What changes, and what doesn't

Untouched. The day counter (it ticks at midnight, the Day N banner still appears at sunrise). Sleeping: still allowed from noon, still skips to the next sunrise in 12 real seconds. World saves. The empty-server freeze: with nobody online the clock stops exactly as in vanilla (if you run Let It Grow's time flows while empty, its tick is the scaled one, so the two agree).

Stretch with your day (they run on the game clock). Crops and trees, smelters, kilns and furnaces, cooking stations, fermenters, beehives and sap collectors, fires' fuel, item despawn, berry and pickable respawn, creature spawners, taming hunger, pregnancy and growing up, creature and tame health regeneration, trap and ballista rearm, snow damage. With a 45-minute day these still take exactly as many days as before, which now means more real minutes. With a 1-minute night, monsters regenerate health nine times faster than you are used to while it is dark.

Do not stretch (they run on the wall clock). Raids and random events, Rested, food, comfort. A longer day therefore gets more raids per game day, a shorter one fewer.

Fine print. At very long stretches (a rate under 0.2x: days over 105 minutes or nights over 45) a client-owned fire, beehive or sap collector can occasionally drop a fraction of a second of progress when a clock correction lands mid-tick; lower ClockPushInterval to 0.25 to shrink it further. The vanilla 10-game-second lockout between two sleep attempts scales with the night rate too.


๐Ÿ“ฆ Install

Server side only. Drop DvergrAstrolabe.dll into BepInEx/plugins/ on the dedicated server (for a player-hosted world, on the hosting player's game). Start it once to generate the cfg, set DayMinutes and NightMinutes, done. Nothing goes on clients; if the DLL ends up on a client by accident it does nothing.

Requires the BepInExPack for Valheim (5.4.2350). Built against the Valheim 1.0.15 dedicated server.


๐Ÿงช Checking it works

BepInEx/LogOutput.log on the server, at startup and after every config edit:

[Message:DvergrAstrolabe] schedule (startup): daylight 45 real min at 0.467x, night 10 real min at 0.9x; one full day = 55 real min (vanilla 30); clock pushed to clients every 0.5 s (plus vanilla's 2 s).
[Message:DvergrAstrolabe] clock patch live: EnvMan found, day 12, raw day-fraction 0.412 (daylight), 1 player(s) connected.

With VerboseLogging on, every transition as well:

[Info   :DvergrAstrolabe] sunset, day 12: clock at 0.9x for the next 10 real min.

A Valheim mod by Wubarrk.

CHANGELOG

Changelog

0.3.1

Package-only update: README clean-up. No functional change, the plugin DLL is identical to 0.3.0.

0.3.0

Fixed

  • Sunrise and sunset were hardcoded at vanilla's raw day-fractions 0.15 and 0.85. With a mod that moves them (Gamma of Night Lights' day/night cycle sets the night as a percentage of the day) Astrolabe paced the wrong stretch: at Gamma's 3600 / 75 the real daylight band is 900 game-seconds, but Astrolabe fitted 1260 into DayMinutes, so every rate was off by 1260/900 and the segment it treated as the long one was the short one. Found on ProximaMaxi.

Added

  • The daylight band is read from the running game. Astrolabe samples EnvMan.RescaleDayFraction (the patched version, whoever patched it) to find where the game's day begins and ends, and paces that band; the day length was already read live. Re-read every 5 seconds, at every sunrise and sunset and after a config edit, so a synced change on the other mod is picked up within seconds. Gamma sets the size and the split of the day, Astrolabe sets how long it takes in real minutes, and when both segments land on the same multiplier there is no fast-day, slow-night contrast at all: Gamma 3600 / 75 + Astrolabe 15 / 45 runs a flat 1x with a 45-minute night, 7200 / 75 + 15 / 45 a flat 2x. See Pairing with Gamma of Night Lights in the README. Detection that fails falls back to the vanilla knees and logs an error; an unmodded game detects exactly 0.15 / 0.85 and behaves as 0.2.1 did.
  • [5 - Compatibility]: BandDetection = Auto (default) or Vanilla (force the vanilla knees, the escape hatch), and BandProbeSteps (1000) for how finely the band is sampled.
  • Logging. The schedule line reports the daylight band (daylight band 900 of 3600 game-s (25%, sunrise and sunset moved by another mod)), a day cycle line is printed when the world loads and whenever the band or the day length changes, and VerboseLogging adds the two detected fractions. A warning names the setting and the number whenever a schedule implies a nominal rate at or under 0.2x (progress drift on client-owned fires, beehives and sap collectors) or fast enough that one clock push moves the sun more than a degree (about 11x at the default 0.5 s push interval). When another mod has moved the band, one note reminds you that it must be on the clients too.

0.2.1

Fixed

  • Rebuilt against Valheim 1.0.16 and re-verified (static reference check on client and dedicated server, headless 1.0.16 dedicated-server boot).

0.2.0

Fixed

  • Boats took water-impact damage under sail while the schedule was active (60-150 hull damage a minute on a Karve at a 40-minute day, with constant bobbing). Every clock push moved an unmodded client's physics water surface in a single step, and vanilla's Ship.UpdateWaterForce counts a jump like that as a slam: 10 blunt per hit, up to thirty hits a minute, whenever someone is aboard. The sun and the rendered water are smoothed; the surface boats float on is not, whatever the push interval. Found on the live server through Wonderland's boat-upkeep log.

Added

  • [4 - Boats]. The whole server's clock runs at vanilla speed while any player is within PauseRadius (64 m) of a boat under way or MooredRadius (24 m) of one at rest, where pushes change nothing; the switch is seamless. PauseFor = Ships (default), Water (also anyone over water) or Off; UnderWaySpeed and CheckInterval tune the detection. A boat docked beside a base only pauses it for someone on or beside the deck. The README's Boats section explains exactly how time behaves around boats.
  • HoldSchedule (default on) and CatchUpLimit (default 4) in [2 - Day And Night]. Every sunrise and sunset is now held to its scheduled time: after a pause near boats, a server hitch or a mid-day config edit, the rest of the segment runs faster or slower (within the limit) to land the boundary on time. A 40-minute day absorbs about 18 minutes of boating, a 5-minute night about 4. Off = fixed rates, as 0.1.0 behaved.
  • Self-verifying sunrise and sunset lines. With VerboseLogging on, each line now reports how long the segment that just ended really ran, what was scheduled, and how much of it was spent at vanilla speed near boats; every pause and resume is logged with who and which boat.
  • Boat guard self-test at startup ("boat guard ready: sector query OK ..."). If the lookup ever throws, the mod logs an error and keeps the clock at vanilla speed until restart rather than risk hulls.

0.1.0

Added

  • Day and night length in real minutes. DayMinutes (sunrise to sunset, vanilla 21) and NightMinutes (sunset to sunrise, vanilla 9) in [2 - Day And Night]. The server paces its authoritative world clock (ZNet.UpdateNetTime) at a different rate inside and outside the daylight band, so every connected client sees the new lengths with nothing installed. The clock itself, the day counter, sleeping and the world save are untouched: a day is still 1800 game-seconds, it just takes as long as you say in wall time.
  • Smoother sun at rates far from 1x. ClockPushInterval in [3 - Client Sync] (default 0.5 s) pushes the clock to clients more often than vanilla's 2 s, shrinking the correction each push applies. Set 2 to add no extra traffic.
  • Live config reload. Edit the cfg on a running server; the new schedule is picked up within 5 seconds and logged.