Jump to content
The Dark Mod Forums

On ambient noise and sound propagation


phantasmald

Recommended Posts

Something I've been wondering for a while, and the wiki couldn't quite answer my question to a satisfying degree; does ambient noise affect sound propagation in anyway? In other words, is there any system in place that simulates background noise masking player generated racket?
 
I'm mainly thinking of things like roaring machinery, a common set piece in induralist settings. Or heavy rain, loud music, waterfalls, any kind of noise generating entity that physically exist in the mission's world, thus audible for AI entities, and could reasonably overshadow/drown out footsteps.

Based on personal experience I'm fairly certain background noise is not taken into account, but it doesn't hurt asking.
An old, personal pet peeve of mine is when enemies, that the player can't hear moving around due to blaringly loud ambient noises, somehow isn't affected by the same auditory disturbance and immediately goes searching mode over a single, casual footstep.
Or when enemies somehow can distinguish between two sets of identical sounding footsteps, although I can accept that a bit more than the first one. The superhuman hearing can be quite ridiculous.
 

Follow-up question; assuming it doesn't already exist, would such a system be a worthwhile addition? Could be a powerful tool for map makers and players, setting up areas where the player perform rushed actions by utilizing the environment. Like turning on a gramophone to be able to run through a fully illuminated wooden corridor, and stuff.

One possible argument I can think of is that such an addition could mess with old missions, however I'd contend that any mission, that would get ruined by an extra tool/route, wasn't a particularly well designed mission in the first place.
Another issue is that it might be pretty expensive to calculate or properly define the propagation.

Link to comment
Share on other sites

I don't recall a system for noise masking. It sounds like it'd be a good idea, but when you get into the details you realize it'd be complicated to implement. It's not only noise that that goes into it, I think. E.g., a high register can cut through even a loud but low register rumble.

And it's not like the .wav file even has data on the register of what it's playing. So either you have to add meta-data (which is insane), or you have to have a system to literally check pitch on the .wav data and paramaterize it in time to know when it's going to cut through what other parameters from other sounds. For that matter, it doesn't even have the data on the loudness either, so you'd have to get that off the file too and time the peaks with the "simultaneous" moment at arbitrary places in every other sound file correctly.

And then position is going to matter independently for each AI. So it's not like you can have one computation that works the same for all AI. You'd have to compute the masking level for each one, and then you get into the expense you're mentioning.

I know there was a long discussion about it in the internal forums, and probably on the public subforums too, but it's been so long ago now I can't even remember the gist of them.

Anyway the main issue is I don't know if you'll find a champion that wants to work on it. But if you're really curious to see how it might work, you could always try your hand at coding & implementing it. Nothing beats a good demo to test an idea in action. And there's no better way to learn how to code than a little project like that.

I always encourage people to try to implement an idea they have, whether or not it may be a good idea, just because it shows the power of an open source game. We fans can try anything we want and see if it works!

  • Like 2

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

It's not very likely that this sort of thing would even be perceptible to most players outside a few niche situations. If you want to set up a puzzle to, say, have the thief time his runs across a noisy floor while a loud machine is running so that the sound will obscure his footsteps you'd be better off just scripting it up for that one puzzle.

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                                                                                  A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

Is it possible to script ai hearing behaviour based on distance from speaker? So modify the acuity_aud spawnarg based on the distance from a specific speaker ( distanceTo(entity other) ? ). Or based on the volume of the sound in that position ( getSoundVolume(string soundName) ? ).

