Fix ambient sound never starting
Posted: Fri Apr 17, 2015 11:26 am
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:
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?
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)
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?