Files
VOREStation/code
VerySoft 4b80c293ad Attempt to reduce sound based lag
So, I am not sure how much this will help or hurt. 

We have noticed that, there is a lot of lag that happens under heavy radio use, and Ascian noted that the playsound proc was seriously overloaded during those times. 

Notably, presently every radio in the game uses playsound to play the radio sound any time anything sends a radio message, even if the radio in question doesn't have the channel the message was sent to. 

And if you are unaware, playsound figures out who's in range of every source of sound and their distance from its source to adjust the sounds so that it sounds like it's coming from the right place in the world. 

Problem is, if the server's decently busy, that's possibly a hundred things doing that work every time any message comes over a radio.

I thought it would be better if, since the radio systems are ALREADY doing the work of figuring out who can see the radio message, that playsound doesn't actually need to do that work again for tons of different sources. 

ADDITIONALLY, the thing to determine if the sound should be played based on preferences is also a part of playsound, meaning that it STILL RUNS PLAYSOUND EVEN IF THE PREFERENCE IS OFF

So! I used byond's direct sound thing which, I THINK just makes your client play the sound and ought to use next to no extra server resources for it. 

The only downside is that we lose pitch shifting on the radio sounds, and we lose the sense of 'audio presence' for the sounds in the world. 

In short, this means that the radio sound will just, always sound the same no matter where it is in relation to your character. If you receive a radio message, the sound will play on your client.

The sound should also only ever play once for you per message, rather than stacking like it does when lots of people/radios are in the same place. 

ASSUMING THIS WORKS HOW I THINK IT DOES, this should reduce a lot of computer work for playsound on busy shifts. (And ideally, increase performance)

This change does also use and respect the same preference that already exists for radio sounds, so there will be no change in how that works.
2022-02-20 07:15:56 -05:00
..
2022-02-13 10:17:36 -06:00
2022-02-19 19:42:32 +10:00
2022-02-20 07:15:56 -05:00
2022-02-20 10:55:32 +10:00