-
Notifications
You must be signed in to change notification settings - Fork 0
Project Structure
Understanding the file layout of the Dynamic Ambient System.
Required — The main system class.
Contains:
-
DynamicAmbientSystemclass - Channel registration
- Volume management
- Timer handling
- Save/load support
# Automatically creates the ambient instance
default ambient = DynamicAmbientSystem()Required — Track definitions.
Defines:
- All audio tracks (mandatory and random)
- Track parameters (volume, fade times, etc.)
- Main theme configuration
See: Audio-Assets-YAML
Required — Arrangement definitions.
Defines:
- Audio scene presets
- Layer configurations
- Auto-transitions
See: Arrangements-YAML
Automatic main menu integration.
Features:
- Starts ambient when main menu shows
- Stops ambient when leaving main menu
- Handles quit cleanup
screen main_menu():
on "show" action Function(renpy.call_in_new_context, "start_main_menu_ambient")
on "hide" action Function(store.ambient.stop_ambient)Settings UI screen.
Provides:
- Volume slider
- System status display
- Track information
- Control buttons (start/stop/pause/resume)
- Debug statistics
Access via: Settings → Ambient Settings
Debug overlay screen.
Shows real-time:
- Active tracks and volumes
- Current arrangement
- Wave system state
- Timer counts
Toggle with: ambient debug ui
Creator-Defined Statements implementation.
Enables native Ren'Py commands:
ambient play "arrangement_name"
ambient stop
ambient layer "layer" onRequires: Ren'Py 8.5.0+
See: CDS-Reference
game/
├── audio/ # Your audio files
│ ├── ambient_base.ogg
│ ├── effect1.ogg
│ ├── effect2.ogg
│ └── main_theme.mp3
│
├── libs/ # Library extensions
│ └── rpda/
│ └── 02-rpda-cds.rpy # CDS implementation
│
├── python-packages/ # Python dependencies
│ └── yaml/ # PyYAML library
│ ├── __init__.py
│ ├── loader.py
│ └── ...
│
├── dynamic_ambient.rpy # Core system (REQUIRED)
├── ambient_auto_start.rpy # Auto-start (optional)
├── ambient_integration.rpy # Settings UI (optional)
├── debug_ambient.rpy # Debug overlay (optional)
│
├── audio_assets.yaml # Track config (REQUIRED)
├── arrangements.yaml # Arrangements (REQUIRED)
│
├── script.rpy # Your game script
├── screens.rpy # Your screens
└── ...
Ren'Py loads files in this order:
-
init python early — CDS registration (
02-rpda-cds.rpy) -
init python — Channel registration, system class (
dynamic_ambient.rpy) -
default — Instance creation (
ambient = DynamicAmbientSystem()) -
YAML loading — Configuration loaded in
__init__
The 02- prefix ensures CDS loads before other init blocks.
- OGG Vorbis — Recommended for all ambient tracks
- MP3 — Acceptable for main theme
- WAV — Not recommended (large file size)
- Mandatory tracks should be seamlessly loopable
- Random tracks can be one-shot or looping
- Use audio editing software to create clean loops
audio/
├── amb_forest_base.ogg # Mandatory base layer
├── amb_forest_birds.ogg # Random effect
├── amb_forest_wind.ogg # Random effect
├── amb_city_traffic.ogg # Different location
├── sfx_thunder.ogg # One-shot effect
└── mus_main_theme.mp3 # Main theme
For the smallest footprint, you only need:
game/
├── python-packages/yaml/
├── dynamic_ambient.rpy
├── audio_assets.yaml
├── arrangements.yaml
└── audio/your_tracks.ogg
Everything else is optional enhancement.
RenPy Dynamic Ambient System v2.0.0 | Home | Installation | Quick Start | FAQ