Jump to content
The Dark Mod Forums

Microphone support: Alert enemy AI with your voice


MirceaKitsune
 Share

Recommended Posts

There's a bit to unpack here, but I'll ask that you please read this post and my motivation before giving a verdict. At the moment I'm just opening this thread for debate: If the idea isn't shot down as absurd and we agree it's possible to consider, I may proceed with a bug tracker entry otherwise forget I said anything. Also this post does NOT imply we have developers willing to work on it, if no one in the team considers it an effort worth investing time in I'm not going to beg. It would be a major change that takes time to test, so even if it does happen it would likely be next year at earliest (TDM 2.11 or later). Lastly this is intended solely as an OPTION... as the person suggesting it I don't believe it should ever be enabled by default due to how it would alter the gameplay, only offered as an extra component for players who want the mechanic. That being said, the idea occurred to me yesterday and I've been excited thinking about how it could work, it actually kept me up last night and I'm getting this off my chest to hear some feedback so I can fall asleep more easily tonight 😄

Let's get into it. The idea is partly inspired from some horror games I watched Youtubers play a while back. They had a mechanic where the engine accessed the player's microphone to read the volume: If you made too much noise, monsters would hear you and come after you. The player had to stay silent else they'd be in trouble.

Last night it clicked with me how perfectly this mechanic would fit into TDM with our AI and gameplay. Imagine if any noise you made IRL risked alerting nearby guards... whereas oppositely you could use your voice to distract them to your location and move past. I'll discuss both uses below, first let's go into some technical aspects.

This would obviously require engine changes: The engine needs to learn how to access the default microphone device from the sound system, enough translate the volume into a to 0 - 1 float. The game reads this volume at an interval balanced between accuracy and performance (eg: 0.5 seconds). Based on the loudness it captures that call, the same signal emitted by sound sources to alert AI is propagated from the player's view origin. The effect tapers off with distance in a fashion similar to s_mindistance (full effect below this radius) and s_maxdistance (fully ignored beyond that radius), reasonable defaults might be min 4 / max 16 measuring with the radius of a speaker in DarkRadiant. Multiplied with that distance and the AI's acuity factor, the mic volume determines the alert level being generated. The ranges I'm suggesting for this would be:

  • 0% to 20%: Ignored, doesn't generate any alert. Ambient noise and insignificant sounds are usually in this range for all microphones.
  • 20% to 40%: Can go up to the 1st alert level, makes the AI mumble and say "did I hear something" but move on and ignore you.
  • 40% to 60%: Can produce 2nd alert level in guards, making them stop in place to look around.
  • 60% to 80%: 3rd alert level allowed, guards realize something is up and start searching the area.
  • 80% to 100%: Loud enough to make your presence in the area known, 4th alert level is possible making guards draw their weapon and dare you to come out.
  • 100%: So loud that your exact location is clear to the guard as if you bumped into them, 5th alert level activates and the AI proceeds to attack you.

So what is the point of this? Some would see it as an annoyance and the player sabotaging themselves, though just like selecting a higher difficulty level it's a controlled form of making your run more interesting. I for one am in it for the immersion and ingenuity: It would offer a new way to integrate the player into the world, using hardware almost every player has: A headset with a microphone, a mic on their desk, even one in their webcam. This has been done in small games but never attempted in a full stealth game for my knowledge, TDM could be among the first project of this genre to use the idea which would be an extra selling point to make it more interesting and appealing.

The first aspect is fear of being heard. Imagine you really are the player in a typical FM, hiding in the shadows as guards are walking past or running around looking for you. The last thing you want to do in such a circumstance is make any noise: You'd be careful about your breathing, and god forbid you need to cough or sneeze. This mechanic would emulate just that: Players have to be aware of their breath as an enemy walks past them... if for any reason you feel like sneezing or coughing, you better hold off or the guards will become alert in-game. To me this sounds super neat... I can already imagine playing TDM with the added fear and adrenaline :)

The second part is how this can be used to attract guards in a controlled way. Jumping in place works but it's hard to make guards come and investigate, with this you'd do it using your voice. The fun here is learning how loud to speak to get the desired alert level: If you whisper to the guards they won't hear you and just walk past, but if you scream too loudly they'll know where you are and attack you on sight! You'll want to say something like "hey" at just the right volume to make them investigate.

As a bonus to end the idea, why not introduce this for friendly AI too as a fun detail? You know how some FM's have pubs the player can enter where the maid and party-goers won't attack you; Whenever the player says something in their mic, friendlies and neutrals look at you and use the generic response bark! Imagine how much fun we'll have taking breaks from the objective to say all kinds of stupid things in the mic and each time someone responds with a "hello there" or "you said it" or "yeah yeah" 😊

