Jump to content
The Dark Mod Forums

EFX discussion


Springheel

Recommended Posts

Is there a set of sounds that we already know aren't affected by EFX?

 

Are they unaffected because of some setting in their sound shaders?

 

Or is the EFX code looking at the attributes of the sound itself (mono vs. stereo) to decide whether to apply EFX?

Link to comment
Share on other sites

EFX code is not looking at anything, I'm afraid.

 

 

There are many "effects", one effect per EFX file entry.

There is a single "auxilliary effect slot" called "listenerSlot" (see snd_world.cpp).

As far as I understand the OpenAL system, you attach an effect to a slot (using alAuxiliaryEffectSloti with AL_EFFECTSLOT_EFFECT), and then you send any sound sources into this slot to get them affected.

 

Look where "listenerSlot" is used in snd_world.cpp.

Excluding Init and Shutdown, there are only two other places:

 

Here engine sets the effect for the slot:

// only update if change in settings
if (listenerEffect != effect || justReloaded) {
  common->Printf("Switching to EFX '%s' (#%u)\n", s.c_str(), effect);
  listenerEffect = effect;
  soundSystemLocal.alAuxiliaryEffectSloti(listenerSlot, AL_EFFECTSLOT_EFFECT, effect);
}

And here the sound sources are sent to the slot:

if (idSoundSystemLocal::useEFXReverb) {
    if (enviroSuitActive) {
        alSourcei(chan->openalSource, AL_DIRECT_FILTER, listenerFilter);
        alSource3i(chan->openalSource, AL_AUXILIARY_SEND_FILTER, listenerSlot, 0, listenerFilter);
    }
    else {
        alSource3i(chan->openalSource, AL_AUXILIARY_SEND_FILTER, listenerSlot, 0, AL_FILTER_NULL);
    }
}

I see no checks around this piece of code, so it seems that every OpenAL source is sent into the slot and is affected by the EFX effect.

 

 

Link to comment
Share on other sites

At the moment, even things like "objective complete" sounds are being affected by EFX.

 

Anyone object to me moving this to the public forums? It would be useful to have Judith's input on this, as he's digging into all the EFX spawnargs.

  • Like 1
Link to comment
Share on other sites

It would be useful to have Judith's input on this, as he's digging into all the EFX spawnargs.

 

I'm afraid there is nothing like "EFX spawnargs".

 

He is investigating the parameters in EFX file.

EFX file can only specify location where each effect is applied, it does not allow to set any conditions like "affect only such sounds".

Link to comment
Share on other sites

Thanks Spring for including me. AFAIK, EFX is affecting all the sounds, only the game menu is excluded.

 

Edit:

 

There seems to be general agreement that EFX is currently affecting sounds that it shouldn't affect, like gui sounds. But we've had no discussions about what the full list of unaffected sounds will be, or how mappers will specify this. For example, what about ambient sounds? Clearly we don't want it to affect ambient music, but what about ambient noises? Many of these, like the random sewer sounds of rats, already have strong reverb baked in and might sound too distorted if affected by EFX. But not all do. How does a mapper have EFX affect some ambient sounds but not others?

 

I don't think that's possible, as Stgatilov mentioned. EFX is just a set of parameters for modelling acoustic profiles of rooms or spaces in game levels. I have no idea about coding, coding sound included, but the first thing that came to my mind is that if sounds are affected by EFX, then they must be played within 3d space, and not on another "layer". Thief 3 called "2D sound" everything that was played in "players head", and back when EAX worked in Thief 3, those sounds were not affected. Maybe that's the problem, aren't UI sounds played from a speaker attached to the player model or something?

Edited by Judith
Link to comment
Share on other sites

My first idea, if the system is really going to be blind to the entire category of GUI / ambient / out-of-world sounds, is to opt them out in the code by the file name and have a spawnarg somewhere that allows mappers to opt their custom sounds out in the same way.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

I guess, with EFX, sounds are like textures: They normally should not include any shadows or reverb baked in.

It should be possible to exclude sound shaders from EFX in sound shader files and by setting spawn args in DR. Mission authors will probably use both methods depending on whether they add custom sounds or recycle existing ones. Also might need to implement a way to disable EFX for sounds in GUIs.

 

A blacklist might be good for a temporary quick fix until the real solutions got built in.

Link to comment
Share on other sites

