Day Night Kit
A host-authoritative day/night clock for s&box with pure sky grading and deterministic per-day weather.
favorite1favorites
thumb_up2upvotes
hard_drive
0 MB
folder
24 files
build
Engine v28
About This Package
Day Night Kit is a source library you vendor into your game. It runs a host-authoritative day/night clock: the host advances game-time and publishes it, clients observe and extrapolate smoothly, and pause is handled correctly across the network so a paused host never leaves clients free-running.
The sun and sky grading is pure math. Feed it a game-hour and the day's weather and it returns a sun rotation and four colour grades, anchor-exact at your reference hour, with a twilight blend and a non-uniform clock rate that makes the day run longer than the night. It never touches camera exposure, so night renders genuinely dark instead of fighting a locked-exposure setup.
Weather is a deterministic per-day roll: a pure hash of the world seed and the day, so a host and every client agree on Clear, Cloudy, or Rain with no per-day networking. The kit ships no sky shader and no sky art on purpose and exposes a seam instead: four normalized crossfade weights for any hour, so you drive your own sky however you like.
There is a dev time panel in the box. Scrub the clock, change the pace, jump to dawn or dusk, pin the weather, hold time, and copy the tuned config as a paste-ready C# block. Press N. It is optional; delete Code/Ui and nothing else notices.
Try it before you wire anything. Install the kit, then open the demo scene: the kit lands under your project's Libraries folder rather than your own Assets, so in the Asset Browser select Everything and search daynight_demo, or walk the sidebar to Libraries then fieldguide.daynight then Assets then scenes. Open daynight_demo.scene and press Play. An in-game day takes four real minutes there, so you watch a full cycle: the sun sweeps, the shadows swing, dusk warms, night goes properly dark.
Requirements: s&box, and nothing else. It references no other library and no game code, it needs no Input.config actions (the two keys it reads are raw keyboard keys), and everything the demo scene draws ships with the engine. Source, docs, a self-test battery you can run from the console, and optional convenience, rain and UI modules are included. MIT.
Playing with a kit, or hit something weird? Join the Discord and say so; feedback from real projects is what shapes the next release.
The sun and sky grading is pure math. Feed it a game-hour and the day's weather and it returns a sun rotation and four colour grades, anchor-exact at your reference hour, with a twilight blend and a non-uniform clock rate that makes the day run longer than the night. It never touches camera exposure, so night renders genuinely dark instead of fighting a locked-exposure setup.
Weather is a deterministic per-day roll: a pure hash of the world seed and the day, so a host and every client agree on Clear, Cloudy, or Rain with no per-day networking. The kit ships no sky shader and no sky art on purpose and exposes a seam instead: four normalized crossfade weights for any hour, so you drive your own sky however you like.
There is a dev time panel in the box. Scrub the clock, change the pace, jump to dawn or dusk, pin the weather, hold time, and copy the tuned config as a paste-ready C# block. Press N. It is optional; delete Code/Ui and nothing else notices.
Try it before you wire anything. Install the kit, then open the demo scene: the kit lands under your project's Libraries folder rather than your own Assets, so in the Asset Browser select Everything and search daynight_demo, or walk the sidebar to Libraries then fieldguide.daynight then Assets then scenes. Open daynight_demo.scene and press Play. An in-game day takes four real minutes there, so you watch a full cycle: the sun sweeps, the shadows swing, dusk warms, night goes properly dark.
Requirements: s&box, and nothing else. It references no other library and no game code, it needs no Input.config actions (the two keys it reads are raw keyboard keys), and everything the demo scene draws ships with the engine. Source, docs, a self-test battery you can run from the console, and optional convenience, rain and UI modules are included. MIT.
Playing with a kit, or hit something weird? Join the Discord and say so; feedback from real projects is what shapes the next release.
No usage statistics available
This package may be new or not widely used yet. Usage data becomes available as more users install and play with the package.
This package may be new or not widely used yet. Usage data becomes available as more users install and play with the package.
Package ID:
fieldguide.daynight
Created:
2026-08-01 00:38 UTC
Updated:
2026-07-31 23:59 UTC
Type:
library
Public:
Yes
Version:
337909
files:
24
Size:
0.2 MB
Engine Version:
28
Asset Version ID:
337909
Version Created:
2026-07-31 23:59 UTC
Hash:
1785542373
Manifest: Open manifest
Resources:
Code Package References:
First Light
Jul 31, 2026
Added
- A host-authoritative day/night clock. The host runs time, clients follow it smoothly, and a paused host no longer leaves every client free-running through a whole day on their own.
- Pure sun and sky grading. Give it an hour and the day's weather and you get a sun rotation and four colour grades back, exact at your reference hour, blended through twilight so dusk never snaps.
- Deterministic per-day weather. Clear, cloudy or rain from a hash of your world seed and the day, so every peer agrees with no extra networking.
- The sky seam. Four crossfade weights per hour that you feed to your own sky. The kit ships no sky shader and no sky art on purpose; the weights are the whole contract.
- A dev time panel on N. Scrub the clock, change the pace, jump to dawn or dusk, pin the weather, hold time, and copy the tuned config straight to your clipboard as C# you can paste.
- A demo scene. Four real minutes to the in-game day, so you watch a full cycle instead of waiting for one: the sun sweeps, the shadows swing, night goes properly dark. It also prints the live sky weights, which is the only way to see the seam working in a kit with no sky art.
- An optional rain shower and an optional driver component that applies the grade to your light each frame. Both delete cleanly.
- A self-test battery on fg_daynight_selftest that proves the maths without opening a scene.
Fixed
- Dragging the time slider all the way right could tip you into the next day and re-roll that day's weather. One in-game minute is not exactly representable in binary, so the quantized slider overshot midnight by a hair. It clamps now, and the self-test checks for it.