Sundial
Longer days and shorter nights inside Valheim's own day/night cycle. Pick the daylight share (vanilla 70%, default 80%); sleep, spawns and the day counter stay consistent. Server-synced and version-locked.Sundial
Longer days and shorter nights for Valheim, inside the game's own day/night cycle. One DLL, installed on the server and on every client.
What it does
Valheim is already 70 % day and 30 % night. It stretches the middle 70 % of each cycle over the sun's path from dawn to dusk and fits the night into the rest. Sundial moves that split and changes nothing else.
A full cycle is 30 minutes (the game's m_dayLengthSec is 1800 s):
DaylightPercent |
Day | Night |
|---|---|---|
| 50 | 15 min | 15 min |
| 70 (vanilla) | 21 min | 9 min |
| 80 (default) | 24 min | 6 min |
| 90 | 27 min | 3 min |
- The cycle length and the day counter do not change.
- Sleeping wakes you at the new dawn: not in the dark, and never a day later than vanilla would.
- Everything that asks the game whether it is day follows: the sun and light, spawns, sleeping, bees, fishing, and any clock that reads the game's time of day. At the default, night-only spawns get less time.
- Nothing is written per frame and nothing is stored in the world. Remove the mod and the world is exactly vanilla again.
Setup
- Install on the server and on every client (BepInEx 5).
- Config:
BepInEx/config/helix.sundial.cfg. Edits are picked up within 5 s, no restart. On a server, the new values are pushed to everyone connected.
| Section | Setting | Default | Range | |
|---|---|---|---|---|
01 General |
Enabled |
true |
false = vanilla day/night. Synced from the server. |
|
01 General |
DaylightPercent |
80 |
10 to 95 | Share of each cycle that is daylight. Vanilla is 70. Synced from the server. |
01 General |
ConfigReloadSeconds |
5 |
0 to 300 | How often the cfg file is checked for edits. 0 = off. Local. |
02 Diagnostics |
LogIntervalSeconds |
0 |
0 to 3600 | Seconds between [state] log lines. 0 = off. Local. |
Multiplayer
- The server's
EnabledandDaylightPercentapply to everyone connected. A client cannot change them. - Every machine must run the same Sundial version, and the check works both ways:
- A client without Sundial, or with a different version, cannot join a server that runs it.
- A client with Sundial cannot join a server without it.
- Single player works as usual.
- Settings travel only when a player connects and when they change. Nothing is sent while you play.
Compatibility
- Sundial refuses to start next to another mod that changes the day/night cycle: any plugin whose
GUID or name contains
longerdays,daynight,extendeddaytime,controltime,dagrnott,customdaycycle,timecontrol,seasonsorvalheimplus. The match ignores case, spaces, dots, dashes and underscores, soValheim PlusandDay Nightcount. - It checks the game's code before patching, and it checks that no other mod patches the same three methods. If either check fails (after a game update, or with another mod), it logs one error and that machine runs vanilla day/night.
- Keep every machine on the same mods and the same game build. Each machine runs these checks
on its own. If they fail on only one machine, that machine runs vanilla while the others run your
split.
- A conflicting mod installed on only one side does this.
- So does a game update that changes the day/night code and reaches the clients before the server restarts: Valheim lets different game builds connect as long as the network version matches.
- It shows around dawn, dusk and waking up. The sun, the bed prompt and night spawns can disagree for about a minute and a half each time. Restarting the server on the same build puts everyone back in step.
- Mods that read the time of day follow the new split automatically.
Uninstalling
Delete the DLL on the server and on every client. Sundial stores nothing in the world and never
changes the cycle length or the day counter, so the world carries on in vanilla day/night from
where it was. Enabled = false does the same live, without a restart.
Performance
Sundial replaces one small function that the game calls once per frame to turn the cycle position into the time of day. Measured on a headless dedicated server (1 million calls, median of 7 runs):
- Vanilla: 12.4 ns per call.
- Sundial: 10.1 to 10.8 ns per call over two runs. It multiplies by constants worked out when the setting changes, where vanilla divides.
- With
Enabled = falseorDaylightPercent = 70, Sundial hands straight back to vanilla, which adds about 1 ns.
The two sleep methods it changes run only when everyone goes to bed or an admin uses sleep. The
mod has no per-frame Update().
Log lines
[bind],[shape]and[patch]report the startup checks.[warp]shows the split in effect whenever it changes. Once a world is loaded, it includes the day and night minutes. On a client, the line that follows the server's settings is the one that counts.[cycle]shows the real cycle length once a world loads.[state]is off by default. It shows net time, cycle position, day fraction, day number and the day/night/sleep flags.
Credits
Config sync and the version check use ServerSync by blaxxun-boop (MIT-0), compiled in from source.