If I understand correctly, EFX is based on the location system in that it checks, where the player is and then applies the respective effects to all sounds. Would it be possible to check instead, which sounds are in an area and apply the respective effects on only these sounds? This way it would not affect any menu sounds (as these are not in any area) and would also not break any old missions as long as the location system is not used and/or EFX is not defined for any missions.

Link to comment
Share on other sites

If I understand correctly, EFX is based on the location system in that it checks, where the player is and then applies the respective effects to all sounds.

 

Yes.

 

Would it be possible to check instead, which sounds are in an area and apply the respective effects on only these sounds?

 

No. EFX is an external, third-party system for modeling reverb, and that applies to everything in a 3d space. Game menu is considered 2d so EFX doesn't apply to it. My guess is that we need some kind of invisible gui/windowDef in game that would play "2d sounds" like music, player monologue, player grunts and UI sounds. Thief 3 system wasn't bad in that regard.

 

On more general note, as we discussed it a bit in another thread, I think the current way we use sounds is a bit messy.

 

For now, SFX works like master volume, as it turns down player and AI footsteps, voices, music via location system and sounds placed in the speakers within the level, etc. Ambient volume affects both music via location system and sounds placed in speakers on the map, so it's kind of useless.

 

IMO, from player perspective, we need more self-explanatory system, i.e. channels, and volume sliders like Music, SFX, Speech, and Video. E.g. (as in Dishonored 2):

 

Music affects menu music and mission background music (i.e. the one played through our equivalent of location system, and not placed in a speaker in the map). SFX slider affects all UI and menu sounds, player footstep sounds, and basically all sounds placed in the map. Speech affects internal monologue, voices of AIs placed in the map, and player grunts.

 

 

So in a long run, we'd have sound channels for playing and adjusting the volume properly, and on another level, distnction between 2d and 3d for EFX.

I guess there's no way around it, it will be a pain in the ass to make it work :/

 

 

Edit: that would also mean more ordered approach to how we use sounds in our maps. Things like adding music in a speaker and setting it to s_global 1 would be considered a hack, and not the usual workflow.

Edited by Judith
Link to comment
Share on other sites

No. EFX is an external, third-party system for modeling reverb, and that applies to everything in a 3d space. Game menu is considered 2d so EFX doesn't apply to it. My guess is that we need some kind of invisible gui/windowDef in game that would play "2d sounds" like music, player monologue, player grunts and UI sounds. Thief 3 system wasn't bad in that regard.

