momentum-mod / game

Momentum Mod - Standalone Source Movement Speedrunning (READ README)
https://momentum-mod.org
Other
525 stars 208 forks source link

Improve of sound categorizations / auto assign more Mix Group Contexts #2094

Open tsa96 opened 1 year ago

tsa96 commented 1 year ago

Me and @jason-e have been today and want to improve our handling of sound channels. We want to try to sort sound sources into different channels, such that as few maps (especially ports) as possible need tweaking with Lumper before submission.

Our UI is mostly up to date now (https://github.com/momentum-mod/panorama/pull/98), but our suggested final categories are

We're generally pretty happy with Source's soundmixers system and directory-based mix groups, especially after the work @braem did last year to set MixGroupContexts of players and ghosts. What we can't currently categorize well are map sounds, namely:

Distinguishing between sound effects and soundscapes is vital; often players will want to turn off soundscapes, which can be repetitive and irritating, and effects fired by triggers, which are far less infrequent and may have some gameplay purpose. Music is incredibly annoying, often clashing with music the player has playing on their computer, and rarely enjoyable when grinding a map for hours. Whilst we'll still allow mappers to include music in maps, it's essential that players can turn it off via the Music Volume slider.

From discussion, we should be able to separate sound fx from soundscapes and music easily. We can't just use entity type, some types use ambient_generic for soundscapes/ambient whatever, but we can straightforwardly just check what's getting called by entity IO or a logic_auto, and group those into the fx category. Practically this makes sense, the sounds that are typically more desirable to hear are ones fired by things happening within the map.

Splitting soundscapes/ambient and music seems way harder to do programmatically. We could try, but given that existing maps with music are relatively uncommon, it's probably easiest to not even bother, and just fix those up with Lumper. Given how annoying music is, this is bound to get caught during map review, and MapReviewers will know to look out for it.

I've not looked at the sound mixgroups code all that deeply, I don't know what precedent the file path/name based grouping takes vs overriding the method used for setting mix group context (being deliberately vague because engine yadda yadda), we definitely want to do the former, so that any automatic grouping that doesn't behave write can be overridden by moving the file's directory.

This issue is starting to ramble a bit. So, all we're proposing for game code changes is to go into any sound-emitting entities and assign them mix groups based on whether they're being activated by the player in some way. In any cases where that rule doesn't feel appropriate, or in cases of music files, we just adjust the map in porting with Lumper.

With that in place, we just need to write clear guides on the docs for wheremappers/porters should place sound files to get assigned the right mixer. Then, our suggested final categories for sounds are:

Channel Folder Programmatic Backup
Map Sound Effects sfx/ Anything triggered by entity IO except logic_auto
Ambient ambient/ Automatically-playing sounds[1]
Music music/
Movement player/
Weapons weapon/
Ghosts Anything from third-person ghosts[2]
UI ui/

_[1] soundscapes, ambient_generic without "start silent", any from IO activated by a logicauto

[2] Ghost sounds might also be scaled by another slider, like Movement/Weapons

We'll have a slider for VOIP eventually as well.

We should definitely try to get this done by 0.10.0, as we want map porters to be able to adjust directories whenever this system doesn't work sufficiently.