Weather
Blustery and chillier today and tomorrow with showers or longer spells of rain. Drier by midweek.
It's no secret that our old weather system was a huge mess of programmer art and performance issues, which is why it had to be removed from the game a long time ago. We were able to resolve the performance issues by doing more optimizations ourselves and relying less on Unity's particle system optimizations. We sort of rolled our own super primitive voxel collision to handle the coarse, large-scale collisions. Unity then only has to sort out the detailed collision on the last couple of meters above ground.
As for visuals, I think we did it right this time by having a system that is almost entirely artist-driven. The code then simply blends between various weather presets. This also has the advantage that everything can be adjusted by server mods, allowing for endless customization in the future.
Admin Convars
Here's a short explanation of the main weather convars for server owners:
weather.load
- loads a specific weather type
weather.reset
resets to dynamic weather
weather.report
prints the current dynamic weather
There are currently the following weather types that can be loaded this way:
- Clear
- Dust
- Fog
- Overcast
- RainHeavy
- RainMild
- Storm
An example is weather.load Fog
In terms of affecting gameplay, server owners can also adjust how wet players get from rain and snow:
weather.wetness_rain
weather.wetness_snow
Probability Parameters
When using the default dynamic weather, server owners can adjust the probability of every weather type individually:
weather.clear_chance
weather.dust_chance
weather.fog_chance
weather.overcast_chance
weather.storm_chance
weather.rain_chance
Detailed Convars
If all of that still isn't enough customization for your particular server, then you can also adjust every individual parameter of the weather system. Note that negative values (-1) indicate that the value isn't overwritten and is using whatever the dynamic weather system is currently outputting. These commands must be run from server console - otherwise use sv
for server commands replicated on client.
weather.rain
- How much it should rainweather.wind
- How much wind there is (mostly visual, affects certain vegetation)weather.thunder
- How much thunder / lightning there isweather.rainbow
- Can be set to forcefully trigger a rainbowweather.fog
- How much fog there isweather.atmosphere_rayleigh
- Rayleigh scattering intensity (determines the color of the sky - play around with it)weather.atmosphere_mie
- Mie scattering intensity (determines the color of the sky - play around with it)weather.atmosphere_brightness
- Overall brightness of the skyweather.atmosphere_contrast
- Overall contrast of the skyweather.atmosphere_directionality
- Directionality factor that determines the size of the glow around the sunweather.cloud_size
- Scale of the cloud layers (does not affect the cloud billboards)weather.cloud_opacity
- Opacity of the cloud layers and billboardsweather.cloud_coverage
- How much sky is covered by the cloud layersweather.cloud_sharpness
- How sharp the clouds formed by the cloud layers areweather.cloud_coloring
- Determines the blending of indirect light from the sky and direct light from the sunweather.cloud_attenuation
- How dark the clouds should be are when they get thickerweather.cloud_scattering
- How much sunlight the clouds should scatter (makes them bloom)weather.cloud_brightness
- Overall brightness of the clouds