Stund
The time of day and the day number, on screen.
The time of day and the day number, on the screen.
Why
Valheim already has a clock, and it shows it to you in the most expensive way there is.
The sun is precise. Sunrise and sunset are fixed fractions of the day, always the same, and every experienced player is reading them without being told to. You look at the light and you know roughly how long you have. It works well enough that a clock feels redundant right up until you are underground.
And underground is where the decisions are. In a mine, a crypt, a longhouse, a fog bank or below deck, there is no sun and no horizon, and the questions that actually turn on the time are exactly the ones you ask in those places. Is there enough light left to sail home. Is it worth starting the last corridor. Is it nearly night, so going to bed now is free, or did night just start, so it is eight minutes of standing about. The information is in the game already. It is simply not readable at the moment it matters.
Stund is Old Norse for an hour, a while, a point in time.
What it shows
Day 43 17:45, in the game's own typeface, in a corner you choose.
The day number is the game's own: the same one it announces at dawn, read from the same place, so the clock and the message never disagree. The time is derived from the world clock rather than from the smoothed value the sun and the fog are drawn with, which lags by a couple of seconds of real time. On a twenty-minute day that is minutes of game time, and a clock that is minutes out at dawn is a clock people stop trusting.
Midnight is 00:00 and midday is 12:00, which puts sunrise near 06:15 and sunset near 17:45. Those are not chosen numbers: Valheim's own day curve peaks at the halfway point and its two horizon transitions sit at 0.26 and 0.74 of the day, so mapping the day straight onto twenty-four hours is what makes the clock agree with the sky.
Where it sits
Top centre by default, because it is the only part of the screen vanilla leaves empty in ordinary play. The health, stamina and eitr bars own the top left and the minimap owns the top right. The thing that will sit on top of it is a boss health bar, which is also top centre and is not there for long. Corner, offset and size are three lines in the config.
It hides when the rest of the HUD hides, including in cutscenes and on the death screen, because it is parented to the HUD rather than drawn over it.
Installing
Needs BepInEx. Nothing else. Through a mod manager it is one install. By hand, put
Stund.dll in BepInEx/plugins/Stund/.
Then start the game once and quit. That first run writes the config file. It does not exist before the mod has loaded, which is the usual reason people think it is broken.
Settings
The file is BepInEx/config/ezomic.valheim.stund.cfg. Open it in any text editor. Every
setting has a comment above it, so the file explains itself.
Note that changing a default in a new version does nothing on a machine that has already run the mod. BepInEx writes every entry on first run and the saved value wins.
Multiplayer
Nobody else needs it. Purely local and purely visual: it reads a clock every client is already given and draws a label. A server does not know it is there.
If Core is installed, this mod registers with its version gate so a mismatch is reported rather than discovered later. Every setting here is marked as yours. A host does not get to decide where on your screen your clock sits.
Bugs and ideas
Both go to the site. longhouse.thijssensoftware.nl/bugs is for anything broken, and longhouse.thijssensoftware.nl/ideas is for what a mod should do next. You can vote on other people's ideas there as well.
Signing in takes a Steam or Discord account. I work from that list, so the votes decide what I pick up next.
Licence
MIT. See LICENSE.
Coming next
Written, not released yet. This is what the next version of Stund will carry as 1.0.0, and it can still change.
First release.
Day 43 17:45 on the HUD, in the game's own typeface, in a corner of your choosing. The
label is a copy of the health readout with everything that was driving it stripped off, which
is where the font, the material and the outline come from without shipping a font.
The sun already tells you the time and is no use underground, which is where the questions that turn on it get asked: whether there is light left to sail home, whether to start one more corridor, how much of the night is left.
Settled since 0.1.0 by running it:
- The cloned readout does not come up clean.
Instantiate(donor, parent)keeps the donor's LOCAL transform, and vanilla's health readout sits at(0, 0, 270), measured from the running game. The clock came out reading top to bottom with every glyph on its side while all three of its scenario's assertions passed, because those read the label's text and text is the same text at any angle.Place()now resets the rotation beside the scale it was already resetting, andBuild()logs a donor that is not upright. - The default position lands where it was meant to. Top centre, in the one part of the screen vanilla leaves empty in ordinary play, with the bars on the top left and the minimap on the top right. The offset is a judgement rather than a measurement and it is three lines in the config.
Proven in game by stund-clock-agrees-with-the-world, 8 steps. It skips to noon through Devkit
and checks the clock says 12 rather than 14. Midnight is day fraction 0, and anchoring on
GetMorningStartSec instead, which is 0.15 of the day and where sleeping puts you, reads that
same moment as 14:24. So 12 means the clock is using the sun and 14 means it is using the bed.
The eighth step is upright, added to Devkit in the same pass, because the other seven passed
while the clock was unreadable.
Two things nothing automatic covers, both one look to check. Whether the label is visible,
since Hud.SetVisible parks its root off the screen rather than disabling it. And the rebuild
on a second world load, since the scene a scenario runs in does not survive one.
Purely local. It reads a clock every client is already given and draws a label, so a server
does not know it is there. Registers with Core's gate at Requirement.HostOnly and marks every
setting as yours, so a host does not get to decide where on your screen your clock sits.
Every setting · 8
All of it lives in one file, written on first run with each description beside its default. The file is the source of truth; edit it there.
BepInEx/config/ezomic.valheim.stund.cfg
server On a server, the host's value applies to everyone while they are connected; your own file is left alone and counts again when you leave. yours Keys and personal settings stay as you set them, on any server.
Stund 8
| Setting | What it does | Default | Whose |
|---|---|---|---|
| Enabled | Off leaves the plugin loaded and takes the clock off the screen. | true | yours |
| Where | Which corner of the screen the clock hangs off. The top left is the bars and the top right is the map, so the top centre is the one that is usually empty - a boss health bar is the thing that will overlap it. | Corner.TopCentre | yours |
| OffsetX | Pixels from that corner, left to right. Positive is rightwards from any corner; from a right-hand corner that is off the screen. | 0 | yours |
| OffsetY | Pixels from that corner, bottom to top. Negative moves down, so a top corner wants a negative number here and a bottom corner a positive one. | -28 | yours |
| FontSize | Point size of the clock. Below about 12 it stops being readable at a glance, which defeats the point of it being on screen at all. | 20 | yours |
| ShowDay | Show the day number beside the time. It is the same number the game announces at dawn, so it agrees with the message rather than counting its own days. | true | yours |
| TwentyFourHour | Off gives 5:45 PM instead of 17:45. Sunrise is about 06:15 and sunset about 17:45 either way. | true | yours |
| Verbose | Write what the clock found to build itself with to BepInEx/LogOutput.log. Off unless the clock is missing; it is a handful of lines at each world load. | false | yours |
Discussion
Nothing said yet.
Sign in or make an account to join in.