Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Sound effect attenuation in video games?
1 point by ucee054 on Dec 6, 2011 | hide | past | favorite | 6 comments
Dear HN,

Can anyone please give me pointers or references on the following question?

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?

I am trying to understand how distance based priotization and culling of game objects should work.

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.

Many Thanks



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…


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.)


Have a look at the OpenAL specification, section 3.4.

http://connect.creativelabs.com/openal/Documentation/OpenAL%...


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.


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.


Many Thanks




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: