Time and weather¶
Days pass with seasons, warm afternoons and cold nights, and the weather changes by itself. At night only the lamp posts and the light you carry break the dark. Every player of a game sees the same hour and the same sky.
In the game¶
The clock¶
The top right of the HUD shows the day and date (Day 1 · Jun 1), the hour (09:00), the air
temperature and the weather. The INTERFACE page of the options sets the temperature unit. A new
world opens at its Start hour game option (9) on the first day of its Start month (June), and a
continued world resumes at its saved minute.
A game day lasts the Day length game option, 30 real minutes by default, which makes 48 game minutes pass in a real minute.
The exact formula
Time runs at TimeScale game minutes per real minute: 1,440 divided by the Day length game
option (30 real minutes by default, so 48), times the speed the host picked while playing alone.
While the host plays alone, the clock shows three buttons, x1, x2 and x4, and the radial menu a Time speed entry. The whole world runs faster, but not the movement. When a second player is admitted, the speed returns to x1 and the buttons disappear. A host alone also runs at x60 while asleep. Nothing speeds the world up when every player of a co-op game is asleep.
Needs, infection, statuses, mood and body temperature follow the same clock.
The death screen's "Survived" line counts from the moment that character started: 2 d 7 h, or
7 h 12 m under a day.
Calendar and temperature¶
The year has twelve months of real length: 365 days, no leap year, no year shown. Each month has its season, its sunrise and sunset, the sun's height at noon, a mean temperature with a day-to-night spread, and the weights of its weather.
The air follows the month, is warmest at 15:00, and the weather shifts it. The shipped climate is a temperate continental one: -4 °C on average in January, 22 °C in July, about 15 h 30 of daylight in June and 8 h 45 in December.
The exact formula
The air temperature is the month's mean blended towards the next month's, plus a daily curve that peaks at 15:00, plus the effect of the weather.
Day and night¶
The sun follows its month's arc from east to west. The night is dark but readable, and the Night darkness game option (0.5 to 2) makes it lighter below 1 and darker above. The best light is around 17:30, when the sun is low and the shadows long.
The exact formula
The exposure bias follows the light, up to NightExposureBias at night. The Night darkness
game option pushes it further, and the bias never leaves the bounds MinExposureBias and
MaxExposureBias.
Lamp posts¶
The lamp posts all switch on when the sun drops below +1°, about 19:45 in June, and at night you see their pools of light on the ground. They cast no shadows. A lamp post you add to your map lights up with nothing to set.
Weather¶
Six kinds of weather ship: clear, cloudy, rain, storm, fog and snow. The host picks the next episode from the month's weights, and the Bad weather game option (0 to 2) multiplies those of the bad ones. At 0 only clear and cloudy skies remain. A given world always plays the same sequence. One episode blends into the next over 30 game minutes, and rain falls as snow when the air is below 0.5 °C.
Clouds dim the sun, the moon and the sky, fog veils the scene, wetness darkens and smooths the ground, and wind sways leaves and grass. An indoor floor never gets wet.
Weather reaches the survivor through body temperature only. A zombie sees and hears the same by day and by night, in clear weather and in fog.
Rain, snow and thunder¶
Rain and snow are drawn for your own survivor only, around him. Inside a building they are hidden and the rain loop is lowered. A vision zone decides what is inside.
Snow builds on the ground while it snows and melts above the threshold. A new world starts with the snow of its start month.
During a storm, every player sees the flash and hears the thunder at the same game second. Each strike is also a noise at a point near a survivor, and the zombies that hear it go and look.
Rain, wind, birds by day and insects on warm nights each have a loop, and thunder a near and a far clap. The template ships with no ambience: the four loops are at volume 0 and the two thunder fields are empty.
Carried lights¶
An item can carry a light. Two ship:
| Light | Asset | What it gives |
|---|---|---|
| Flashlight | DataAssets/Items/Childs/DA_LightSource_Flashlight |
a cold cone of 5,000 cd that reaches 18 m on the ground ahead |
| Torch | DA_LightSource_Torch |
a warm light all around, 350 cd over 9 m, and 3 °C of warmth fading out at 300 uu |
Using one from the inventory lights it instead of consuming it, and using it again puts it out. Lighting the other switches to it: one light at a time. The light goes out when the item leaves the bag and when the survivor dies, and a continued world starts with every light off.
The light shines from the survivor's chest and turns with the body, not with the aim. Every player sees every survivor's light, but only your own casts shadows, and a survivor your vision hides takes their light with them. The torch's warmth reaches the body temperature of everyone near it.
The assets¶
The calendar, the lighting and the weather are three Data Assets in
Content/ZombieSurvival/DataAssets/Environment/Childs/: DA_SeasonSettings_Default (class
PDA_SeasonSettings), DA_LightingSettings_Default and DA_WeatherSettings_Default (class
PDA_WeatherSettings). A carried light is a PDA_LightSourceDef: a spot or a point, an intensity
in candelas, a range, cones, a colour, an offset and a pitch.
Each played map has one Blueprints/World/BP_WorldEnvironment, which carries the sun, the moon, a
sky light captured in real time, the atmosphere, the height fog and an unbound post-process with a
manual exposure. A map without one keeps the fixed lighting you put in it, as L_MainMenu does.
The sun casts short contact shadows (ContactShadowLength 0.04) and the sky light is slightly warm
(255, 232, 210). The Exposure post-process component of BP_WorldEnvironment adds warm highlights
and keeps the shadows neutral, slightly desaturated (0.85). The rest of the grade belongs to each
map: its SceneGrade post-process volume sets the contrast, the saturation, the vignette and the
ambient occlusion.
Rain and snow are drawn by Niagara/Weather/NS_Precipitation, in a column of 6,000 x 6,000 x
1,700 uu that follows your survivor.
| Asset | Property | Default | What it does |
|---|---|---|---|
DA_SeasonSettings_Default |
Months |
twelve months | Name, days, season tag (Season.Spring to Season.Winter), sun, temperatures and weather weights of each month. |
DA_SeasonSettings_Default |
StartDayOfMonth |
1 | Day of the month a new world starts on. |
DA_SeasonSettings_Default |
TimeSpeeds |
1, 2, 4 | Speeds a host playing alone can pick. |
DA_SeasonSettings_Default |
TemperaturePeakHour |
15:00 | Hottest hour of the day. |
DA_LightingSettings_Default |
MoonIntensity |
50 lux | Moonlight. |
DA_LightingSettings_Default |
NightExposureBias |
4.2 | Exposure bias at night. |
DA_LightingSettings_Default |
MinExposureBias, MaxExposureBias |
-4, 6 | Bounds of the exposure bias. |
DA_LightingSettings_Default |
LampOnElevation |
+1° | Sun height below which lamp posts switch on. |
DA_LightingSettings_Default |
LampIntensity |
500 cd | Brightness of a lamp post. |
DA_WeatherSettings_Default |
Episodes |
six: Weather.Clear, Cloudy, Rain, Storm, Fog, Snow |
Lengths, intensities, clouds, fog, wetness, wind, temperature effect. |
DA_WeatherSettings_Default |
TransitionMinutes |
30 | Game minutes to blend from one episode to the next. |
DA_WeatherSettings_Default |
SnowThreshold |
0.5 °C | Below it, rain falls as snow. |
DA_WeatherSettings_Default |
RainVolume, WindVolume, BirdsVolume, InsectsVolume |
0 | Volumes of the four ambience loops. |
DA_WeatherSettings_Default |
ThunderNearSound, ThunderFarSound |
empty | The near and the far thunder clap. |
BP_WorldEnvironment (Class Defaults) |
LampMeshes |
SM_LampPost |
Meshes that count as lamp posts. |
BP_WorldEnvironment (Class Defaults) |
UpdateInterval |
0.1 s | How often each machine applies the hour and weather. |
DataAssets/Noise/Childs/DA_NoiseSettings_Default |
Noise.Weather.Thunder |
6 | Loudness of a thunder strike for the zombies. |
DA_LightSource_Torch |
Warmth, WarmthRadius |
3 °C, 300 uu | Warmth the torch gives the body. |
AC_Needs, AC_Infection, AC_Status, AC_Mood, AC_BodyTemperature |
TimeFactor |
1.0 | How fast each runs against the clock. At 1, a rate written "per minute" in a settings asset is a rate per game minute. |
The lighting asset also holds the sun, the sky light by day and by night, the fog, the dimming by clouds, and the lamp posts' radius, colour and offset. The weather asset also holds snowfall and melt per hour, the snow of a new world, the thunder intervals, flash and sounds, the precipitation system with its rates and speeds, and the four ambience loops with their volumes by episode, by hour and indoors.
The game options of a new world set the rest. In the Standard preset
(DataAssets/Sandbox/Childs/DA_SandboxSettings_Default): a 30-minute day, a start at 9:00 on June
1, night darkness and bad weather x1. Easygoing has lighter nights (x0.75) and half the bad
weather. Unforgiving starts in October, with darker nights (x1.5) and half again as much bad
weather (x1.5).
Change it¶
- To change the climate, edit the twelve rows of
Months: day counts, sunrise and sunset, temperatures, weather weights. - To use sets of your own, make a child of the class and point the Game Instance at it
(
BP_ZSGameInstance.SeasonSettings,LightingSettings,WeatherSettings). - To light one map differently, name its own lighting asset in
Settingson its placedBP_WorldEnvironment. - To add a kind of lamp post, add its mesh to
LampMeshes. Every actor or instance that uses it becomes a lamp post. - To add a carried light, make a
PDA_LightSourceDefand name it in theLightSourceof an item. Empty means no light. - To change the day length, the start hour and month, the night darkness or the bad weather, set the game options of a world or of a preset.
- To hear the ambience, set the four volumes above 0 and name
SW_Thunder_NearandSW_Thunder_Farin the two thunder fields, as Sounds shows. - To let a surface take wetness, snow or wind, set
WetMask,SnowMaskorWindMaskabove 0 on its instance ofM_Building, as the outdoor instances do. - To hold needs, infection, statuses, mood or body temperature still, set the
TimeFactorClass Default of its component to 0, or above 1 to run it faster than the calendar.
From a graph, BFL_ZSTime turns any game minute into a date, a season, an air temperature and a sun
position, and its GetTimeScale reads how many game minutes pass in a real minute.