Difference between revisions of "HPL3/Areas/SoundScape Area"

From Frictional Wiki
Jump to navigation Jump to search
(Undo revision 6730 by Lil alex (talk) saved to wrong article by mistake)
Tag: Undo
m (updated code formatting)
 
(5 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
== Overview ==
 
== Overview ==
  
The soundscape area is meant to be a sort of one-in-all solution to set up much of the needed background sound data. It can set reverb, play ambient track, change volume on sounds and turn on/off sound entities. Make sure you know how the areas work before start placing sounds in a level.
+
The Soundscape Area is a volume entity that when entered by the player, can play ambient sounds and music, as well as set up and configure reverb and background sound data. Many soundscape areas can overlap, if the background sound is identical then the areas will act as if they are one entity.
  
 
== Features ==
 
== Features ==
  
 
=== Reverb ===
 
=== Reverb ===
Reverb is pretty basic and just do what the settings say. If there are many reverb areas that overlap then the one with the highest prio will be used. However, note that if Reverb is not active for an area, then it will not be taken into account at all, no matter what the prio is set to. So if you want an area that turns off reverb, then it needs to have reverb active and type set to "off".
 
  
=== Sound ===
+
* '''UseReverb''': Enables reverb data
The soundscape area can start sounds as the player's head enters the area. There are two types of these Sound entities and Background sounds.
+
* '''ReverbType''': Which reverb setting to use.
 +
* '''ReverbPrio''': Priority of the reverb effect, higher values override overlapping soundscapes.
 +
* '''ReverbAmount''': The Amount of reverb to be used. Values can be greater than 1.
 +
* '''ReverbFadeTime''': The amount of time to fade into this reverb effect in seconds.
  
The sound entities are sounds that are already placed in the level and they will be either started/stopped when the player is in or out of the area. If two areas over lap and are of the same level then the one with the highest prio will be used. This means that if the areas have different levels, then sound entities from many areas can be played (or not played) at the same time.
+
{{tip|If '''UseReverb''' is not enabled for an area, then it will not be taken into account at all, regardless of prio. If you want an area to disable reverb, then it needs to have '''UseReverb''' active and type set to ''off''.}}
  
Background sound is just a 2D sound that is started when an area is entered. Prio is used to determine what sound to use if many of the same level overlap. However, if many of different level overlap, then the behavior gets very interesting. What happens then is that the background sounds from lowered numbered levels will get lowered according to the ParentVolMul setting in the higher numbered ones. This is meant to simulate the background noise getting lowered as you step inside a house or similar. For instance, if the player is inside one Global (0) area and one Room (2) area, then the background sound will from the Global one will be lowered according to ParentVolMul in the Room one. This multiplying is applied all through the hierarchy, so if the player is inside areas from levels 0 -> 3, then any sound in level 0 will be multiplied by the setting in 1,2 and 3 all taken together.
+
=== General Sound ===
 +
The Soundscape area can start playing a 2d sound as the player's head enters the area. '''Prio''' is used to determine what soundscape area to use if many of the same '''Level''' overlap. However, if many areas of different '''Level''' overlap then the background sounds from smaller '''Level''' values will get lowered according to the '''ParentVolMul''' setting in the higher '''Level''' areas. This is meant to simulate the background noise getting lowered as you step inside a house or similar. For instance, if the player is inside one ''Global (0)'' area and one ''Room (2)'' area, then the background sound from the ''Global (0)'' area will be lowered according to '''ParentVolMul''' in the ''Room (2)'' area. This multiplying is applied all through the hierarchy, so if the player is inside areas from levels 0 -> 3, then any sound in level 0 will be multiplied by the setting in 1, 2, and 3 together.
  
=== Prefix ===
+
* '''Prio''': Priority of the soundscape, higher values override overlapping soundscapes.
This can be really used for whatever and is currently used for playing different kinds of footsteps. It applies an extra parent folder to the footstep to be played if the variable is not empty. It can also be used by script function Sound_CreateAtEntity_UsePrefix to easily play different sounds depending on which soundscape area the player currently is in.
+
* '''Level''': The hierarchy of what each soundscape in a level is meant for. Lower level soundscapes are activated instead of higher levels when soundscapes overlap.  
  
== Notes ==
+
=== BackgroundSound ===
 +
* '''BG_Sound''': the sound file to play when entering a soundscape. Looping sounds are recommended.
 +
* '''BG_Volume''': The volume of the sound.
 +
* '''BG_FadeInTime''': Time in seconds it takes to fade in the sound.
 +
* '''BG_FadeOutTime''': Time in seconds it takes to fade out the sound.
 +
* '''BG_FadeTransitionSpeed''': The speed at which a sound fades in or out when a parent volume is changed.
 +
* '''BG_ParentVolMul''': A multiplier for any parent background sounds that are active.
  
'''Use copies of an area to cover complex shapes'''<br />The soundscape areas are built to behave nicely when many soundscapes with the same properties overlap. It is often a hassle to fill certain rooms with areas without going out of bounds. With Soundscape areas this is easy as the game will treat overlapping areas with the same properties as essentially the same area. So there is no start/stopping going on when going between areas that have the same sound names, etc
+
=== Connected Sound Entities ===
 +
Soundscape Areas can play two distinct types of sounds, sound files designated in Sound Entities and 2D background sounds.
 +
Sound entities that are placed in the level can be either started or stopped when the player is inside or outside of the area. If two areas overlap and are of the same '''Level''' then the area with the highest '''prio''' will be used. Note that if the areas have different '''Level''' values, then sound entities from many areas can be played (or not played) at the same time.
 +
 
 +
* '''SoundEnt_InNames''': Sound Entities to begin playing when entering the soundscape or stop playing when exiting the soundscape.
 +
* '''SoundEnt_OutNames''': Sound Entities to begin playing when exiting the soundscape or stop playing when entering the soundscape.
 +
* '''SoundEnt_FadeInTime''': Time in seconds to fade in attached sound entities.
 +
* '''SoundEnt_FadeOutTime''': Time in seconds to fade out attached sound entities.
 +
 
 +
=== SoundPrefix ===
 +
In Soma this setting is used to play different versions of footstep sounds however this can be used for other reasons. It does this by applying an extra parent folder to the sound file to be played if the variable is not ''[None]''. The script function <code> Sound_CreateAtEntity_UsePrefix()</code> can be used to easily play different sounds depending on which soundscape area the player currently is in.
 +
 
 +
* '''SoundPrefixPrio''': The priority of the SoundPrefix, higher values override overlapping soundscapes.
 +
* '''SoundPrefix''': The prefix to be added to the sound effect path. ''[None]'' will not add a prefix.
 +
 
 +
=== Attachment ===
 +
* '''ParentAttachEntity''': The name of an entity that this soundscape is parented to.
 +
* '''ParentAttachUseRotation''': If the rotation of the parent should affect the soundscape.
 +
* '''ParentAttachBody''': The name of the body in the parent entity to attach to.

Latest revision as of 21:58, 25 January 2024

Soundscape Area

Overview

The Soundscape Area is a volume entity that when entered by the player, can play ambient sounds and music, as well as set up and configure reverb and background sound data. Many soundscape areas can overlap, if the background sound is identical then the areas will act as if they are one entity.

Features

Reverb

  • UseReverb: Enables reverb data
  • ReverbType: Which reverb setting to use.
  • ReverbPrio: Priority of the reverb effect, higher values override overlapping soundscapes.
  • ReverbAmount: The Amount of reverb to be used. Values can be greater than 1.
  • ReverbFadeTime: The amount of time to fade into this reverb effect in seconds.
Icon tip.png Tip: If UseReverb is not enabled for an area, then it will not be taken into account at all, regardless of prio. If you want an area to disable reverb, then it needs to have UseReverb active and type set to off.

General Sound

The Soundscape area can start playing a 2d sound as the player's head enters the area. Prio is used to determine what soundscape area to use if many of the same Level overlap. However, if many areas of different Level overlap then the background sounds from smaller Level values will get lowered according to the ParentVolMul setting in the higher Level areas. This is meant to simulate the background noise getting lowered as you step inside a house or similar. For instance, if the player is inside one Global (0) area and one Room (2) area, then the background sound from the Global (0) area will be lowered according to ParentVolMul in the Room (2) area. This multiplying is applied all through the hierarchy, so if the player is inside areas from levels 0 -> 3, then any sound in level 0 will be multiplied by the setting in 1, 2, and 3 together.

  • Prio: Priority of the soundscape, higher values override overlapping soundscapes.
  • Level: The hierarchy of what each soundscape in a level is meant for. Lower level soundscapes are activated instead of higher levels when soundscapes overlap.

BackgroundSound

  • BG_Sound: the sound file to play when entering a soundscape. Looping sounds are recommended.
  • BG_Volume: The volume of the sound.
  • BG_FadeInTime: Time in seconds it takes to fade in the sound.
  • BG_FadeOutTime: Time in seconds it takes to fade out the sound.
  • BG_FadeTransitionSpeed: The speed at which a sound fades in or out when a parent volume is changed.
  • BG_ParentVolMul: A multiplier for any parent background sounds that are active.

Connected Sound Entities

Soundscape Areas can play two distinct types of sounds, sound files designated in Sound Entities and 2D background sounds. Sound entities that are placed in the level can be either started or stopped when the player is inside or outside of the area. If two areas overlap and are of the same Level then the area with the highest prio will be used. Note that if the areas have different Level values, then sound entities from many areas can be played (or not played) at the same time.

  • SoundEnt_InNames: Sound Entities to begin playing when entering the soundscape or stop playing when exiting the soundscape.
  • SoundEnt_OutNames: Sound Entities to begin playing when exiting the soundscape or stop playing when entering the soundscape.
  • SoundEnt_FadeInTime: Time in seconds to fade in attached sound entities.
  • SoundEnt_FadeOutTime: Time in seconds to fade out attached sound entities.

SoundPrefix

In Soma this setting is used to play different versions of footstep sounds however this can be used for other reasons. It does this by applying an extra parent folder to the sound file to be played if the variable is not [None]. The script function Sound_CreateAtEntity_UsePrefix() can be used to easily play different sounds depending on which soundscape area the player currently is in.

  • SoundPrefixPrio: The priority of the SoundPrefix, higher values override overlapping soundscapes.
  • SoundPrefix: The prefix to be added to the sound effect path. [None] will not add a prefix.

Attachment

  • ParentAttachEntity: The name of an entity that this soundscape is parented to.
  • ParentAttachUseRotation: If the rotation of the parent should affect the soundscape.
  • ParentAttachBody: The name of the body in the parent entity to attach to.