(I'm just guessing some stuff, so it could be complettely wrong.)

https://wiki.thedarkmod.com/index.php?title=Adding_ambient_Sounds_to_your_Map#Ambient_Sounds_in_one_Area

https://wiki.thedarkmod.com/index.php?title=AI_stats#Aural_perception

https://wiki.thedarkmod.com/index.php?title=TDM_Script_Reference

Edited by datiswous
Link to comment
Share on other sites

If this is referring to loud noises covering the AI's hearing, I agree that should be a thing. Imagine a guard standing in a room where a loud generator that blows the player's headphones off is running: It makes no sense that in such noise the guard will hear the player's footsteps and be alerted to them, they can't hear anything in that noise!

It sounds like a good idea to at least give speaker entities a coverage spawnarg, though this one should be done universally if you ask me: The volume of every sound heard by an AI should decrease its ability to hear other sounds and become alert to them, at maximum loudness the AI can't be alerted by other noises any more.

Link to comment
Share on other sites

Another issue is that sound mixing sometimes changes.

The lockpicking section in the training missions includes a case when player needs to pick a lock with a noisy machine nearby. I remember when I played it first time, the generator noise made lockpicking sounds totally inaudible.
But since then, sound mixing has moved to OpenAL and maybe something else changed, and now this section looks stupid. Because I can pick lock as usual, the generator does not block lockpicking sounds for me.


Perhaps this can be implemented.

Of course, it would require more sound propagation processing: now we only trace sound from everything to player, and from player (maybe something else?) to AIs. With this proposal sound has to be traced from everything to all AIs.

The masking computation can be done based on overall amplitude or sound sample + final volume. It is not correct but should probably be find as long if we stay on conservative side.
 

On the other hand, it is hardly possible to deal with multiple footsteps issue.

There is too much cues that human brain uses here. For instance, it is a thief with special boots would have footsteps very different from footsteps of guards, especially if guards carry armor. Also, a guard might know were his buddies can/should walk and where they should not, and can get suspicious depending on that. Also, thief probably has a very different tempo of footsteps: he moves in more irregular fashion, and never talks while doing so.

  • Like 2
Link to comment
Share on other sites

3 hours ago, stgatilov said:

But since then, sound mixing has moved to OpenAL and maybe something else changed, and now this section looks stupid. Because I can pick lock as usual, the generator does not block lockpicking sounds for me.

 

Ha! I thought I'd noticed the same thing, but I wasn't sure I was remembering correctly.

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                                                                                  A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

 

On 6/16/2023 at 11:26 PM, stgatilov said:

On the other hand, it is hardly possible to deal with multiple footsteps issue.

There is too much cues that human brain uses here. For instance, it is a thief with special boots would have footsteps very different from footsteps of guards, especially if guards carry armor. Also, a guard might know were his buddies can/should walk and where they should not, and can get suspicious depending on that. Also, thief probably has a very different tempo of footsteps: he moves in more irregular fashion, and never talks while doing so.

Yeah, being able to differentiate between footsteps can be justified.
Actually, now that I think about, I'm pretty sure some of Thief's alert lines even lampshaded this; pretty sure it had lines like "Is that you, Sir?"

 

On 6/14/2023 at 5:50 AM, thebigh said:

It's not very likely that this sort of thing would even be perceptible to most players outside a few niche situations. If you want to set up a puzzle to, say, have the thief time his runs across a noisy floor while a loud machine is running so that the sound will obscure his footsteps you'd be better off just scripting it up for that one puzzle.

I don't think it would be a more obscure mechanic than eyepatch/hooded guards having reduced vision. Or that drunk people are less observant.
Imo loud background noise muffling noises would be a very natural and perspicuous, unless you are already heavily geared towards arbitrary/abstract game rules.

But you did gave me an ideas there, kudos.



After thinking about it a bit more, you wouldn't have to do actually have to do any more super serious calculations, just need to be able to apply a sound loss multiplier to player generated noises within a certain area. Since ambient sounds are set up by the map's designer in static locations, so there wouldn't be any need to calculate the loudness dynamically.

Locations already have 'sound_loss_mult' attribute, so you could actually use that simulate muffling, right?

The issue, if I understand it correctly, is that if the zone is bigger than the s_maxdistance of your noise generator, then the player's noise will get unjustly muffled even when far away from source of the noise.  Or if it's smaller, than crossing a portal will remove the cloaking.
Also not sure if 'sound_loss_mult' can be adjusted on the fly. If not, then it can't be used for dynamic distractions (like turning on/off a generator), only static noises. 
Could be optimal for heavy rain on the streets, maybe?

On 6/14/2023 at 11:09 AM, datiswous said:

Is it possible to script ai hearing behaviour based on distance from speaker? So modify the acuity_aud spawnarg based on the distance from a specific speaker ( distanceTo(entity other) ? ). Or based on the volume of the sound in that position ( getSoundVolume(string soundName) ? ).

(I'm just guessing some stuff, so it could be complettely wrong.)

https://wiki.thedarkmod.com/index.php?title=Adding_ambient_Sounds_to_your_Map#Ambient_Sounds_in_one_Area

https://wiki.thedarkmod.com/index.php?title=AI_stats#Aural_perception

https://wiki.thedarkmod.com/index.php?title=TDM_Script_Reference

Hmm yeah, this could be another approach. If you can change an AI's sensory stats on the fly then you could probably script dynamic muffling.

Add some location based culling to it, so the distance is only calculated while the NPC is in relevant zones, lowering the impact of the calculations?!

On 6/14/2023 at 5:23 AM, demagogue said:

Anyway the main issue is I don't know if you'll find a champion that wants to work on it. But if you're really curious to see how it might work, you could always try your hand at coding & implementing it. Nothing beats a good demo to test an idea in action. And there's no better way to learn how to code than a little project like that.

I always encourage people to try to implement an idea they have, whether or not it may be a good idea, just because it shows the power of an open source game. We fans can try anything we want and see if it works!

I do kinda want to do some cooking now and see if I can come up with something fun.

 

Hmm, actually, just had another thought. I remember seeing a recent thread about how Noisemaker arrows are kind of redundant, since broadhead arrows or throwable items can also be used to lure guards over to specific spots.

So maybe this could be a smallish buff to Noisemakers: temporarily lowering the aural alertness of guards in its vicinity a tinsy bit?

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

      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 )
      · 2 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
       
      · 5 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...