A day–night cycle in Godot 4 with one light and shorter nights
A 16-minute day with orange sunsets, moon, stars and villages with their windows lit. A single light plays both sun and moon, and night passes faster on purpose.

Until this mod, it was always eight in the morning in Gotic. With Día y noche ("day and night") the sun rises in the east, crosses the sky through the south and sets in the west; sunset turns the island orange (as in the cover, over Brumacosta at 19:22) and at night the moon and stars come out. A small clock at the top centre shows the day and time.
The villages notice: at night they light their windows and lanterns, the bonfire burns brighter, and the villagers who were strolling around sit down by the fire.

How it's built
A full day lasts 16 minutes of play: 11 of daylight (5:00 to 20:00) and 5 for the rest. Night passes faster on purpose; time advances at one rate or the other depending on the stretch:
static func rate(at: float) -> float:
if at >= LIGHT_FROM and at < LIGHT_TO:
return (LIGHT_TO - LIGHT_FROM) / DAYLIGHT_SECONDS
return (24.0 - LIGHT_TO + LIGHT_FROM) / (DAY_SECONDS - DAYLIGHT_SECONDS)
So that a long step never skips a rate change or the day rollover, time is advanced in pieces that end exactly at each boundary (5:00, 6:00, 20:00 and midnight). The day counter goes up at dawn, at 6:00. A test checks that dawn to dawn takes 960 ± 1 s.
The sky is painted by Scenery.apply_time(hour), and here's the part I liked most: a single directional light plays both sun and moon. By day it's the sun, white at noon and orange near the horizon; at 20:00, when the sun sets, the same light becomes the moon, bluish and much dimmer. At the handover the light sits on the horizon with almost zero energy, so you don't see the switch. The colours of the sky, horizon, ambient light and sea come from a palette keyed by hour (dawn, day, dusk, night), smoothly interpolated.
The stars are a dome 700 m from the player: beyond the loaded terrain (440 m) and within the camera's range (900 m). It's a single draw call and only exists at night.
Two decisions made with phones in mind:
- Night is blue and readable, not black. On a phone screen, a black night is unplayable.
- Village lights aren't lights. Windows and lanterns are a mesh with a glowing material. In the Compatibility renderer, every engine light is another pass per object, and with four villages that would show.
The sky isn't repainted every frame, only every half second: at that pace you can't tell the difference. Other mods read world.scenery.night (0 by day, 1 at night) without knowing this one exists: the wildlife swaps butterflies for fireflies, the ambient sound swaps birds for crickets, and the Brumacosta festival only exists because there are nights. Turning the mod off brings back the old fixed sky.

What went wrong
The mod itself gave no trouble, but night exposed bugs in the ones that came later: six styles in the screen-filter study went pitch black (they used fixed thresholds and needed auto-exposure), and with the weather mod the raindrops glowed at night and stars showed through the clouds.
Measured on PC that round: 752 checks passing, and screenshots of day, dusk and night at 1280×720 and 1600×720.
Still unverified
Night-time FPS on a phone. When the game was finally measured on a Samsung S24 Ultra, it ran at 60 FPS by day, on foot and flying; at night, unmeasured. That round the APK couldn't be exported either, because of a problem in the export environment, not the code.