Forum

sound attenuation and calculating max distance

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

sound attenuation and calculating max distance

Postby necros » Tue Apr 27, 2010 7:00 am

given the attenuation value, can i find out the maximum distance the sound will be heard at (before stock engines will discard it and not bother starting it)?

i looked at the quake source, but honestly, i just got lost... it seems attenuation is limited to a number between 0-64 (0-63?), but that's about all i got. :S

engines like DP have fixed this 'bug', but for other engines, if a sound is started outside the audible range, the engine will just discard it and not bother starting it.
this is fine for things like explosions that are short lived, but sounds that start and loop forever obviously pose a problem.

essentially, i want to 'register' any entities that should be playing a looping sound and then periodically check if the player has entered audible range since the last check, and if so, restart the sound.

the last part is easy, but i'd prefer an accurate way of calculating maximum audible distance instead of trial+error/guesswork.

ps: i know about the svc 29 hack to spawn real ambient sounds, but i require these sounds to be able to be stopped, which cannot be done with svc 29 ambients.
necros
 
Posts: 77
Joined: Thu Dec 16, 2004 10:32 pm

solved

Postby necros » Tue Apr 27, 2010 9:49 pm

preach found the solution, if anyone's interested, the post on func about it is here: http://celephais.net/board/view_thread. ... 2&end=9762
necros
 
Posts: 77
Joined: Thu Dec 16, 2004 10:32 pm

Postby mh » Tue Apr 27, 2010 11:08 pm

There's a possibility that this value may have been higher in an earlier version of the engine; I recall seeing someone's source once where they had a comment to the effect that it was reduced from 1500, but can't remember where or who.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest