Sounds¶
Most sounds are fields of Data Assets, and a few are Class Defaults of a Blueprint. An empty field leaves the action silent and raises no error, so you can replace the sounds one at a time.
Steps¶
- Import your sound and give it the Sound Class of its bus:
SCL_Effectsfor the world,SCL_UIfor the interface,SCL_AmbienceorSCL_Music. They are all inContent/ZombieSurvival/Audios/Mix/. - Set it in the field that plays it, from the tables below.
- Save.
Data Asset fields¶
| Asset class | Fields | What they play |
|---|---|---|
PDA_WeaponDef |
AttackSound, HitSound, ReloadSound |
A swing, an impact, the start of a reload |
PDA_ItemDef |
PickupSound |
Picking the item up |
PDA_ZombieDef |
AttackSound, MoanSounds, AlertSound, DeathSound, BiteSound, ObstacleHitSound |
A zombie's voice, its death, a bite, a blow on a door |
PDA_BuildableDef |
PlaceSound |
Placing a piece |
PDA_MedicineDef |
UseSound |
Taking a medicine |
PDA_FallSettings |
LandingSound |
A fall that hurts |
PDA_FirearmSettings |
DryFireSound, UnjamSound |
An empty gun's click, a cleared jam |
PDA_ActionDef |
Sound, bLoopSound |
A timed action, such as climbing, racking a gun or sewing. With bLoopSound ticked it loops for the length of the action; otherwise it plays once. |
PDA_AudioSettings |
FootstepSounds, FootstepDefault |
A step, by the physical material under the feet |
PDA_AudioSettings |
MusicDay, MusicNight, MusicTension |
The three music beds |
Class Defaults¶
Set these in the Blueprint's Class Defaults, or on one placed door or window in its Details panel.
| Blueprint | Fields |
|---|---|
BP_Openable |
LockedSound, OpenSound, CloseSound |
BP_Window |
GlassBreakSound, CutSound, GlassRemoveSound, CurtainsSound |
BP_Fence |
RattleSound (when a crowd starts pushing), CollapseSound |
Weather and statuses¶
The weather has its own sounds, all fields of
DataAssets/Environment/Childs/DA_WeatherSettings_Default:
- four loops,
RainLoopSound,WindLoopSound,BirdsLoopSoundandInsectsLoopSound, with a volume each andInsideAmbienceScalefor indoors; - two thunder claps,
ThunderNearSoundandThunderFarSound.
They are not positioned, so the shared attenuation does not apply to them.
The template ships with no ambience. The four volumes are at 0 and the two thunder fields are empty.
So are the three distant events of DA_WorldSettings_Default (GunfireSound, ScreamSound,
HeliSound). The generator's hum and the two alarms have no sound on their component: Hum of
BP_Generator, AlarmAudio of BP_HouseController and of BP_VehicleBase. The sounds made for
them ship in Audios/ (SW_Ambience_*, SW_Thunder_*, SW_Distant_*, SW_Heli_Loop,
SW_Generator_Loop, SW_Alarm_Loop, SW_Vehicle_Alarm). Plug them back in, or plug in your own.
The status sounds are in DataAssets/Status/Childs/DA_StatusVoices_Default: the breath, the cough,
the sneeze, the cry of pain and the heartbeat, with their intervals.
How far a sound carries¶
Every cue plays through one shared attenuation, Audios/SA_Default. DefaultAttenuation in
DataAssets/Audio/Childs/DA_AudioSettings_Default names it.
| Distance from the survivor | Volume |
|---|---|
| up to 600 uu | full |
| 1800 uu | -20 dB |
| 3000 uu | -40 dB |
| 4200 uu | -60 dB |
| beyond 4200 uu | not played |
Past 600 uu a cue loses 10 dB every 600 uu. Change SA_Default and every sound changes range with
it.
The function library Blueprints/Core/BFL_ZSAudio plays every sound. Its PlayCueAt passes the
shared attenuation, so a cue's own Attenuation Settings are ignored. To give one cue its own
falloff, change GetCueAttenuation in the same library first. To use another settings asset, make
your own child of PDA_AudioSettings and point BP_ZSGameInstance.AudioSettings at it.
Cues are heard from the survivor. BP_ZSPlayerController moves the audio listener onto him when it
possesses him, and keeps the camera's orientation. The listener offset is the length of the
CameraBoom, read once at possession, so set the listener again if you change that length during
play.
Volume buses¶
Every shipped sound goes through a bus. The sound waves of the game use SCL_Effects, the steps
included. Those of the weather, in Audios/Ambience/, use SCL_Ambience, and the three music beds
use SCL_Music.
A sound with the class of a bus follows that bus's volume, set in BusVolumes of
DA_AudioSettings_Default (all 1.0). BP_ZSGameInstance.ApplyAudioBuses applies the volumes when a
game or the main menu starts. Players set one volume per bus on the AUDIO page of OPTIONS,
and their local profile keeps it.
The three shipped music beds carry their own Volume on the sound wave (0.45, 0.35 and 0.7). Set
the Volume of your own tracks the same way and leave the music bus at 1.0.
In co-op¶
Every machine plays the cue itself, at the same place. A sound that comes with a change of state, such as a door opening or an action in progress, plays when that state reaches each machine. A player who joins after the change does not hear it.
Test it¶
- Set your sound on the
PickupSoundof an item, for example. - Open
Content/ZombieSurvival/Maps/L_Worldand press Play. - Press T and type
/give <ItemSaveId>, drop the item, and pick it up with E. The sound plays. - Walk away from a moaning zombie to hear the falloff of the shared attenuation.
If it does not work¶
- The volume options do not change your sound: it has no Sound Class. A sound left without a class plays at full volume, outside every bus.