Page 1 of 1

Fix ambient sound never starting

Posted: Fri Apr 17, 2015 11:26 am
by Baker
In about any typical normal Quake engine, set the host_maxfps or whatever to 999999. Do "map start".

You should hear wind howling. But you likely won't.

In snd_dma.c there is something like this:

Code: Select all

chan->master_vol +=  (int)(host_frametime * ambient_fade.value)
host_frametime can be a very small number with high frame rates. The (int) part will round it to zero.

I don't have a perfect + non-complicated solution, that code is supposed to fade it in. If you are running high frame rates, you could make sure it increases by a minimum of 1. Or you could implement a more complicated solution and accumulate some time.

I don't know what the "right" solution is. Ambient fade has a default value of 100, a consistent fps over 100 is unlikely to allow the sound to progress until something causes an fps drop. Quake was meant to run at 20 fps (or was it 10?). So maybe it was meant to take 10 seconds?

Re: Fix ambient sound never starting

Posted: Fri Apr 17, 2015 12:52 pm
by Spike
tbh I'm not sure anyone would really mind if those sounds were removed right now. they're too loud, too annoying, and flood through too much of the map, imho.
standing on the start spot, what I hear is both ambience/water1.wav and ambience/wind2.wav
that single spot has both full volume water+sky ambient volumes. which kinda demonstrates all that is wrong with leaf-based ambient sounds - its just noise.
most qw players use ambient_level 0 - many of them without even realising that this isn't even the vanilla default.

that += bug works both ways. you can also find yourself stuck with high ambient noise even in areas that should have none.

the fix I used was to do the += using a float instead (and then copy that into the master_vol value). you'd need a muuuuch higher framerate for any issues then.

Re: Fix ambient sound never starting

Posted: Fri Apr 17, 2015 7:02 pm
by Baker
Heh I agree with all of that!

1) Yeah, ProQuake has a "no ambient sounds" setting in preferences.
2) Likewise, I removed the "int"