How to add ambient sounds to level

This tutorial will help you to understand ambient system and how it works

All levels has ambient sounds, because without them game will be silent.

Ambient manager placed at assets/gameplay/ambient_manager.json

The JSON structure of ambient object is:

ambient_manager.json
{
    "level_id":[
	"intro",
	"manikovsky",
	"forest_road"
	],
    "ambient": "amb_day1.mp3",
    "ambient_volume": -30.0,
    "ambient_bg_volume": 0,
    "random_sfx_delay": [3.75, 6.0],
    "random_sfx": [
	"ambient_sfx/rnd_bird_1.mp3",
	"ambient_sfx/rnd_bird_2.mp3",
	"ambient_sfx/rnd_bird_3.mp3",
	"ambient_sfx/rnd_bird_4.mp3",
	"ambient_sfx/rnd_bird_5.mp3",
	"ambient_sfx/rnd_bird_6.mp3",
	"ambient_sfx/rnd_crow_1.mp3",
	"ambient_sfx/rnd_crow_2.mp3",
	"ambient_sfx/rnd_crow_3.mp3"
    ],
    "background_ambients": [
	"amb_day1_bg.mp3",
	"ambient_sfx/dist_wind_1.mp3"
    ],
    "background_ambients_volumes":[
	0,
	-10.0
    ]
}
Properties description
level_id = list of levels where current ambient structure will be played
ambient = main looped music or sound file from assets/sounds/ folder (Layer 1)
ambient_volume = volume of the main ambient, where 0 is 100% and -88 is 0%
ambient_bg_volume = volume of whole "background_ambients" list
random_sfx_delay = delay between [A sec, B sec] when sfx will be randomly played
random_sfx = list of one shot sounds from assets/sounds/ (Layer 2)
background_ambients = list of loop sounds from assets/sounds/ (Layer 3)
background_ambients_volumes = optional property, overwrite volumes of layer 3 sounds

So you need to find best volume friendship between these layers to fit all sounds.

Last updated