EDF sound reference: Difference between revisions

From Eternity Wiki
Jump to navigationJump to search
(→‎Fields: Dehacked: removed outdated information. nopcsound: corrected. pcslump: rewritten)
Line 87: Line 87:
:Default = Auto
:Default = Auto
:This field allows allocating a sound to a specific subchannel, so that an actor can play several sounds at once, unlike vanilla Doom behavior. Possible values are:
:This field allows allocating a sound to a specific subchannel, so that an actor can play several sounds at once, unlike vanilla Doom behavior. Possible values are:
:*Auto
:*Auto - default sound channel
:*Weapon
:*Weapon
:*Voice
:*Voice
Line 97: Line 97:
*'''pcslump'''
*'''pcslump'''
:Default = ""
:Default = ""
:Allows associating a sound definition with a PC speaker sound lump. Normally not needed if Prefix is set to true and there is a DP* equivalent lump to DSlumpname.
:Allows associating a PC speaker sound lump with this sound definition. Required if the sound does not use a DS or DP '''prefix''' or if the DP* version of the lump is missing.
*'''nopcsound'''
*'''nopcsound'''
:Default = false
:Default = false
:If set to false, forces the sound not to be played under PC speaker settings.
:If set to true, forces the PC sound to NOT be played even if a valid lump exists for this entry. Default Doom monster pain and active sounds have this flag set to true.
*'''dehackednum'''
*'''dehackednum'''
:Default = -1
:Default = -1
:In order to be accessible to thing and frame definitions, a sound definition must be given a unique DeHackEd number. The value zero is reserved and cannot be used. In order to avoid conflict, and to remain compatible with future versions of the Eternity Engine, user sounds should either use DeHackEd numbers between 10000 and 32768, or simply use the value -1 if no thing/frame or DeHackEd access is necessary. As of EDF 1.6, if a sound with no DeHackEd number is used by name (such as with the "sound:" prefix in a misc or args field), the game engine will automatically allocate a unique DeHackEd number to the sound. The previous behavior was to print a warning to the verbose EDF log and set the sound field in question to "none". This eliminates most need to assign and keep track of DeHackEd numbers yourself.
:In order to be accessible to Dehacked patches, a sound definition must be given a unique DeHackEd number. The value zero is reserved and cannot be used. In order to avoid conflict, and to remain compatible with future versions of the Eternity Engine, user sounds should either use DeHackEd numbers between 10000 and 32768, or simply use the value -1 if no thing/frame or DeHackEd access is necessary.

Revision as of 08:41, 8 February 2010

The EDF Sound block defines sounds to be used in the game. They are linked to the sound lumps included in wads, and the default Doom and Heretic entries have the same names as the lumps, minus the DS prefix (for Doom).

Syntax

sound <mnemonic>
{
  lump          = <string>
  prefix        = <boolean>
  singularity   = <singularity class>
  priority      = <number>
  link          = <sound mnemonic>
  alias         = <sound mnemonic>
  random        = <sound mnemonic list>
  skinindex     = <skin index type>
  linkvol       = <number>
  linkpitch     = <number>
  clipping_dist = <number>
  close_dist    = <number>
  pitchvariance = <pitch variance type>
  subchannel    = <subchannel class>
  pcslump       = <string>
  nopcsound     = <boolean>
  dehackednum   = <number>
}

Fields

  • lump
Default: If a value is not provided to this field, then this sound's mnemonic will be copied directly to this field. In this case, the default value for the prefix field becomes "true". This means that the mnemonic will be prefixed with the "DS" prefix to construct the final sound lump name. If an explicit value is provided to this field, then the default value of the prefix field becomes "false". This means the lump name, as provided, becomes the final sound lump name and will not be prefixed in any way.
The lump field indicates the lump name that this sound resource will have in WAD files. If the prefix field below is true, the prefix "DS" will be appended to this name when looking for the sound. Otherwise, this name will be used exactly as it is provided. In the event a sound is not found, a default sound for the current game mode (DSPISTOL in DOOM, GLDHIT in Heretic) will be played instead.
  • prefix
Default = Depends on presence of lump field
This boolean field indicates whether to prefix the lump name with DS when searching for this sound's lump. Values of false/no/off mean that the lump will not be prefixed. Values of true/yes/on mean that it should be prefixed. If the lump field is provided, the default value of this field changes from true to false.
  • singularity
Default = sg_none
This field indicates a singularity class for this sound. If another sound of the same singularity class is playing when this sound is played, the former will be stopped. This is used to implement appropriate player sound behavior in an extensible and modifiable manner. The possible values for the singularity class are as follows:
  • sg_none
  • sg_itemup
  • sg_wpnup
  • sg_oof
  • sg_getpow
  • priority
