maximum number of ambient_generic? Created 6 years ago2017-05-17 13:33:13 UTC by Dallas Dallas

Created 6 years ago2017-05-17 13:33:13 UTC by Dallas Dallas

Posted 6 years ago2017-05-17 13:33:13 UTC Post #334937
Does anyone know the maximum number of ambient_generics that can be playing at once AND be audible by the player?

Can the player, say, hear 10 different .wav sounds, or will only a few of them be played and some be culled or inaudible?

Are the rules different if some of the ambient_generics are playing the same .wav?

Thanks for any input.
Posted 6 years ago2017-05-17 14:34:01 UTC Post #334938
There are 128 "channels" that all per-entity audio plays on. Whenever an entity plays a sound, it will use a channel, so up to 128 sounds can be playing at any time, excluding music started using the cdaudio entities and player voice.

If you see this message in the console with developer set to 2 or higher, you'll know you've exceeded the total number of concurrent sounds:
total_channels == MAX_CHANNELS
Posted 6 years ago2017-05-17 17:07:21 UTC Post #334939
Yeah... when you have a dm with 10 or 20 players in a small map, all the footsteps, shots, explosions, snarks can easily add up to a 100 at once
Posted 6 years ago2017-05-18 08:42:58 UTC Post #334950
Just the information I needed, thank you.

Is there a console command that lists or dumps the value of the current number of used channels?

i.e. is there a way to check how many channels you are using in game to then know how much headroom you have to work with?
Posted 6 years ago2017-05-18 09:20:57 UTC Post #334951
The soundinfo command prints current sound info to the console ("total channels" is the current number of active channels), setting s_show to 1 and running a server with maxplayers 2 or fewer prints up to 32 sounds on the right hand side of the screen.

Note that there are always 12 active channels from what i can tell, those are special ones.

The first 4 are ambient sounds (seems to be obsolete from Quake, used to be defined in BSPs but never read), then there are 8 dynamic channels. A comment from WinQuake explains this:
0 to MAX_DYNAMIC_CHANNELS-1 = normal entity sounds
MAX_DYNAMIC_CHANNELS to MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS -1 = water, etc
MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS to total_channels = static sounds
It's actually 0 to NUM_AMBIENTS - 1, then NUM_AMBIENTS to MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS - 1, then NUM_AMBIENTS + MAX_DYNAMIC_CHANNELS to total_channels.

ambient_generic plays static sounds, so there are 128 - 12 = 116 static channels available.
You must be logged in to post a response.