Gransys finally has a sky that changes. This round added a full day and night cycle and a dynamic weather system: drifting clouds, fog, wind, rain, snow, thunderstorms and blizzards, all blending smoothly into each other. There is also a developer panel to flip through all of it in seconds, plus a handful of fixes from the last playtest.
A day that lasts 48 minutes
In the original, a full day takes about 48 real minutes, and roughly two thirds of that is daylight. Nights are short and dark. The remake uses the same rhythm, so daylight hours and night hours tick at different speeds:
const bool bDay = TimeOfDay >= SunriseHour && TimeOfDay < SunsetHour;
const float DayHours = SunsetHour - SunriseHour;
const float NightHours = 24.0f - DayHours;
const float RealSeconds = DayLengthMinutes * 60.0f * (bDay ? DaylightShare : 1.0f - DaylightShare);
const float HoursPerSecond = (bDay ? DayHours : NightHours) / FMath::Max(RealSeconds, 1.0f);
TimeOfDay = FMath::Fmod(TimeOfDay + HoursPerSecond * DeltaSeconds * TimeSpeed + 24.0f, 24.0f);The sun rises in the east, arcs across the south and sets in the west. Unreal's sky atmosphere does the hard part of a good sunrise or sunset: when the sun sits low, light travels through much more air and the sky turns orange and red on its own. On top of that, fog and rain add haze, which softens and warms the light the way a humid evening does.
After dusk a second, dim blue light takes over as the moon on the opposite path, a star dome fades in (only on clear nights, clouds hide it), the sky light drops and the exposure is pulled down so nights feel properly dark.
Weather that makes sense
Each kind of weather is a small preset: cloud coverage and thickness, a storm cloud look, fog density, rain, snow, wind, lightning rate and how much sunlight gets through. A change blends one preset into the next over a minute and a half, so a storm rolls in instead of snapping on.
A weather director picks what comes next every 4 to 12 minutes, but not at random. Clear skies cloud over before it rains, heavy rain can build into a thunderstorm, and storms calm down into rain before they clear:
case W::Overcast: Options = { {W::PartlyCloudy, 3.0f}, {W::LightRain, 3.0f}, {W::Fog, 1.0f}, {W::Snow, 0.7f} }; break;
case W::HeavyRain: Options = { {W::LightRain, 3.0f}, {W::Thunderstorm, 2.0f}, {W::Overcast, 1.0f} }; break;
case W::Thunderstorm: Options = { {W::HeavyRain, 3.0f}, {W::LightRain, 1.0f} }; break;The system also tracks slower things: surfaces get wet while it rains and dry over a few minutes afterwards, and snow settles and melts even more slowly. Those values go into a material parameter collection, so any material can pick them up later for wet stone or snow on rooftops.
Rain, snow and wind
Rain and snow are thousands of instanced meshes living in a box around the camera. They fall in world space, so running doesn't drag them along, and wrap around when they leave the box. Rain streaks lean with the wind, snowflakes sway and drift sideways, and in a blizzard they fly almost horizontally. The wind direction wanders slowly around the compass and also drives a wind source, so foliage and cloth will react once they exist.
Lightning and thunder
The server decides when lightning strikes, with random gaps like a real storm: sometimes two strikes close together, sometimes a long quiet spell. Every player sees the same strike: a jagged bolt from the cloud base to the ground and a flickering flash. Thunder arrives at the speed of sound, so a strike 2 kilometers away rumbles about six seconds later, and only close strikes get the sharp crack.
Sounds made from noise
There are no audio files for the weather. Rain, wind and thunder are generated on the audio thread from filtered noise: rain is a soft hiss plus random droplet clicks that get denser as it pours, wind is a deep rumble with slow gusts and a whistle in strong storms, and thunder is a crack followed by several seconds of rolling rumble. Their volume follows the weather, so the sound fades in with the storm.
Multiplayer and saves
The host owns the clock and the weather and replicates them, so everyone in a session shares the same sky. Rain is drawn locally around each player's own camera. Saves now remember the hour and the weather, so loading puts the sky back exactly how you left it.
A panel to test it all
Waiting 48 minutes to check a sunset isn't practical, so F8 opens a weather panel while the game keeps running. It cycles every weather type, sets how long changes take, jumps to dawn, sunrise, noon, golden hour, sunset, dusk or midnight, speeds the clock up to 1000x, and can force rain, snow, wind, fog or clouds to any amount, or strike lightning on demand. The same controls exist as console commands.
Fixes from the last playtest
- New Game did nothing. The menu checked whether the New Game page existed before building it from your save slots, so it quietly gave up. It now opens the ten slots, with a warning before overwriting one.
- Hanging from a ledge no longer drains stamina, and shimmying is faster and synced to the distance moved so the hands stop sliding.
- Climbing up from a ledge uses a proper braced hang to crouch animation.
- Running out of stamina now stumbles forward about five steps (releasing the stick ends it sooner), then forces the catch your breath pose, with no stamina recovery until the steps are over.
Next up
- Playtest and tune the sky: rain density, star brightness, night darkness and cloud thickness were all set by eye in code.
- Wet surfaces and snow cover on materials.
- Knockback and knockdown reactions when hit.
I also started making cassardis... isn't it fuckin beautiful?