Edited by MirceaKitsune
Link to comment
Share on other sites

 

  • Like 2

"I really perceive that vanity about which most men merely prate — the vanity of the human or temporal life. I live continually in a reverie of the future. I have no faith in human perfectibility. I think that human exertion will have no appreciable effect upon humanity. Man is now only more active — not more happy — nor more wise, than he was 6000 years ago. The result will never vary — and to suppose that it will, is to suppose that the foregone man has lived in vain — that the foregone time is but the rudiment of the future — that the myriads who have perished have not been upon equal footing with ourselves — nor are we with our posterity. I cannot agree to lose sight of man the individual, in man the mass."...

- 2 July 1844 letter to James Russell Lowell from Edgar Allan Poe.

badge?user=andarson

Link to comment
Share on other sites

I'm not sure this would add anything really. Assuming something stupid like your own keyboard doesn't trigger it, you would probably need to be talking to trigger it. But, nobody really babbles to themselves while playing games, and the people who do are recording it for other people. I don't think most people would want to listen to asmr whispers (or worse, long segments of dead air) while watching a let's play or stream.

Link to comment
Share on other sites

Posted (edited)
1 hour ago, Anderson said:

 

Oh wow: EAX has builtin support for this? It's what we're using for sound processing so that's promising! Being able to hear yourself in-game would be welcome with such an addition, especially if it's already there in OpenAL and this isn't asking the devs to code a whole new system from scratch. Should be an independent feature but under the same category... I'd see this stuff having a microphone section at the bottom of the Audio settings menu.

50 minutes ago, freyk said:

A nice feature, but i dont see myself making noise/screaming to my own  system, for a singleplayer game.

 

38 minutes ago, Gin said:

I'm not sure this would add anything really. Assuming something stupid like your own keyboard doesn't trigger it, you would probably need to be talking to trigger it. But, nobody really babbles to themselves while playing games, and the people who do are recording it for other people. I don't think most people would want to listen to asmr whispers (or worse, long segments of dead air) while watching a let's play or stream.

There would need to be a customizable volume threshold on both the low and high end: Sounds under a certain intensity are ignored, the system only activates once the input is significant enough. On the other end the player shouldn't have to scream to produce an alert, just talking loudly should be enough.

The setting should probably have two sliders to adjust the minimum and maximum range, ideally one slider with two dials if GUI allows: Mixed with the volume controls in the OS this should allow each user to calibrate the range to their liking. Normally I'd suggest a volume bar in the menu for preview, like what recording apps have to see the microphone as you talk... I assume people already think I'm crazy for discussing even this entire feature, I shall not exaggerate.

But yeah, talking is the point. That is if we're talking about a way to distract guards, this shouldn't require actually talking to the game just saying a simple "hey" once... if we're looking to not raise an alert not talking is the goal then.

And yes this option is not for players in noisy areas or who expect to be disturbed. Using it assumes you're alone in a relatively quiet room.

Edited by MirceaKitsune
Link to comment
Share on other sites

Voice input can be an interesting game mechanic, but in my opinion there needs to be an actual incentive to use your voice in the game in the first place. This works great in games like Phasmophobia, for example, because you need to use your voice during gameplay to accomplish objectives, but then during ghost hunts you need to be quiet to not die.

With this proposal, I'm skeptical that distracting guards is a good enough reason to use voice. Plenty of ways to distract guards, already, I'm not sure voice adds enough here. And since the majority of the game time you are trying to be stealthy (unlike in Phasmophobia), I think it would mainly punish the player / force them to be quiet most of the time, anyway.

  • Like 2
Link to comment
Share on other sites

Nice I managed to find an old video from Markiplier from one of the games I kept remembering does this (Lurking). It's more oriented on echolocation which isn't as relevant for us, but it shows how creative and ingenious some of those features can be when done right.

More relevant to our functionality and atmosphere is a silly horror game called Escape the Ayuwoki: It's not obvious since there isn't a HUD indicator, but when you talk you make it more likely for the monster to find you. It's fun to watch streamers struggling not to speak when they hear the creature is near 😄

 

  • Haha 1
Link to comment
Share on other sites

Posted (edited)
34 minutes ago, cabalistic said:

Voice input can be an interesting game mechanic, but in my opinion there needs to be an actual incentive to use your voice in the game in the first place. This works great in games like Phasmophobia, for example, because you need to use your voice during gameplay to accomplish objectives, but then during ghost hunts you need to be quiet to not die.

