Skip to content

Creating and Bundling Custom Weather

Custom weather in WeatherRegistry is distributed through Unity AssetBundles with a special .weatherbundle extension. This allows for easy distribution and loading of weather assets.

Follow these steps to bundle your custom weather:

First, create a WeatherDefinition asset in your Unity project. This ScriptableObject contains all the configuration for your custom weather, including:

  • Weather name and type
  • Visual effects and parameters
  • Weather variables (if applicable)
  • Associated effects and behaviors

Create an AssetBundle in Unity with the .weatherbundle extension:

  1. Select your WeatherDefinition asset in the Unity Editor
  2. In the Inspector, set the AssetBundle name at the bottom (e.g., YourWeather.weatherbundle)
  3. Build the AssetBundle using Unity’s build pipeline or a custom build script
  4. Ensure the WeatherDefinition is included as the primary asset in the bundle

Place your compiled .weatherbundle file anywhere within the BepInEx/plugins directory, for example:

  • BepInEx/plugins/YourWeatherMod/YourWeather.weatherbundle
  • BepInEx/plugins/YourWeather.weatherbundle
  • Any subdirectory within plugins/

WeatherRegistry will automatically scan and load all .weatherbundle files when the game starts.

A typical weather bundle should contain:

  • WeatherDefinition
  • ImprovedWeatherEffect (auto-included)

The rest of the assets should be automatically included as dependencies of the WeatherDefinition, i.e.:

  • Prefabs
  • Materials
  • Audio Clips
  • Keep bundle sizes reasonable by optimizing textures and audio
  • Test your weather in-game before distribution
  • Include fallback assets for missing dependencies
  • Document any special requirements or compatibility notes