

Sound effect attenuation in video games? - ucee054

Dear HN,<p>Can anyone please give me pointers or references
on the following question?<p>In video games today, if a player is distant
from a noise source, how is the noise reduced?
At what point is the source not played?<p>I am trying to understand how distance based
priotization and culling of game objects
should work.<p>The motivation for my question is far away
game objects (such as big explosions) that
should still not be culled because they are
so loud as to be heard even at great distance.<p>Many Thanks
======
evincarofautumn
The intensity of a sound in an ideal gas is proportional to 1/r^2, where r is
the distance between the sound source and the sound receiver (in a game, the
player). Specifically, I2 = I1 * (r1 / r2)^2. You can use L = 10 log_10
(I2/I1) dB to determine acoustic intensity levels in decibels. Long story
short, if you want to cull sound sources, you need to do it based on both
distance (well, squared distance, which is thankfully less expensive to
calculate) and sound volume.

Even that is an oversimplification: in reality, attenuation varies with every
material surrounding the sound source, because it’s actually the result of the
pressure wave being scattered and absorbed.

I’m sure GameDev.net must have some reference articles on this…

~~~
ucee054
Many Thanks. What is meant by r1 and r2?

(Checked out gamedev already, couldn't find anything. The norm for culling
seems to be visibility not audio.)

------
kstenerud
Have a look at the OpenAL specification, section 3.4.

[http://connect.creativelabs.com/openal/Documentation/OpenAL%...](http://connect.creativelabs.com/openal/Documentation/OpenAL%201.1%20Specification.htm)

~~~
ucee054
Many Thanks.

If I understand the OpenAL spec right, there are alternative attenuation
models, inverse square as well as exponential decay.

Do you have any pointers where I can find under which circumstances which
model is valid? I can't see anything on the spec or the IASIG PDF.

~~~
kstenerud
Exponential is the most "correct", but often it doesn't actually sound good in
a game, so people will opt for inverse distance or even linear. Basically, it
comes down to experimentation in your particular environment and deciding
which model "sounds" best.

~~~
ucee054
Many Thanks