With this proposal, I'm skeptical that distracting guards is a good enough reason to use voice. Plenty of ways to distract guards, already, I'm not sure voice adds enough here. And since the majority of the game time you are trying to be stealthy (unlike in Phasmophobia), I think it would mainly punish the player / force them to be quiet most of the time, anyway.

The suggestion revolves around both uses: Taking to distract guards or not talking to not alert them. It's similar to existing in-game sounds: Sometimes you want to cause them to get guards out of your way, at other times you choose your path and surfaces carefully just to not be loud. Usually the later, the former tends to be the exception.

Forcing the player to stay quiet is the more primary intention then. Not to introduce an annoyance but to include more suspense, in a way that brings added realism and makes you feel more integrated into the world like you're really there and your actions manifest. It would offer a new type of mistake the player can make if they forget to be silent... if you did and spoke too loud in the wrong place, you now have to stay silent for longer until the guards calm down to not alert them even further. I can imagine this being quite a fun challenge especially in cramped indoor areas.

As an estimation of the difficulty level behind considering such a feature: May I ask how much work would be needed in the engine to support measuring microphone volume in and of itself, potentially hearing your self as well? As in how much is this made easy by the libraries we use like OpenAL and EAX. Is there a simple "access the microphone" call the engine can make to the audio system without needing complex code just for this purpose?

Edited by MirceaKitsune
Link to comment
Share on other sites

14 minutes ago, MirceaKitsune said:

Forcing the player to stay quiet is the more primary intention then.

Yeah, and I just don't think this by itself is interesting. Again as a reference, in Phasmophobia it is potentially interesting because you talk with the Ghost during normal gameplay and also with your team in Coop, so there is a clear incentive to use voice. Furthermore, there is at least a potential for jump scares that may get you to accidentally make a noise during the parts you are supposed to be quiet.

In contrast, when playing a game like TDM on your own where there is little incentive to talk, I imagine most people will be silent, anyway, and the probability for making an accidental noise that isn't triggered by external circumstances (e.g. a room mate asking you something, noise from the street etc..) is, in my opinion, fairly low.

18 minutes ago, MirceaKitsune said:

As an estimation of the difficulty level behind considering such a feature: May I ask how much work would be needed in the engine to support measuring microphone volume in and of itself, potentially hearing your self as well? As in how much is this made easy by the libraries we use like OpenAL and EAX. Is there a simple "access the microphone" call the engine can make to the audio system without needing complex code just for this purpose?

OpenAL, to my knowledge, is a pure output library and has no microphone handling. Would require at the least a new library, possibly even separate handling per platform. Definitely not an afternoon project.

  • Like 1
Link to comment
Share on other sites

I agree with @cabalistic — it's a fair bit of coding and configuration by the user for almost no gain. The user would have to take time testing and adjusting his microphone levels, which is fair enough when you're using Discord or in-game voice chat, but who's going to spend time doing this just to potentially punish themselves for breathing or sneezing during a game, which most of the time they're probably not doing at any appreciable volume anyway?

If there was an actual gameplay reason to use voice, then adding an extra feature to take noise into account when hiding might make sense, but adding a whole microphone infrastructure just for this seems like a waste of development effort and a feature that most users would never see the point of enabling.

Link to comment
Share on other sites

Posted (edited)
12 hours ago, SeriousToni said:

*me eating chips while playing TDM*

Guard around the corner: "Who's there!!!?"

😳

Which is kind of the point: If you were the player hiding from a guard, you wouldn't be eating chips next to them. Granted chips existed in the TDM universe, I'm sure the Inventors Guild figured it out 😛 This should be thought of similarly to VR support which is a good comparison... on that it would especially make sense with VR.

6 hours ago, OrbWeaver said:

I agree with @cabalistic — it's a fair bit of coding and configuration by the user for almost no gain. The user would have to take time testing and adjusting his microphone levels, which is fair enough when you're using Discord or in-game voice chat, but who's going to spend time doing this just to potentially punish themselves for breathing or sneezing during a game, which most of the time they're probably not doing at any appreciable volume anyway?

If there was an actual gameplay reason to use voice, then adding an extra feature to take noise into account when hiding might make sense, but adding a whole microphone infrastructure just for this seems like a waste of development effort and a feature that most users would never see the point of enabling.

Fair enough: Like I said I don't expect there to be an engine developer willing to work on this, especially unless many players express wanting it. It's in the same boat as VR again: Few people will use it, but some will seek it out for the sake of added immersion, and at the end of the day I think the effort spent on creating a VR branch of the engine is very much worth it. Hard to say how many would end up using it in the end, could be more depending on how it works.

