Modding Guide: Automatic Weather System
Required Software
Creating weather effects requires a text editor. We recommend Notepad++, but any text editor will do.
Locating the Planet Generator Definition
In your installation directory of Space Engineers, navigate to the following file: SpaceEngineers\Content\Data\Weather\WeatherEffects.sbc
This file is an xml file which can be opened in your text editor. It contains all the planet definitions used in the game. At the bottom of each planet’s definition you can find the WeatherGenerators nodes. These nodes contain all the data for that planet’s possible weather events. If a planet is missing this section, it has no weather.
Below you will find information about each field and how it plays a part in the weather generation system.
Weather Frequency
Each planet has its own defined frequency of weather. It is determined by the <WeatherFrequencyMin> and <WeatherFrequencyMax> variables. These define the minimum and maximum time in seconds between a weather event occurring. Between weather events, a random value between the declared values is selected. When that amount of time has elapsed a new weather event will begin to spawn.
Global Weather
Optionally, there is a <GlobalWeather> variable, which when true dictates if the created weather event should encompass the entire planet instead of being localized around the player. It’s a good alternative for small moons that all use a single biome.
Persistent Global Weather
If you’d like to bypass the weather frequency, and have a persistent global storm that never fades, you can use the flag <PersistentWeather> and set it to true. This could allow you to have a planet which is shrouded in perpetual rainfall, a deadly dense fog, or a light dust storm – the choice is yours!
Adding Weather Types
Within the <WeatherGenerators> node you can define which areas have which weather effects. This is done by defining a voxel material type, such as Sand, and then defining what types are allowed to spawn when the player is standing on that material type.
Note that this does not use a voxel subtype, but the MaterialTypeName defined within each voxel.
Lets take a look at all the available fields and what they do. From there you can insert/modify the weather events and adjust it to your liking. In the example below, the planet has two possible storms: sandstorms in the desert, and thunderstorms in the savanna.
<WeatherFrequencyMin>900</WeatherFrequencyMin> The minimum time between weather events
<WeatherFrequencyMax>1500</WeatherFrequencyMax> The maximum time between weather events
<WeatherGenerators>
<WeatherGenerator> This is our first biome
<Voxel>Sand</Voxel> The MaterialTypeName that this weather should spawn on
<Weathers>
<Weather> First possible weather for this voxel type
<Name>SandStormLight</Name> The SubtypeId of the weather event
<Weight>2</Weight> The weight of this weather event, higher values are more common
<MinLength>600</MinLength> The minimum length of the weather event
<MaxLength>900</MaxLength> The maximum length of the weather event
<SpawnOffset>1000</SpawnOffset> Spawn the center of this strom x meters away from the player
</Weather>
<Weather> Second possible weather for this voxel type
<Name>SandStormHeavy</Name>
<Weight>1</Weight>
<MinLength>600</MinLength>
<MaxLength>900</MaxLength>
<SpawnOffset>1000</SpawnOffset>
</Weather>
</Weathers>
</WeatherGenerator>
<WeatherGenerator> This is our second biome
<Voxel>Grass_dry</Voxel>
<Weathers>
<Weather> First possible weather for this voxel type
<Name>ThunderstormLight</Name>
<Weight>2</Weight>
<MinLength>600</MinLength>
<MaxLength>900</MaxLength>
<SpawnOffset>1000</SpawnOffset>
</Weather>
<Weather> Second possible weather for this voxel type
<Name>ThunderstormHeavy</Name>
<Weight>1</Weight>
<MinLength>600</MinLength>
<MaxLength>900</MaxLength>
<SpawnOffset>1000</SpawnOffset>
</Weather>
</Weathers>
</WeatherGenerator>
</WeatherGenerators>
To learn more about how to create a custom weather effect, continue here.