Reaction to Material Types

From The DarkMod Wiki
Jump to navigationJump to search

Originally written by Ishtvan on

For details of surface types, reactions, sounds, etc. see Surface Types

Here is a link to some iddevnet and D3World tutorials on making different sounds and impact types for different surfaces (wood, stone, etc.)

This should be useful to Domarius for doing different weapon sounds and reactions when striking different surfaces, and it should also be useful for our sound guys if they want to put in different footstep sounds themselves:

D3World Threads:

Quote from iddevnet:

10/28/04 How materials affect sounds Brian

Inside the material declaration, you can put one of sixteen different surface types, ten of which are predifined types:

  • none,
  • metal,
  • stone,
  • flesh,
  • wood,
  • cardboard,
  • liquid,
  • glass,
  • plastic,
  • ricochet.

The other six are generic: surftype10, surftype11, surftype12, surftype13, surftype14, surftype15

The surface type in the material determines which sound is played for footsteps, projectile hits, and other types of impacts.

The footstep sound is determined by looking at the surface type for the material under the actor. For example, if it is "flesh" then the "snd_footstep_flesh" sound in the actor entityDef is played. If that sound is not defined then "snd_footstep" is played instead. In Doom 3, we don't actually use this feature (all footsteps play the same sound).

The projectile impact sounds are handled the same way. If a fist hits a material with "glass" set, then the "snd_glass" sound is played from the "weapon_fist" entityDef. If that sound is not defined then it uses "snd_metal". If that sound is not defined either then it uses "snd_impact". If that sound is not defined then it plays nothing.

This is all defined inside the game code. As a mod author, you can completely change up this entire system. To see where this is all defined, search the code base for "sufaceTypeNames".