I can add one thing on that: If this were implemented in the engine, I'd offer to code the AI functionality, granted it's as a script. I'm not an engine dev but good with scripting: If I had one $player1.getMicVolume() call exposed to the script engine, I should be able to do everything as far as AI responses go, including the mic calibration settings based on just two extra cvars... my code could be integrated into core after first being tested as an addon. This way devs and mappers could come up with more innovative ideas to use the microphone in their FM's.

Edited by MirceaKitsune
Link to comment
Share on other sites

Splinter Cell:Chaos Theory did this for co-op. It was awesome playing cat and mouse with guards and a buddy as another spy. You had to be careful in your planning as you talked to your buddy or the guards would hear you. It was funny, we’d yell “Hey DICKHEAD!” And they’d go “who’s there?!” So it has been done in a stealth game before but really only viable for co-op.

  • Like 3

As my father used to say, "A grenade a day, keeps the enemy at bay!"

Link to comment
Share on other sites

1 hour ago, MirceaKitsune said:

Which is kind of the point: If you were the player hiding from a guard, you wouldn't be eating chips next to them. Granted chips existed in the TDM universe, I'm sure the Inventors Guild figured it out 😛 This should be thought of similarly to VR support which is a good comparison... on that it would especially make sense with VR.

Fair enough: Like I said I don't expect there to be an engine developer willing to work on this, especially unless many players express wanting it. It's in the same boat as VR again: Few people will use it, but some will seek it out for the sake of added immersion, and at the end of the day I think the effort spent on creating a VR branch of the engine is very much worth it. Hard to say how many would end up using it in the end, could be more depending on how it works.

I can add one thing on that: If this were implemented in the engine, I'd offer to code the AI functionality, granted it's as a script. I'm not an engine dev but good with scripting: If I had one $player1.getMicVolume() call exposed to the script engine, I should be able to do everything as far as AI responses go, including the mic calibration settings based on just two extra cvars... my code could be integrated into core after first being tested as an addon. This way devs and mappers could come up with more innovative ideas to use the microphone in their FM's.

I agree with you that this is more VR related, there it would be a cool addition. But not for the casual player like me.

...who eats chips in dark corners while waiting for the guards to finally pass.

...or who stumbles around the corners with bend-legs after having the third drink.

:D

  • Like 1

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

9 hours ago, OrbWeaver said:

I agree with @cabalistic — it's a fair bit of coding and configuration by the user for almost no gain. The user would have to take time testing and adjusting his microphone levels, which is fair enough when you're using Discord or in-game voice chat, but who's going to spend time doing this just to potentially punish themselves for breathing or sneezing during a game, which most of the time they're probably not doing at any appreciable volume anyway?

If there was an actual gameplay reason to use voice, then adding an extra feature to take noise into account when hiding might make sense, but adding a whole microphone infrastructure just for this seems like a waste of development effort and a feature that most users would never see the point of enabling.

IMO this would be more a "marketing" tool than anything, would be cool to see lets play youtubers play TDM and scare the crap ot them selves because they talked at a inconvenient time. 😜 

Edited by HMart
  • Haha 2
Link to comment
Share on other sites

2 hours ago, HMart said:

IMO this would be more a "marketing" tool than anything, would be cool to see lets play youtubers play TDM and scare the crap ot them selves because they talked at a inconvenient time. 😜 

Some of them just babble too much :D

  • Like 1

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

As others said above, this doesn't make much sense in a single player game, but I think this would be great if at some point there is some kind of co-op gameplay implemented (e.g., 2 thieves). This way you'd have to talk with your partner only when you are close to each other and not too loudly/whispering, which would add to the immersion.

I'm thinking something like Phasmophobia; no text chat in the game, and the ghost can hear when you talk on your mic.

Edited by darksilence

The Dark Mod Database: https://tdmdb.com

Link to comment
Share on other sites

8 hours ago, darksilence said:

As others said above, this doesn't make much sense in a single player game, but I think this would be great if at some point there is some kind of co-op gameplay implemented (e.g., 2 thieves). This way you'd have to talk with your partner only when you are close to each other and not too loudly/whispering, which would add to the immersion.

I'm thinking something like Phasmophobia; no text chat in the game, and the ghost can hear when you talk on your mic.

I feel it would make most sense with the VR branch: This would be very fitting with its goal of immersion and using the player's body to control the character. And if someone would bother implementing the feature for that, there would be no reason not to back-port it to the vanilla engine too as it's not technically VR dependent.

