You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Back in the original Notrium, the underlying engine had a limit on the number of sounds played simultaneously, which had a curious effect on rapid-fire guns and fires. With the transition to SDL, this limit was removed, but now we get some uncomfortable distortion when lots of fires or continuous sounds coexist. An example: simply have the player stay among many fires (such as the first room in the Hermit's house), and you will notice this.
Is there anything that can be done to alleviate this? I'm not sure if we have 3D sound working right now, but maybe we need a bit more than this.
The text was updated successfully, but these errors were encountered:
It seems that the volume and pan for each sound are calculated here. The original version worked just as well as what we have right now, with the exception of not supporting as many sounds at the same time. This actually helped cut some noise in places with lots of sounds, but now it's something we should fix properly. I suggest we pick a more advanced solution to 3D audio, such as OpenAL.
So as discussed on Gitter a while ago, I first suggested that we limit the number of sounds being reproduced at the same time (therefore attempting to replicate the behaviour of 1.4.2). What I first noticed is that our current code makes dynamically allocated mixing channels, so that new channels would be created when all of them are full.
This didn't seem right, so I tried removing that logic and keeping the number of mixing channels to a lower number. With values of 6 and 8, the distortion becomes slightly less noticeable, but this will also prevent any incoming sound samples from being played if the channels are full.
Note that this isn't the original behaviour: in Ville's Notrium, there is some sort of mechanism that prevents the same sound from being played too many times (3 I think) in a short period of time. That makes me wonder how sound is handled there, and what we are missing to achieve this.
I also think that the ambient sounds occur much more frequently in this version (bird chirps, winds, alien growls, ...). I wonder what parts of the code handle this...
Back in the original Notrium, the underlying engine had a limit on the number of sounds played simultaneously, which had a curious effect on rapid-fire guns and fires. With the transition to SDL, this limit was removed, but now we get some uncomfortable distortion when lots of fires or continuous sounds coexist. An example: simply have the player stay among many fires (such as the first room in the Hermit's house), and you will notice this.
Is there anything that can be done to alleviate this? I'm not sure if we have 3D sound working right now, but maybe we need a bit more than this.
The text was updated successfully, but these errors were encountered: