ent_playsound volume range

Posted By: HeelX

ent_playsound volume range - 11/27/11 15:09

Hi,

can you please make the volume/range characteristic of played entity sounds more customizable? You can have only 1000 quants as hearable distance, well, this is pretty much nothing! I am crashing very hard logs against very large pieces of metal and as soon as I orbit my camera a bit away, I can hear nothing, and, in the next moment, it is ultra-loud. Why did you limited to that?

Can you please change the behaviour? Like

ent_playsound(ENTITY*, SOUND*, var rangeMaxVolume, var rangeZeroVolume);

so that I could say e.g. in the range of x <= 256 quants it is 100% volume and in the range x >= 4000 quants it is 0% volume and inbetween the volume is linearily faded.

Best regards,
-Christian
Posted By: GreenDeveloper

Re: ent_playsound volume range - 11/27/11 15:15

Good idea.!
Posted By: Harry Potter

Re: ent_playsound volume range - 11/27/11 16:45

+1
Posted By: Superku

Re: ent_playsound volume range - 11/27/11 22:24

Yes, please! And while you're at it, please add the possibility to pass NULL as entity pointer (as previously discussed).
Posted By: Benni003

Re: ent_playsound volume range - 11/27/11 22:52

yes, this would be great. In my game I had to write my own function to set the volume of a sound dependent to the player distance. It woult be much more easier to do what HeelX say's.
Posted By: Nidhogg

Re: ent_playsound volume range - 11/28/11 03:24

Another vote for this as well thanks.
Posted By: 3run

Re: ent_playsound volume range - 11/28/11 06:29

+1
Posted By: jcl

Re: ent_playsound volume range - 11/29/11 10:45

I don't think that there is a range restriction in that function. You can set the range as high as you want. The 10,000 quants limit was for sending this function over the network only.
Posted By: Superku

Re: ent_playsound volume range - 11/29/11 11:17

Even if there's no range restriction, IMO the sound usually is too quiet when you're not near the entity. Thus HeelX' request would be a very welcome addition:
Quote:
so that I could say e.g. in the range of x <= 256 quants it is 100% volume and in the range x >= 4000 quants it is 0% volume and inbetween the volume is linearily faded.

Posted By: jcl

Re: ent_playsound volume range - 11/29/11 14:18

Ok, I'll check why it is too quiet. If there's a reason it will be fixed - and we'll also add a possibility to set the range separately from the volume.
Posted By: jcl

Re: ent_playsound volume range - 11/29/11 15:38

Update: I can not confirm anything too quiet with the sounds - if you set the range accordingly, sounds are loud within the whole level. Only with a very small range you get the problem that you describe. We'll add however a separate range parameter to the DSound and OAL functions.
Posted By: Superku

Re: ent_playsound volume range - 11/29/11 16:09

That's nice, thanks. I was not clear, though, I don't think there's a bug with 3d sounds, but I somehow dislike the limitation of a linear fade out (theoretically and physically that is how it's supposed to be, I know). Example:
One month ago I have created a tank game for my father. When an enemy tank fires and you are close, the sound is fine, but when the distance increases the sound simply feels too quiet and powerless (even though the linear fade may be theoretically correct). Increasing the sound range (a lot) has some unwanted consequences.
The same goes for the poor soldiers, I want(ed) them to scream really loud when they die and explode and are somewhat close, but it does not feel right (again way too quiet).

That's why I would like to be able f.i. to play the sound on 100% volume below a distance of 1/4 (or 1/2) range and fade out above.
I guess cosinus (transformed to interval [0,range]) could work fine as an alternative blend function, too:

© 2024 lite-C Forums