If TDM had multiplayer this feature would indeed be even greater. Sadly I don't see that ever happening, huge effort to support it at this stage: Even all scripts refer to the player as $player1 and would need to be redesigned to support multiple players for starters. My mic support idea is at least 10 times easier to implement.

  • Like 1
Link to comment
Share on other sites

10 hours ago, MirceaKitsune said:

I feel it would make most sense with the VR branch: This would be very fitting with its goal of immersion and using the player's body to control the character. And if someone would bother implementing the feature for that, there would be no reason not to back-port it to the vanilla engine too as it's not technically VR dependent.

Yep, might be nice in VR. But in keyboard/mouse mode you would have to filter out the keyboard clicketiclackety - certainly doable but definitely not trivial...

Link to comment
Share on other sites

Posted (edited)
3 hours ago, Abusimplea said:

Yep, might be nice in VR. But in keyboard/mouse mode you would have to filter out the keyboard clicketiclackety - certainly doable but definitely not trivial...

Keyboard / mouse noises wouldn't be a problem: The system as I'm imagining it would ignore all sounds under a certain threshold, any ambient noises like fans or clicks... it would only react from any noise that's significant onward. If you open a recording app with a microphone preview bar you can see what I mean: The bar stays on green at the beginning as you type and do normal stuff, passes the middle point and reaches yellow / orange when you talk normally, only reaches the end and gets red if you speak very loudly. Knowing these standard ranges we can calibrate when and how the microphone should have an impact. And of course allow the player to do so by changing the ranges if necessary for their mic... for this I'd add a slider with two dials in the menu to specify the start and end range, text showing the result in a format like "0.20 to 0.80".

Edited by MirceaKitsune
  • Like 2
Link to comment
Share on other sites

Here's an edited screenshot depicting how I see the setting for this. Would be stylized differently of course but work the same way.

The lower dial on the slider represents the volume at which noise is taken into account, anything beyond can start producing an alert level of 1+... the higher dial is the volume at which the microphone is considered as loud as possible, anything beyond will produce the alert level of 5. The entire mic effect is scaled in between these two settings, simple math I can implement in my script... no promises on the main menu Gui, though if I get support on the engine part I can consider trying that too. The black line over the colored bar is the current mic volume, used so the player sees where to set each slider as they make different noises to test the range.

5J6qdtV.png

Link to comment
Share on other sites

The only experience I have with a single player game using the mic was in a Zelda game for Nintendo DS (not sure if it was Spirit Tracks or Phantom Hourglass). In this case you had to blow into the mic in some instances and I was rather annoyed than finding it an enjoyable feature.

Link to comment
Share on other sites

5 minutes ago, Destined said:

The only experience I have with a single player game using the mic was in a Zelda game for Nintendo DS (not sure if it was Spirit Tracks or Phantom Hourglass). In this case you had to blow into the mic in some instances and I was rather annoyed than finding it an enjoyable feature.

Yeah, it's not a feature people should HAVE to use, I'd see it getting annoying then. If this were to happen it should be a purely optional addition.

At most I was thinking we could let some FM's unlock bonus areas when you speak in your mic close to a secret door. But then people will need to use the mic to get all the loot / secrets so even that would likely be too much. We could have generic sound-based triggers of course, which for non-mic users could be activated by throwing an object nearby... different feature for a different thread though.

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.

 Share

  • Recent Status Updates

    • irg

      Watching warmly for The Black Parade, The Broken Goddess and Blood Death Wish Ep.4. Sometimes the best things in life actually are free.
      · 0 replies
    • STiFU

      We are taking our son on his very first holiday trip to see the sea for the first time. 🙂 Will be back in a week.
      · 2 replies
    • Gilkar

      When I was a young man my father was so ignorant I could hardly stand to have him around. As I grew older I was amazed at how much the old man had learned in such a short time.
      · 2 replies
    • jaxa

      RTX 3090 Super, RTX 3070 Ti 16 GB, RTX 2060 12 GB
      https://wccftech.com/nvidia-launching-rtx-3090-super-rtx-3070-ti-16gb-and-rtx-2060-12gb-by-january-2022/
      · 0 replies
    • duzenko

      CPU benchmark time - compiling DarkRadiant (2nd run)
      i5 8600K 6C/6T@4.4GHz DDR4 2x2133MHz 9MB cache
      Parallel builds: 1. 3:57 Parallel builds: 6 (default). 2:28 r5 1600AF 6C/12T@3.3GHz DDR4 1x2666MHz 16 MB cache, temp folder on HDD
      Parallel builds: 1. 5:05 Parallel builds: 4. 2:47 Parallel builds: 6. 2:55 Parallel builds: 12 (default). 2:57
      · 6 replies
×
×
  • Create New...