Vanilla Weather Variables
Weather Variables System
Section titled “Weather Variables System”Weather variables are stored in RandomWeatherWithVariables - each level has its own set of them in SelectableLevel:
They control weather behavior through TimeOfDay.currentWeatherVariable and TimeOfDay.currentWeatherVariable2.
How They’re Set
Section titled “How They’re Set”In RoundManager.SetToCurrentLevelWeather(), the weather variables are loaded from the current level’s weather configuration:
For challenge files, there’s a 20% chance each variable gets randomized to 20-80% of its original value.
Weather Reset
When leaving a planet in StartOfRound:
Vanilla Weathers - Overwiew
Section titled “Vanilla Weathers - Overwiew”| Weather Type | weatherVariable | weatherVariable2 |
|---|---|---|
| Rainy | Unused | Unused |
| Foggy | Min fog density | Max fog density |
| Stormy | Strike frequency multiplier (higher = more frequent) | Unused |
| Flooded | Base water height | Max water rise |
| Eclipsed | Min enemy spawns | Unused |
| Others | Not used in code | Not used in code |
Weather Variables Breakdown
Section titled “Weather Variables Breakdown”LevelWeatherType.Rainy
Section titled “LevelWeatherType.Rainy”Weather Variables: Both weatherVariable and weatherVariable2 are completely unused by the game code.
Rainy weather spawns quicksand hazards outside on the map, but the spawn logic is entirely hardcoded in the SpawnOutsideHazards() method in RoundManager.cs:
Behavior:
- Spawns 5-15 quicksand objects normally
- Has a 7% chance to spawn 5-30 quicksand objects instead (dangerous variant)
- Quicksand positions are randomly placed near outside AI nodes within a 30-unit radius
- No weather variables are consulted - unlike other weather types, Rainy weather ignores its configuration entirely
LevelWeatherType.Foggy
Section titled “LevelWeatherType.Foggy”- weatherVariable: Minimum fog density (mean free path)
- weatherVariable2: Maximum fog density (mean free path)
- A random value between these is chosen each round
- Set in
TimeOfDay.SetWeatherBasedOnVariables():
LevelWeatherType.Stormy
Section titled “LevelWeatherType.Stormy”- weatherVariable: Controls lightning strike frequency (storm intensity)
- Used as a divisor in
StormyWeather.DetermineNextStrikeInterval():
- Lower values = less frequent strikes
- Higher values = more frequent strikes (
weatherVariableis a setting for strike frequency multiplier) - Also determines if lightning re-strikes same location:
LevelWeatherType.Flooded
Section titled “LevelWeatherType.Flooded”- weatherVariable: Base water level height (Y position)
- weatherVariable2: Maximum additional water level rise over time (delta of Y position)
- Water level calculation in
FloodWeather.OnGlobalTimeSync():
- Final position:
weatherVariable + (floodLevelOffset) - Water rises throughout the day based on
weatherVariable2
LevelWeatherType.Eclipsed
Section titled “LevelWeatherType.Eclipsed”- weatherVariable: Minimum number of outside enemies to spawn
- Also sets minimum inside enemies to spawn
- Set in
EclipseWeather.OnEnable():
- weatherVariable2: Not used