TimeControl
Adjust the length of the Valheim day/night cycle with a simple multiplier.
About this mod Author’s original text
TimeControl
A BepInEx 5 plugin for Valheim that adjusts the length of the in-game
day/night cycle with a single multiplier.
By default Valheim runs one full day/night cycle in roughly 30 real minutes.
TimeControl lets you stretch (or compress) that — e.g. a 4.0 multiplier turns
a full day into about 2 real hours.
How it works
Valheim derives the time of day every physics tick from a single field,
EnvMan.m_dayLengthSec:
dayFraction = (worldClockSeconds mod m_dayLengthSec) / m_dayLengthSec
The networked world clock advances at a fixed rate of 1 real second to 1 game
second, so making a day longer is simply a matter of increasing
m_dayLengthSec. TimeControl captures Valheim's shipped value once and
multiplies it by your configured multiplier. Day and night both scale together;
their ratio is fixed by Valheim and is preserved.
The change takes effect immediately and smoothly — the sun does not jump.
On-screen clock
TimeControl shows a small clock in the top-center of the screen that displays the
current time of day as a single word — Midnight, Night, Dawn, Morning,
Midday, Afternoon, or Dusk. The word is derived from Valheim's own
day fraction, so it lines up with the real sunrise (0.25), midday (0.5) and sunset
(0.75) points of the cycle. It is display-only and per-client — it reads your local
clock and adds no network traffic and no Harmony patches.
The clock's appearance is configurable (color, custom hex color, size, style and
font); see the Clock Appearance options below. The clock's style and font are
rebuilt only when you change a setting, so it adds no measurable per-frame cost.
Configuration
Config file: BepInEx/config/drummercraig.time_control.cfg
| Section | Key | Default | Description |
|---|---|---|---|
| General | DayLengthMultiplier | 4.0 | Multiplier on the vanilla day length. 1.0 = vanilla (~30 min/day). 2.0 = twice as long. Range 0.1–100. |
| General | ShowClock | true | Show the on-screen time-of-day word clock. |
| Clock Appearance | TextColor | White | Palette color for the clock text. Ignored when TextColorHex is set to a valid value. |
| Clock Appearance | TextColorHex | (blank) | Optional custom color as #RRGGBB; overrides TextColor when valid. Blank uses the palette. |
| Clock Appearance | FontSize | 16 | Font size (dropdown of preset sizes: 12, 14, 16, 18, 20, 24, 28). |
| Clock Appearance | FontStyle | Bold | Normal, Bold, Italic, or BoldAndItalic. |
| Clock Appearance | Font | Default | Font family. Default = the built-in game UI font; other entries are common cross-platform fonts, falling back to the default if not installed on your machine. |
You can edit these live from the in-game Configuration Manager (if installed);
changes apply on the spot.
Multiplayer
m_dayLengthSec is a client-local field — vanilla Valheim never sends it
over the network. To keep everyone on the same clock, TimeControl:
- Requires an exact mod-version match. When a client connects, the server
and client exchange their TimeControl version over a custom RPC. If they do
not match exactly — or if one side does not have the mod at all — the
connection is refused with Valheim's native "Incompatible version" screen.
This reuses the same mechanism vanilla itself uses to reject mismatched
clients (ZNet.RPC_PeerInfo + the ConnectionStatus.ErrorVersion code); no
third-party config-sync library is bundled.
- Server settings win. Immediately after the handshake, the server pushes
its effective DayLengthMultiplier to the client, which adopts it for the
session. A connected client's own local config is ignored while connected, so
all players always share the server's clock. The client's local value applies
again in singleplayer or when hosting.
Install TimeControl on the server and on every client, at the same version.
Building
Requires Mono with the.NET Framework 4.8 reference assemblies. TimeControl does
not commit any game/BepInEx DLLs; it references them from your live Valheim
install so it always builds agai
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file. In multiplayer, the host and every client need the same mods installed.