Using the entities AmbientVolume and RandomSoundVolume attached to area shapes, one can create convincing sounding environments. This example will take you through the process of setting up a sound event and getting your own sound in the engine. It will also include some important interface steps, which will be used throughout the chapter. The following screenshot is an example of an ambience setup in the forest example level from the Free SDK:
To get your first sound into engine, we must first open FMOD Designer, which is the tool we will use to create our sound events for the CryENGINE.
ToolsFmodDesignerfmod_designer.exe
.mygame_environment.fdp
and save this project under the game directory in game/sound/mygame_environment/
.You will notice that a default event group and event will be created in your project.
Now that we have our event, we need to give the event a sound to play.
sounds/mygame_environment/cave_ambience.wav
ensuring Loop mode is set to Looping, as seen in the following screenshot:The next step is to now add some parameters to the sound. These parameters will be adjusted by the engine and will trigger different effects, which we will add onto the sound.
spread
.Having assigned a parameter to this sound for the engine to modify, we must now add some effects that will change the way the sound is played, depending on the values of the spread
parameter coming from the sound system.
The New Effect window will appear and a large list of effects will be available to assign to the layer.
These effects, in combination with the spread parameter, adjust how the sound behaves as you approach or leave the area shape.
We must now build our project so that the sound is compressed and the event is created for use within the editor application or launcher.
.wav
audio into a .fsb
format and the sound event into a .fev
file and will output a message when completed successfully.Now that we have the formats, we require to play back the sound within the CryENGINE. Let's place this sound into a level so that we can iterate and try different settings for effects!
Sounds/mygame_environment/Cave/
and select the cave_ambience event.Note that you can preview the sound as well as the way it reacts to different parameters within the Sound Browser using the sliders and Play button, as seen in the following screenshot:
Double-click on the cave_ambience sound file, and it will then be assigned to the AmbientVolume entity. Now we are ready!
s_SoundInfo=1
that will display the all playing sounds and some debugging and profiling tools.If everything is working correctly, you will hear the sound as well as see, using s_soundinfo
, that the entry 3d sounds/mygame_environment:cave:cave_ambience is playing.
You'll now notice that whenever you approach or enter that area shape, the ambient sound will play.
20
.The area shape will now limit the vertical dimensions of the AmbientVolume entity.
Congratulations! You have learned many different skills in this example. We successfully created a new FMOD project, created an event group, added an event, assigned sound to that event, and finally added some effects and parameters for this event. We even went so far as to build our project and get our sound working in the engine!
We can use looping sound events as background ambient sounds in levels. These are typically 3D sounds, which reside within the confines of an area shape. When the player enters the area shape, the ambient sound travels with the player becoming, in effect, a surround sound. Once the player leaves the shape, the sound is left behind on the perimeter of the area shape.
Try using some of the other Entity Properties of AmbientVolume. As with any entity within the CryENGINE, AmbientVolume has some properties that can easily be adjusted in the editor, as seen in the following screenshot:
Some of these properties are:
true
, by default, and means that ambient volumes will be culled by distance, and if separated by VisArea.18.226.88.110