Jump to content
The Dark Mod Forums

Sound


rich_is_bored

Recommended Posts

I have "attenuation due to diffraction" working on the sound waves to the player.

 

Does anyone know what a good loss value should be per degree of direction change? I searched the web but couldn't find any simulation suggestions. I found a lot of absorption coefficients for materials, but for us the material is unknown because we don't have the point of reflection, but are simulating it with the angular diffraction.

 

For the lack of anything else, I've started with a loss of 5db for a diffraction angle of 90 degrees. A 7db loss halves the volume.

 

I'd like this to be more accurate, so I'm asking for suggestions.

 

As a side note, the amount of attenuation varies depending on the frequency of the sound. Higher frequencies will attenuate more than lower. But I've no way to know what frequencies are involved in each sound, and I don't know how to apply any filters on a sound before it's fed to the hardware.

  • Like 1
Link to comment
Share on other sites

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Frequency is a concern for another time. You'll be able to apply envelopes to the sound in the future if we ever get EFX working and that will solve that problem.

 

Instead, just play with values and go with what feels good. You can throw these values into CVars if you like. Then we can all play around and find a good default.

  • Like 1
Link to comment
Share on other sites

I wouldn't touch the AI hearing unless you fancy another round of AI hearing tests and gameplay tuning.

 

I tried increasing the value to 20db but I was not experiencing directional attenuation as I could tell. Could be that the older map I played didn't have proper sound Portals setup. I'm not the best tester for this anyway, I am not as sensitive to this as others are... But I'll try again tomorrow.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

 

As SteveL said, when there are multiple sound paths to the player, the virtual speaker origins on the visportals and their virtual volumes are averaged into a single speaker and volume. The only adjustment to try, then, is whether this sounds different than having each of the virtual speakers play the sound simultaneously at their virtual volumes.

 

Technically, if you have f.i. 3 small windows, one would hear the same sound three times with different delays from each of the windows. If TDM only places one virtual speaker at the average position, you hear the sound only once. This difference might be in some occasions very noticable, as the delay (and frequency changes) are what humans are trained to notice.

 

A test for that would be to place a walking AI behind some wall with openings and let him walk along and see if you can pinpoint his location by sound only, or if the location seems to jump or is unclear.

 

