[Twinsen] [for 0.17] Programmable Speaker Audible Distance Bug (Minor)
Posted: Sat May 19, 2018 5:58 am
I discovered this bug while tinkering, and then immediately realized that it was going to be the reason my tinkering wasn't going to produce my desired result. I created a programmable speaker and set it to the "ring" sound tone. I also specified it to NOT play globally, as I wanted it to be harder to hear at a distance. As I was also playing in Sandbox mode, however (where we, as players, are seemingly disembodied), I was able to move away from the speaker very quickly as it played the alarm (probably more quickly than the player character can technically run away from things). I noticed that the reductions in speaker volume which naturally accompany increasing distances from said speaker only register the change when the tone initially plays, and so, does not gradually shift in volume WHILE the tone plays. So for as long as the tone instance plays, it will register no change in volume UNTIL the new instance of the tone plays. This is a small thing, except that it creates an unsolvable problem for the setup I wanted to build. I wanted an audible train warning system that uses the "ring" alarm tone, but I also wanted that tone to play continuously (not in pulses), and only while the light was red. I wanted the alarm to go off (to stop audibly ringing) as soon the light was no longer red (and not at a later time). I realize now that the "pulsing" on/off states of the alarm tone may be an unavoidable behavior given the way sound effects are calculated with distance currently. Because if the speaker volume will not gradually shift with distance, on the fly, but only update the volume change when new instances of the tone are played, then a continuous alarm tone would never change in volume with changes in distance. While I would like to have the option to have a continuous ring effect which can be turned on or off at specific intervals by design, I also realize that so long as this audible distance bug is in effect, we actually don't want continuous alarm tones, since in the case of those, volumes would never change with distance.