# How to add ambient sounds to level

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

Ambient manager placed at <mark style="color:orange;">assets/gameplay/ambient\_manager.json</mark>

The JSON structure of ambient object is:

{% code title="ambient\_manager.json" %}

```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
    ]
}
```

{% endcode %}

{% code title="Properties description" %}

```ini
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
```

{% endcode %}

<figure><img src="/files/gO44Xk0w0Op4pFXVJTqJ" alt=""><figcaption><p>Structure of ambient system</p></figcaption></figure>

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

{% hint style="warning" %}
Make sure, that "level\_id" list contains level id only for one ambient structure, because if two or more structures contains same level id, game will choose first structure and ignore others!
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://picnic-in-the-oblivion.gitbook.io/assets/modding/how-to-add-ambient-sounds-to-level.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
