A procedural rain and thunderstorm simulator built with Python, Pygame, NumPy, and SciPy. Features multi-layer parallax rainfall, particle splash physics, fractal branching lightning strikes, and real-time procedural audio synthesis.
The project's README from github.com/AhmadHassan-BTed/rain_generator. As one markdown file: README.md.
A procedural rain and thunderstorm simulator built with Python, Pygame, NumPy, and SciPy. Features multi-layer parallax rainfall, particle splash physics, fractal branching lightning strikes, and real-time procedural audio synthesis.
Clone the repository:
git clone https://github.com/azuletto/rain_generator.git
cd rain_generator
Install dependencies:
pip install -r requirements.txt
(Optional) Install in editable mode:
pip install -e .
Run via the main launcher:
python thunderstorm_simulator.py
Or via module execution:
python -m rain_generator
python -m rain_generator --preset thunderstorm --fullscreen
python -m rain_generator --preset drizzle --mute -W 1280 -H 720
Available options:
-p, --preset: Weather preset (drizzle, steady, thunderstorm, gale, cozy)-i, --intensity: Intensity level (Low, Medium, High, Extreme)-f, --fullscreen: Launch in fullscreen mode-m, --mute: Launch with audio muted-W, --width: Window width in pixels (default: 1080)-H, --height: Window height in pixels (default: 720)--fps: Target framerate (default: 60)--no-shake: Disable camera shake on lightning-d, --duration: Audio export duration in seconds (default: 60)-o, --export: Output filepath to generate and export audio directly without GUIGenerate an ambient audio file of any custom length (e.g. 2 minutes of thunderstorm audio):
python thunderstorm_simulator.py --duration 120 --export thunderstorm_2m.wav --preset thunderstorm
You can also click the Export Audio button in the top HUD (or press G) while running the simulator to open the interactive generator dialog.
| Key | Action |
|---|---|
F / F11 |
Toggle Fullscreen mode |
Space |
Pause / Resume simulation |
M |
Mute / Unmute audio |
G |
Open Audio Track Generator dialog |
H |
Toggle HUD visibility |
L |
Trigger manual lightning bolt and thunder |
1 - 5 |
Switch presets (1: Drizzle, 2: Steady, 3: Storm, 4: Gale, 5: Window) |
S / Tab |
Open Settings and Audio Mixer dialog |
? / / |
Open Keybindings help dialog |
Esc |
Close open dialog or exit simulation |
Run the test suite using pytest:
pytest
This project is licensed under the MIT License. See LICENSE for details.
A procedural rain and thunderstorm simulator built with Python, Pygame, NumPy, and SciPy. Features multi-layer parallax rainfall, particle splash physics, fractal branching lightning strikes, and real-time procedural audio synthesis.