Default = 64
This field establishes a relative priority for this sound. When sounds must be stopped in order to start new ones, those with the lowest priority will be replaced first. Priority scales down with distance, so sounds playing at higher volume or closer to the player have priority over quieter and more distant sounds. Please note carefully that a higher value in this field means a lower priority. So 0 is the highest priority possible, and 255 is the lowest priority (priorities lower than 255 will be capped into range).
  • link
Default = "none"
This field links this sound definition to another existing sound definition. Its value must either be "none," or another valid sound mnemonic. When a linked sound is played, the sound that is linked to will be played instead, using the linkvol and linkpitch parameters provided in this sound entry. All parameters for playing the sound, including priority, singularity, pitch variance, and clipping distances come from this sound definition, and not from the sound to which this one is linked.
  • alias
Default = "none"
This field causes this sound definition to become an alias for another existing sound. Its value must either be "none," or another valid sound mnemonic. When this sound is played, the aliased sound will be played instead, using all the data defined in the aliased sound (when an alias references another alias, the resolution is done recursively until a non- aliased sound is found).
  • random
Default = no list
This fields allows this sound to have random alternatives when it's played. Include the list of sound mnemonics, separated by commas, within curly braces.
  • skinindex
Default = sk_none
This field indicates a player skin sound index for this sound. If the player object plays this sound, it will become subject to remapping through the player's skin. The following values are possible for skin index, and each corresponds to one of the fields in the extended Legacy skin format:
  • sk_none
  • sk_plpain
  • sk_pdiehi
  • sk_oof
  • sk_slop
  • sk_punch
  • sk_radio
  • sk_pldeth
  • sk_plfall
  • sk_plfeet
  • sk_fallht
  • linkvol
Default = 127 (full volume)
This field provides a value to be added to the sound's volume when a linked sound is played through this sound definition. Volume range is from 0 to 127, but this field may be any value. The resulting value when added to the base volume will be capped into range. For example, if a sound normally plays at full volume, specifying a negative value in this field will reduce the volume.
  • linkpitch
Default = 127 (normal)
This field provides a pitch value to be used when a linked sound is played through this sound definition. Pitch values should be between 0 and 255 when provided.
  • clipping_dist
Default = 1200
This value specifies the distance from the origin at which this sound will be completely clipped out; that is, reduced to zero volume and therefore killed completely. The sound engine currently only considers an approximate distance on the X-Y plane, so this behavior may be slightly more rough than expected. The value of this field should be greater than the value of the close_dist field below. If not, the sound will always be played at full volume (this can be intentionally exploited).
  • close_dist
Default = 200
This value specifies the distance from the origin at which this sound will be at full volume. Attenuation between the clipping_dist and close_dist values is currently always linear. The sound engine currently only considers an approximate distance on the X-Y plane, so this behavior may be slightly more rough than expected. The value of this field should be less than the value of the clipping_dist field above. If not, the sound will always be played at full volume (this can be intentionally exploited).
  • pitchvariance
Default = none
This field allows specification of the type of pitch variation this sound plays with when pitched sounds are enabled. The following values are allowed:
  • none -- No pitch variation
  • Doom -- Pitch variation similar to that used in DOOM v1.1 for most sounds
  • DoomSaw -- Pitch variation similar to that used for saw sounds in DOOM v1.1.
  • Heretic -- Pitch variation similar to that used in Heretic
  • HereticAmbience -- Pitch variation similar to that used in Heretic for global ambience.
In general, DOOM types provide less variation than Heretic types. Note that Eternity has now repaired some bugs in the BOOM sound pitch variation code, and so the effect works much better than it did previously.
  • subchannel
Default = Auto
This field allows allocating a sound to a specific subchannel, so that an actor can play several sounds at once, unlike vanilla Doom behavior. Possible values are:
  • Auto - default sound channel
  • Weapon
  • Voice
  • Item
  • Body
  • SoundSlot5
  • SoundSlot6
  • SoundSlot7
  • pcslump
Default = ""
Allows associating a PC speaker sound lump with this sound definition. Required if the sound does not use a DS or DP prefix or if the DP* version of the lump is missing.
  • nopcsound
Default = false
If set to true, forces the PC sound to NOT be played even if a valid lump exists for this entry. Default Doom monster pain and active sounds have this flag set to true.
  • dehackednum
Default = -1
In order to be accessible to Dehacked patches, a sound definition must be given a unique DeHackEd number. The value zero is reserved and cannot be used. In order to avoid conflict, and to remain compatible with future versions of the Eternity Engine, user sounds should either use DeHackEd numbers between 10000 and 32768, or simply use the value -1 if no thing/frame or DeHackEd access is necessary.