With one average speaker, this might be more difficult to do than with three virtual speakers. (although I'm not sure if TDM does even simulate the delay for each virtual speaker? Is the sound always played without delay?)

 

The same might be true for the typical "you are in a room and an AI walks by the open door" scenario. Without the "sound gets muffled by angle" adjustment, it might be hard to know what the AI is doing by listening only. Does he walk from left to right, or right to left?

 

So, there are a few things that might be changed, roughly in order of difficulty:

 

* the "muffle by angle" as you already noted (I fear frequency changes are out of our league, tho). This would mean the AI gets progressively louder as he walks to the door opening, and then gets less loud again.

* delay the sound by distance (even small delays might be noticable).

* represent multiple sound paths by multiple speakers, each one muffled and delayed accordingly

 

We could also just re-used a 3D sound engine, if possible, but not sure if there is one available for free, and it's the same order of difficulty like "replace the physics engine".

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

This is just plain frustrating.

 

Greebo has already made a working prototype of EFX sound fixes with proper spacial characteristics but it isn't merged

because we need to vet the code for precision problems caused by MSVC 2013.

 

Seeing lots of mind-share dedicated to re-implementing what might already be possible in EFX just boils my noodles.

 

I can see that Grayman is being pragmatic and working on "a practical workaround in the interim" but we would probably in much better shape if the EFX code

were up on Github where it could be dissected by MSVC specialists outside the core team.

 

If I had any vote I would say "don't touch or think about sound code until EFX is merged" but that's me. I am fine with v2.03 sticking around for awhile and don't need

to see another TDM release for the sake of keeping to a yearly schedule. We will still get complaints about the lack of spatial reverb. We will still get complaints about

poor 64-bit Linux support and poor Pulse audio integration (etc). We will still be getting complaints about the need to workaround 32-bit libraries.

 

It's a thankless task. I appreciate the work being done (and so will most of the current fans of the project), but will it help with critical Let's Play outsiders? Who knows.

  • Like 2

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Is EAX/EFX really provide better 3D audio if the underlying computations of sound locations are not complete? I though it provides only effects (e.g. hall, reverb), looking at wikipedia I don't see how it would solve some of the issues.

 

E.g. maybe EAX allows you to "dampen" the sound (simulating the reflection of it around a wall) and to delay it (simulating a longer path), but the computation of the sound source/location and multiple paths don't see to be part of EAX/EFX:

 

https://en.wikipedia.org/wiki/Environmental_audio_extensions

 

Basically, the audio engine would still need to have a primitive 3D mapping (which we simulate coarsely with visportals) to determine which sound can be heard from where, and EAX only provides a means to make the hardware manipulate the sound according to the current environment. At least that's how I understand it.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

EAX applies uniformly inside a portal leaf, so it's set by environment in that sense.

I wouldn't say it's *only* for effects. With all the options, you can get really nuanced.

 

I think it'd be noticeable and important (in a good way), e.g., in the transition from walking between inside and outside, as soon as you cross the door threshold (which you notice in real life), or walking into a bathroom (wet) or closet (closed and dry), etc...

I don't think it's critical everywhere, but for certain rooms and transitions from one room type to another, a little EAX makes a big difference to feeling the space.

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

since you guys are speaking of EAX, could anyone explaim me, how to get EAX working, btw. does it apply in any TDM FM, or just in few? I have creative x-fi xtreme music + win8.1x64, alchemy seems not to make EAX work, with both enabled or disabled OpenAL. I saw a vid, someone showing how EAX is sounding in DarkMod, and i wish it would work by me too^^ Sry. for offtop.

Edited by Alex-X-x
Link to comment
Share on other sites

I see EAX mentioned a lot, but I assume were refering to EFX thats part of OpenAL..?

 

I wonder the same thing, IMO if you guys are talking of EFX is better to forget the EAX name, just to not cause confusion.

 

since you guys are speaking of EAX, could anyone explaim me, how to get EAX working, btw. does it apply in any TDM FM, or just in few? I have creative x-fi xtreme music + win8.1x64, alchemy seems not to make EAX work, with both enabled or disabled OpenAL. I saw a vid, someone showing how EAX is sounding in DarkMod, and i wish it would work by me too^^ Sry. for offtop.

 

EDIT: It seems Bikerdude made a typo so EAX is indeed dead so forget it, will leave the tut below tho, perhaps it will apply to EFX as well.

 

 

 

Forget EAX it will be removed in the next TDM version, if you don't mind, it indeed works, and you want to implement it, then you need to do this: Put in every "Room" an info_location (with the name of the EAX sound space ex: "small_room"), and an overlaping info_location_separator on every portal that separates them, if a room has more than one portal you need to put a info_location_separator in all of them , then you need to make a new folder called "efxs" in the TDM base, make a simple yourmapname.txt file change the extention to yourmapname.efx and place the below code in it. You can tweak the EAX valious and make other "room" sound spaces of your own, for example a underwater sound space. You also need to make sure s_useEAXReverb and s_useOpenAL are both set to 1 (requires restart).

.

Version 1

// reverb small_room
reverb "small_room" {
"environment" 26
"environment size" 1.0000
"environment diffusion" 0.5000
"room" 0
"room hf" -1081
"room lf" 0
"decay time" 1.1969
"decay hf ratio" 0.9228
"decay lf ratio" 1.0370
"reflections" 140
"reflections delay" 0.0260
"reflections pan" 0.0000 0.0000 0.0000
"reverb" -1200
"reverb delay" 0.0000
"reverb pan" 0.0000 0.0000 0.0000
"echo time" 0.0750
"echo depth" 0.6220
"modulation time" 4.0000
"modulation depth" 0.0000
"air absorption hf" -5.0000
"hf reference" 5000.0000
"lf reference" 250.0000
"room rolloff factor" 0.0000
"flags" 0
}


// reverb corridors
reverb "corridors" {
"environment" 26
"environment size" 1.7795
"environment diffusion" 0.4803
"room" 0
"room hf" -393
"room lf" 0
"decay time" 2.4504
"decay hf ratio" 0.1299
"decay lf ratio" 1.1921
"reflections" 220
"reflections delay" 0.0000
"reflections pan" 0.0000 0.0000 0.0000
"reverb" 299
"reverb delay" 0.0134
"reverb pan" 0.0000 0.0000 0.0000
"echo time" 0.0805
"echo depth" 0.0000
"modulation time" 0.3650
"modulation depth" 0.0000
"air absorption hf" -5.0000
"hf reference" 5000.0000
"lf reference" 250.0000
"room rolloff factor" 0.0000
"flags" 0
}



// reverb small_corr
reverb "small_corr" {
"environment" 26
"environment size" 1.7795
"environment diffusion" 0.4803
"room" 0
"room hf" -393
"room lf" 0
"decay time" 2.4504
"decay hf ratio" 0.1299
"decay lf ratio" 1.1921
"reflections" 220
"reflections delay" 0.0000
"reflections pan" 0.0000 0.0000 0.0000
"reverb" 299
"reverb delay" 0.0134
"reverb pan" 0.0000 0.0000 0.0000
"echo time" 0.0805
"echo depth" 0.0000
"modulation time" 0.3650
"modulation depth" 0.0000
"air absorption hf" -5.0000
"hf reference" 5000.0000
"lf reference" 250.0000
"room rolloff factor" 0.0000
"flags" 0
}



// reverb small_room_2
reverb "small_room_2" {
"environment" 26
"environment size" 1.0000
"environment diffusion" 0.5000
"room" 0
"room hf" -10000
"room lf" -10000
"decay time" 1.1969
"decay hf ratio" 0.9228
"decay lf ratio" 1.0370
"reflections" 140
"reflections delay" 0.0260
"reflections pan" 0.0000 0.0000 0.0000
"reverb" -1200
"reverb delay" 0.0000
"reverb pan" 0.0000 0.0000 0.0000
"echo time" 0.0750
"echo depth" 0.6220
"modulation time" 4.0000
"modulation depth" 0.0000
"air absorption hf" -5.0000
"hf reference" 5000.0000
"lf reference" 250.0000
"room rolloff factor" 0.0000
"flags" 0
}



// reverb outside
reverb "outside" {
"environment" 26
"environment size" 8.0157
"environment diffusion" 0.7874
"room" 0
"room hf" 0
"room lf" -551
"decay time" 1.5102
"decay hf ratio" 0.7134
"decay lf ratio" 0.3094
"reflections" -2291
"reflections delay" 0.0898
"reflections pan" 0.0000 0.0000 0.0000
"reverb" -2251
"reverb delay" 0.0945
"reverb pan" 0.0000 0.0000 0.0000
"echo time" 0.1659
"echo depth" 0.7087
"modulation time" 1.4120
"modulation depth" 0.2756
"air absorption hf" -5.0000
"hf reference" 5000.0000
"lf reference" 250.0000
"room rolloff factor" 0.0000
"flags" 0
} 
Edited by HMart
Link to comment
Share on other sites

 

 

I wonder the same thing, IMO if you guys are talking of EFX is better to forget the EAX name, just to not cause confusion.

 

 

EDIT: It seems Bikerdude made a typo so EAX is indeed dead so forget it, will leave the tut below tho, perhaps it will apply to EFX as well.

 

 

 

Forget EAX it will be removed in the next TDM version, if you don't mind, it indeed works, and you want to implement it, then you need to do this: Put in every "Room" an info_location (with the name of the EAX sound space ex: "small_room"), and an overlaping info_location_separator on every portal that separates them, if a room has more than one portal you need to put a info_location_separator in all of them , then you need to make a new folder called "efxs" in the TDM base, make a simple yourmapname.txt file change the extention to yourmapname.efx and place the below code in it. You can tweak the EAX valious and make other "room" sound spaces of your own, for example a underwater sound space. You also need to make sure s_useEAXReverb and s_useOpenAL are both set to 1 (requires restart).

.

Version 1

// reverb small_room
reverb "small_room" {
"environment" 26
"environment size" 1.0000
"environment diffusion" 0.5000
"room" 0
"room hf" -1081
"room lf" 0
"decay time" 1.1969
"decay hf ratio" 0.9228
"decay lf ratio" 1.0370
"reflections" 140
"reflections delay" 0.0260
"reflections pan" 0.0000 0.0000 0.0000
"reverb" -1200
"reverb delay" 0.0000
"reverb pan" 0.0000 0.0000 0.0000
"echo time" 0.0750
"echo depth" 0.6220
"modulation time" 4.0000
"modulation depth" 0.0000
"air absorption hf" -5.0000
"hf reference" 5000.0000
"lf reference" 250.0000
"room rolloff factor" 0.0000
"flags" 0
}


// reverb corridors
reverb "corridors" {
"environment" 26
"environment size" 1.7795
"environment diffusion" 0.4803
"room" 0
"room hf" -393
"room lf" 0
"decay time" 2.4504
"decay hf ratio" 0.1299
"decay lf ratio" 1.1921
"reflections" 220
"reflections delay" 0.0000
"reflections pan" 0.0000 0.0000 0.0000
"reverb" 299
"reverb delay" 0.0134
"reverb pan" 0.0000 0.0000 0.0000
"echo time" 0.0805
"echo depth" 0.0000
"modulation time" 0.3650
"modulation depth" 0.0000
"air absorption hf" -5.0000
"hf reference" 5000.0000
"lf reference" 250.0000
"room rolloff factor" 0.0000
"flags" 0
}



// reverb small_corr
reverb "small_corr" {
"environment" 26
"environment size" 1.7795
"environment diffusion" 0.4803
"room" 0
"room hf" -393
"room lf" 0
"decay time" 2.4504
"decay hf ratio" 0.1299
"decay lf ratio" 1.1921
"reflections" 220
"reflections delay" 0.0000
"reflections pan" 0.0000 0.0000 0.0000
"reverb" 299
"reverb delay" 0.0134
"reverb pan" 0.0000 0.0000 0.0000
"echo time" 0.0805
"echo depth" 0.0000
"modulation time" 0.3650
"modulation depth" 0.0000
"air absorption hf" -5.0000
"hf reference" 5000.0000
"lf reference" 250.0000
"room rolloff factor" 0.0000
"flags" 0
}



// reverb small_room_2
reverb "small_room_2" {
"environment" 26
"environment size" 1.0000
"environment diffusion" 0.5000
"room" 0
"room hf" -10000
"room lf" -10000
"decay time" 1.1969
"decay hf ratio" 0.9228
"decay lf ratio" 1.0370
"reflections" 140
"reflections delay" 0.0260
"reflections pan" 0.0000 0.0000 0.0000
"reverb" -1200
"reverb delay" 0.0000
"reverb pan" 0.0000 0.0000 0.0000
"echo time" 0.0750
"echo depth" 0.6220
"modulation time" 4.0000
"modulation depth" 0.0000
"air absorption hf" -5.0000
"hf reference" 5000.0000
"lf reference" 250.0000
"room rolloff factor" 0.0000
"flags" 0
}



// reverb outside
reverb "outside" {
"environment" 26
"environment size" 8.0157
"environment diffusion" 0.7874
"room" 0
"room hf" 0
"room lf" -551
"decay time" 1.5102
"decay hf ratio" 0.7134
"decay lf ratio" 0.3094
"reflections" -2291
"reflections delay" 0.0898
"reflections pan" 0.0000 0.0000 0.0000
"reverb" -2251
"reverb delay" 0.0945
"reverb pan" 0.0000 0.0000 0.0000
"echo time" 0.1659
"echo depth" 0.7087
"modulation time" 1.4120
"modulation depth" 0.2756
"air absorption hf" -5.0000
"hf reference" 5000.0000
"lf reference" 250.0000
"room rolloff factor" 0.0000
"flags" 0
} 

thanks for tut, that sound interresting, but it's not clear for me, do i have edit the maps itself or what? I've never edited for TDM, so i have no clue

Link to comment
Share on other sites

thanks for tut, that sound interresting, but it's not clear for me, do i have edit the maps itself or what? I've never edited for TDM, so i have no clue

 

Yes the only way to have EAX (if it worked) on TDM was by implementing it our selfs on the levels, because no mission developer made it even when EAX worked fine. The problem is that EAX in idtech 4 (Doom 3) is the EAX 4.0 version and that was exclusive to Creative Sound cards. Asus sound cards only have EAX 2 on hardware (like all sound cards) and EAX 5.0 emulation on software, because many people used onboard sound cards including some TDM developers they decided to let go of EAX.

Afaik creative also said EAX is dead so we should now use EFX instead, it works on all sound cards.

Link to comment
Share on other sites

EAX applies uniformly inside a portal leaf, so it's set by environment in that sense.

I wouldn't say it's *only* for effects. With all the options, you can get really nuanced.

 

I think it'd be noticeable and important (in a good way), e.g., in the transition from walking between inside and outside, as soon as you cross the door threshold (which you notice in real life), or walking into a bathroom (wet) or closet (closed and dry), etc...

I don't think it's critical everywhere, but for certain rooms and transitions from one room type to another, a little EAX makes a big difference to feeling the space.

 

Yes, but that still does "only" account for how the sound "sounds", but not where it comes from and how loud, which is what grayman spoke of.

 

If you have a hallway with two open windows onto a yard and a guard walks along the hallway, you need to locate him without seeing him. If the sound system does not provide this accurately (or fake) enough, the impression of "the sound is wrong" is created.

 

The same is f.i. with ligh. The moving shadows make it possible for a human to predict where the guard is, even if you don't see him. Is the shadow suddenly halting? Is it still moving? Moving backwards?

 

I guess the sound problems are that the sound emitted by the guard (whistling, footsteps) is not equally 3D locatable as the shadow/light/visual stimuli, which leads to the odd "hm, this sounds wrong" sensation people have.

 

Not playing with good headphones makes the problem worse, and not having EAX/EFX hall/reverb etc. effects also makes it worse. However, if the virtual speakers aren't computed properly, no headphones and EAX/EFX effects will save you.

Edited by Tels
  • Like 1

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Does anyone know what a good loss value should be per degree of direction change? I searched the web but couldn't find any simulation suggestions. I found a lot of absorption coefficients for materials, but for us the material is unknown because we don't have the point of reflection, but are simulating it with the angular diffraction.

 

For the lack of anything else, I've started with a loss of 5db for a diffraction angle of 90 degrees. A 7db loss halves the volume.

 

In real life there is both diffraction and reflection involved. Diffraction is affected by the size and shape of the opening and will affect different frequencies differently. Reflection will depend on the angle, size, position and material of the reflecting surfaces, will also affect different frequencies differently, and there will be multiple reflections involved until all of the energy is dissipated. So without a full physical simulation of sound propagation I suspect it is very difficult to come up with a fudge factor that will work correctly in all situations.

 

Note that a 6dB reduction is around a 50% change in amplitude, but decreases the power (which is what we perceive) by a factor of four. So I suggest starting with a very conservative value (2 or 3 dB) and increasing only if necessary.

  • Like 1
Link to comment
Share on other sites

Wrt sound ...

 

IIRC, the shortest path is taken. I don't remember how much of the alternate path info is kept, or when it's thrown away. Everything might already be there to create multiple speakers with varying sound volumes. I'd have to walk through the code again.

 

As for change in angle, that's not taken into account. It's easy enough to do, but I'd have to determine the amount of angular occlusion empirically, unless i can find some math on the web that describes how much energy you lose when bouncing (which seems mainly tied to materials encountered, not angles, but since we don't bounce sound rays off materials, we're not going to know what materials are encountered, and will have to assume some energy loss at direction changes).

 

I filed an issue to remind me to look at this.

 

Looking at the code, it seems the current formula uses a linear intepolation between 0 and s_diffractionMax. Shouldn't that be some sin() or cos()? It probably does not make much of a difference in praxis, tho.

 

And thanx for implementing it!

 

One more question: Does the code take into account the direction the speaker/AI is facing? E.g. is an AI facing away from the player less loud than one facing the player? Or does the code simple take the full volume for the first leg in all cases?

 

If so, that might be another cheap improvement - vary the volume by s_diffractionMax depending on the angle of "forward" vs. "direction of first leg".

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

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

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...