OpenMW/openmw — pull request #393 by scrawl (2014-12-08 23:05:19+00:00)
Title: Sounds

This fixes the excessively high ambient sound volume in many game areas. The culprits were:
- For whatever reason, MW developers decided that sounds played with the playloopsound3d script functions use a hardcoded max distance of 2000 units, ignoring the value specified in the ESM records.
- Pointed out by chris that MW is using the inverse distance model, openmw was using linear (which fades more slowly).

The change to the distance model revealed more issues:
- When switching between third and first-person the volume of footsteps would change noticeably. I fixed this by attaching the sound listener to the player head instead of the camera position, as is in vanilla MW.
- NPC voices were too silent. Currently their sound emitter is placed at the reference position (i.e. the feet), meaning the listener is never particularly close to it. This was fixed by using the correct sound minimum fading distance for voices from the GMST store (fAudioVoiceDefaultMinDistance).

The goal of this PR is to achieve vanilla behaviour (with all its quirks). Later on we could improve on that behaviour, i.e. fade sounds that are approaching their max distance rather than cutting them off abruptly, but we have to be careful not to change the overall volume by too much.

I've tested a few areas and can not notice any important differences to MW, but more testing is always appreciated.

For review by @kcat