This is a dynamic weather module built for Roblox.
Refer to the wiki for details.
This project is a fully event-driven localized weather simulation system designed to render dynamic storms efficiently while maintaining smooth performance. Rather than relying on global weather states, every storm exists independently, allowing multiple weather systems to coexist naturally throughout the game world.
The system focuses on scalability, deterministic simulation, and client-side visual fidelity.
- 🌧️ Independent localized storm systems
- ⚡ Dynamic visual storm progression
- 🌀 Client state simulation based on environmental conditions
- ⏱️ Time-scalable weather simulation
- 🚀 Event-driven architecture
- 📦 Optimized rendering using PartCache
- 🎯 Distance-based rendering and culling
Each storm is simulated independently using an event-driven update model.
Instead of updating every frame with a traditional game loop, the simulation advances according to elapsed time measured with os.clock(). This allows storm progression to remain deterministic while avoiding unnecessary computations.
Each weather system contains a configurable TimeCycle attribute that controls the speed of the simulation.
- Higher values accelerate storm progression.
- Lower values slow the simulation.
- Visual effects remain synchronized regardless of simulation speed.
This design makes it possible to create storms that evolve at different rates without modifying the underlying simulation logic.
The client's perceived weather is determined by their proximity to rainfall rather than simply entering a predefined weather region.
The system continuously evaluates the density of nearby rain particles generated by a custom particle system.
Using the amount of rainfall surrounding the player, it can determine environmental intensity such as:
- Light rain
- Moderate rain
- Heavy rain
- Storm conditions
This approach creates smooth transitions between weather states and allows overlapping storms to blend naturally.
Rainfall is generated through a custom-built particle system instead of relying solely on built-in particle emitters.
This provides greater control over:
- Particle density
- Spawn behavior
- Simulation timing
- Collision behavior
- Weather intensity calculations
Because every rain particle contributes to nearby weather intensity, the particle simulation becomes part of the environmental simulation rather than serving only as a visual effect.
Rendering every active storm continuously would become expensive as the number of storms increases.
To solve this, the system employs two primary optimization techniques.
Storm visuals are rendered using PartCache, allowing reusable objects to be recycled instead of constantly creating and destroying instances.
This significantly reduces memory allocations and garbage collection overhead.
Storms outside the client's rendering range are ignored entirely.
Only storms close enough to affect the player are rendered and updated visually, allowing a large number of active storms to exist without unnecessary rendering cost.
The weather system follows an event-driven architecture where simulation, rendering, and client perception remain largely independent.
Storm Simulation
│
▼
Time Progression (os.clock + TimeCycle)
│
▼
Rain Particle Simulation
│
├──────────────┐
▼ ▼
Visual Rendering Client Weather State
│
▼
PartCache + Distance Culling
Separating these responsibilities makes the system easier to maintain, extend, and optimize.
The primary goals of the system are:
- High scalability
- Low runtime overhead
- Deterministic weather progression
- Smooth visual transitions
- Independent localized weather systems
- Efficient client-side rendering
- Luau
- Event-driven simulation
os.clock()timing- PartCache
- Custom particle system
This weather system combines deterministic simulation, event-driven updates, custom particle simulation, and aggressive rendering optimizations to support large numbers of localized storms while maintaining consistent visual quality and efficient runtime performance.
This module is available under the terms of the Apache License. Refer to License for details.