HammeriteAudioSoundType
Audio. Inherits Resource
One kind of sound, as far as gameplay is concerned: how loud it is and how far it carries.
Sound types are what connect a thing that makes noise to the things that might hear it. An emitter stamps its type on what it plays; a listener says which types it cares about; and a sound is only ever propagated to a listener when the two agree. That matching is not just a filter, it is the cost control - a footstep with nothing listening for footsteps does no work at all. Keeping the numbers here rather than at each call site means "how far does a footstep carry" is a question with one answer, in one place, that a designer can retune without touching gameplay code.
Properties
| Type | Name | Default |
|---|---|---|
String | note | "" |
StringName | type_name | &"" |
float | loudness_db | 60.0 |
float | max_range | 1024.0 |
Property descriptions
note
var note: String = ""
Why it is the way it is, for whoever tunes it. Never seen by a player.
type_name
var type_name: StringName = &""
The type's name, as an emitter and a listener both refer to it. Conventionally lowercase and specific: &"footstep", &"door", &"glass_break".
loudness_db
var loudness_db: float = 60.0
How loud this kind of sound is at its source, in dB. Only ever compared against a listener's threshold after the world has taken its toll, so the scale is yours to set - what matters is that a shout and a footstep sit the right distance apart on it.
max_range
var max_range: float = 1024.0
How far this sound carries at all, in world units of path length - round corners, not as the crow flies. Beyond it a listener never hears this type, whatever its threshold. This is the primary distance control, deliberately. The propagation model's own distance attenuation is gentle by design - it is tuned for what sounds right in the mix, and caps out at 12 dB - so distance alone would almost never take a sound below a threshold. A stated range is also the thing a designer can reason about: "a footstep carries about two rooms".