cmss13-devs / cmss13

Contains the code for CM-SS13
https://cm-ss13.com
GNU Affero General Public License v3.0
95 stars 526 forks source link

Sound Environment update #6620

Closed Doubleumc closed 3 months ago

Doubleumc commented 3 months ago

About the pull request

Changes to how a client's sound environment and echo is handled: https://www.byond.com/docs/ref/#/sound/var/environment https://www.byond.com/docs/ref/#/sound/var/echo

A client's soundOutput now has sole control over environment and echo. The environment is updated when the mob moves into a different area, or if the mob's environment override is set. The echo is used to enable or disable the environmental reverb per-sound.

Explain why it's good for the game

Issue: an environment applies to all sounds for that client, current and future, until another one is set. It applies to in-world sounds as well as, say, admin pings.

Solution: since an echo is applied per-sound, by adjusting the echo's Room & RoomHF fields the environmental effects can be enabled or disabled (more accurately, made so quiet as to be inaudible). This is set to off by default, and is only enabled for positional sounds. Admin pings are safe.

Idea from here: https://github.com/tgstation/tgstation/pull/55333

Testing Photographs and Procedure

Boots without issue. Sound environments change at appropriate points. Sound environments effect only positional sounds.

Changelog

:cl: code: environmental reverb applies more reliably and only to positional sounds /:cl: