Page 1 of 2

speed of sound

Posted: 2008-09-28 22:32
by zangoo
I am suggesting a simple change, That

sound.setProperty distance-delay-factor 1

is changed to

sound.setProperty distance-delay-factor 0.8823529

As right now the speed of sound is 300m/sec and with this change it would be the correct 340m/sec.

the mathz now for the ppl that want it.

so here is the code

rem ** Distance delay
rem ** Shortest distance from listener where distance delay will be applied
sound.setProperty distance-delay-threshold 5
rem ** Delay multiplier (1 means 1/300 s/m)
sound.setProperty distance-delay-factor 1

so (300/340)* 1 = 0.08823529

1/340 = 0.002941176
0.08823529/300 = 0.002941176

Re: speed of sound

Posted: 2008-09-28 22:37
by Scot
ARGH!! MATHZ!! BRAIN EXPLODEE!!!

But yeah, if it's as simple as changing one line of code, why not?

Re: speed of sound

Posted: 2008-09-28 22:53
by Scot
Nicko that's not the point, if I'm reading the post right. He is saying(i think) that by changing one line of code, we get the real life 'value' as it were for the speed of sound.

Re: speed of sound

Posted: 2008-09-29 00:09
by DeltaFart
Yeah man you don't read. He's saying it's too slow.

Re: speed of sound

Posted: 2008-09-29 00:30
by Jaymz
I'll implement this, thanks zangoo.

Just be aware, any sound with a loop count of "0" (ie, automatic fire) completely bypasses the sound delay system and travels instantly.

Re: speed of sound

Posted: 2008-09-29 01:20
by DeltaFart
cant you make it have a sound delay then?

Re: speed of sound

Posted: 2008-09-29 01:28
by Jaymz
DeltaFart wrote:cant you make it have a sound delay then?
Nope. It's not that simple.

Re: speed of sound

Posted: 2008-09-29 01:40
by DeltaFart
Dahm....Well it was worth asking

Re: speed of sound

Posted: 2008-09-29 01:54
by hiberNative
question.

did you noticed the 40m difference by ear, or did you time this just to check if it was correct?
or did you stumble over the faulty code?

Re: speed of sound

Posted: 2008-09-29 02:20
by Gaven
Nice catch.

Re: speed of sound

Posted: 2008-09-29 02:24
by crazy11
hiberNative wrote:question.

did you noticed the 40m difference by ear, or did you time this just to check if it was correct?
or did you stumble over the faulty code?
He was probably doing one of his crazy projects like the ballistics.

Re: speed of sound

Posted: 2008-09-29 03:07
by WildBill1337
is there a way to make automatic weapon sounds have the correct speed? its just one of those irritating things.

Re: speed of sound

Posted: 2008-09-29 05:45
by Jaymz
WildBill1337 wrote:is there a way to make automatic weapon sounds have the correct speed? its just one of those irritating things.
It was especially irritating while I was trying to hack distant sounds into the BF2 engine back in 0.7 development. What could be done, is to attach the firing sounds to the muzzle effects so that each firing sound is processed independently (this is how the distant sounds in PR work).

But that means duplicating muzzle effects for every single weapon (ie, I would have no life for a week or so). It would also double the amount of audio voices PR uses, and trust me when I say we already use a lot.

Re: speed of sound

Posted: 2008-09-29 05:59
by Proff3ssorXman
We want MOAR DAMMIT!!!

Nah, sounds sweet tho - the closer to realism the better

Re: speed of sound

Posted: 2008-09-29 13:26
by zangoo
thank you jonny for pointing out that mistake. And i didnt find this by ear, i was just looking around the files like i normally do and found this.

Re: speed of sound

Posted: 2008-09-29 14:18
by Waaah_Wah
'[R-DEV wrote:Jaymz;813079']It was especially irritating while I was trying to hack distant sounds into the BF2 engine back in 0.7 development. What could be done, is to attach the firing sounds to the muzzle effects so that each firing sound is processed independently (this is how the distant sounds in PR work).

But that means duplicating muzzle effects for every single weapon (ie, I would have no life for a week or so). It would also double the amount of audio voices PR uses, and trust me when I say we already use a lot.

Re: speed of sound

Posted: 2008-09-29 14:31
by Harrod200
Waaah_Wah wrote:
/agree

Re: speed of sound

Posted: 2008-09-29 16:07
by Hitperson
wait a min speed of sound is 330ms-1