Too bad :(

 

 

IMO, from player perspective, we need more self-explanatory system, i.e. channels, and volume sliders like Music, SFX, Speech, and Video. E.g. (as in Dishonored 2):

 

 

So in a long run, we'd have sound channels for playing and adjusting the volume properly, and on another level, distnction between 2d and 3d for EFX.

I guess there's no way around it, it will be a pain in the ass to make it work :/

I agree. However, it will be difficult to not break older missions, if any sound definitions get changed. Maybe some system would be possible that allows for a spawnarg that defines sounds as 2D or 3D, and causes sounds to be either sent through GUI (for 2D) or not (for 3D). If this is set to 2D by default, missions without EFX would not be affected, but later missions can use the system. I want to stress that I have no idea if/how this is possible from a coding point of view. I am just brainstorming how the system might work without affecting older missions.

 

Redefining the sound sliders for a more intuitive system would be great, but again, this might break missions or would require to update the speakers of older missions. I fear this will not be easy to achieve without compromising older missions. On the other hand, depending on how thorough the mappers themselves have worked so far, it is possible that many sounds were set up in a "workaround style" like you described and do also not work too well with the current slider setting. I have not played around with the sliders too much, so I can't really tell...

  • Like 1
Link to comment
Share on other sites

I agree that the sound system is a bit of a mess, but there's a limit to what we can do that wouldn't require updating 100+ missions.

 

As far as the EFX issue goes, I like Demagogue's suggestion. Is it possible to limit EFX by file name, or folder name (as all our ambient music is in a single folder)?

  • Like 1
Link to comment
Share on other sites

IMO older missions won't be affected, because they don't use EFX system at all, and it only affects sounds placed in map.

 

So actually the opposite would be better: all sounds should be set to 3d by default. That's because the subset of sounds needed to be labelled as 2d is much smaller: player VO, player grunts (hmm.. not sure about this one), UI sounds, background music for the location system — that's basically it.

 

I agree that channels and sliders are more broad perspective and it should be left as is right now; let's work within more reasonable scope.

Edited by Judith
  • Like 1
Link to comment
Share on other sites

The menu sounds are not affected because they live in separate idSoundWordLocal. So their sounds are completely independent.

All the rest is affected by EFX.

If does not matter whether sound is spatialized (i.e. has 3d location) or not (i.e. is just ambient thing without location): weapon sheathing is not spatialized, but it is still affected by EFX.

 

It is not hard to selectively disable EFX for some sounds.

At the moment where we need to decide whether to apply EFX effect or not (see the code snippet above), we have access to:

  • idSoundChannel
  • idSoundShader: all parameters (min/max distance, volume, shakes, soundShaderFlags, soundClass), shader filename, even description (e.g. "Made by comp-music"),
  • idSoundSample (the one being played + all described in sound shader): filename, format, size, whatever.

We can set any rules we want there --- there is no technical problem.

As a proof, I have disabled EFX on all non-spatialized sounds in svn rev 7333. But I'm not sure that it is a good idea.

 

  • Like 3
Link to comment
Share on other sites

There are several possibilities for EFX setting:

 

1. Mark sound shader which must not be affected with special "soundClass".

soundClass is already parsed by TDM.

Here is description about sound classes (only classes 0, 1, 2, and 3 are possible now):

// sound classes are used to fade most sounds down inside cinematics, leaving dialog
// flagged with a non-zero class full volume
const int SOUND_MAX_CLASSES = 4;

2. Set a flag in sound shader of existing type.

Here is the list of all flags currently parsed by sound shader:

  • no_dups
  • no_flicker
  • looping
  • no_occlusion
  • private
  • antiPrivate
  • playonce
  • global
  • unclamped
  • omnidirectional

 

3. Add a new flag, which we would set in sound shader to disable EFX effects on sounds.

Just invent a name for this flag (different from existing ones), and I'll add it --- that's simple.

 

  • Like 4
Link to comment
Share on other sites

IMO all sounds from:

tdm_sfx_game

tdm_ambient_ambience_zoned

tdm_ambient_ambience_zoned02

 

Also tdm_sfx_thunder, as those are pretty loud and have their own reverb, so we don't blow up people's eardrums with these ;)

 

There's also the question of player grunts in tdm_player. At least some of these should be excluded from EFX too. Maybe the "quiet" ones, like food crunches, heartbeat, mantle, rustle, crouch, pickup_body, hmm, drink_potion, drown?

Link to comment
Share on other sites

IIRC some of the ambients are actually in-world sounds, like wind or distant chatter, etc. In-world sounds should still be subject to EFX.

 

Some could be ambiguous, in world or out of world, like hums or ambients that also play natural sounds, or you know a mapper might have one playing on a record player. But I suppose in these cases, if the player wants to override the default no_EFX settings they can just set it to "0" on their soundshader or location entity.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

From theoretical perspective, each sound which is physically present in the game world and is emitted close to the player must be affected by EFX.

The following things should not be affected: the internal "thoughts" of the player, in-head player sounds, generic ambients, menu + inventory + objective sounds, probably even distant sounds like storm.

The following things should be affected: weapon unsheathing, probably rats sounds + every sound which may be heard by guards.

 

As for body shouldering sound, we have to decide if it is in-head sound or not.

If it is not heard by guards, then it would be more logical to consider it "in-head" or "helper" sound and exlude it from EFX.

EDIT: listened to shouldering sound, it seems to be a technical thing (like inventory sounds), not a physically present sound.

 

As for weapon switching, I'm not sure if this is a real sound in the world, or just a "helper" sound to tell player that the weapon is changed.

Link to comment
Share on other sites

Weapon switching or inventory sounds (like drinking a potion or dropping a flashbomb) should be affected by EFX.

 

The rustling sound of shouldering a body should be affected by EFX. The "uh-uh" sound when the player cannot drop a body should not be, as it would be in the player's head.

  • Like 1
Link to comment
Share on other sites

Added support for "no_efx" keyword in SVN rev 7337, binaries updated in SVN rev 15109.

 

Everything is ready for the sound shaders review.

Recall that you can type "reloadDecls" in TDM console to update sound shaders without reloading TDM.

 

Theoretically, the engine allows overriding some sound properties on sound emitter by setting spawn args (e.g. s_volume or s_omni).

I did not change anything there, so it is currently not possible to override no_efx setting.

Even if I add support, it would be one-way: spawnarg can turn EFX-affected sounds into no_efx sounds, but not vice versa.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 0 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...