Jump to content
The Dark Mod Forums

Location based Sound barks possible?


SeriousToni

Recommended Posts

Hi, I was recently thinking about the Thief 3 NPCs that had special voice lines "What are you doing in the bedroom?!" if you woke them up accidentally.

Would it be possible to enhance our TDM voice lines too with a location based system?

We already got the region system where you can setup specific background ambience and efx to regions in the maps. Is there a chance to also set a room attribute to the regions? Like inside / outside, or basement / living room area? So that the NPC knows in what kind of room / area it currently is and respond with more fitting voice line barks, if provided by the voice script?

Would be happy to read your feedback on this idea. Thanks a lot!

  • Like 4

"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

Thanks for this well elaborated answer. For me personally it makes totally sense to do a custom voice line and have the player trigger it in dark Radiant as I'm not a real coding person. This would be the easiest and safest way to make it work.

However if anyone with coding experience wants to dive deeper in extending the possibilities of AI barks, this would be a cool thing to try (if the engine itself allows). We had a small discussion on discord where another user wants to re edit the vocal scripts to improve their recognition of the environment. This would give the possibility of a more varied bark system in my opinion. But I see that it is not as easy doable as I was thinking with my little knowledge.

  • 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

@demagogue is there a way to make sure that both, the ai and the player are inside the same room? Otherwise the boundary trigger triggers once and if the player isn't there he / she can't hear the bark.

Edited by SeriousToni
  • 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

I also had a scenario in my current map where I wished the location system could be triggered by an AI (although I can't remember what it was now 😂).  Or maybe allow the location entity in the room target something once the location is entered by either the player or some other entity so no scripting required? Potential new feature request maybe?

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

9 hours ago, SeriousToni said:

@demagogue is there a way to make sure that both, the ai and the player are inside the same room? Otherwise the boundary trigger triggers once and if the player isn't there he / she can't hear the bark.

This is the first idea that comes to me. The easiest thing you can getkey from the AI is the literal xyz coordinate location. So you could have a script make a simple distance check from that to the player's position via good old Pythagoras's Theorem. If you trigger a "nearby" state at a distance that's close enough, that will probably put them in the same room or anyway nearby. And you can get the player's location, so you can still modulate the barks based on that.

In the background of what you're talking about is that with the new text-to-voice AI they have now, we can make new barks that sound exactly like the original voice actor. That makes it possible to add to existing AI barks, so we can make convo barks in the same voice as the system barks, or we can make new system barks, etc. I think there's a lot of good potential with that for unique and more interesting AI interactions in FMs.

  • 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

Yes I would recommend to try that out if someone is going to add custom barks or conversations to their missions. Results are pretty good and you don't need to bother the original voice actor. Thanks for mentioning that. It was a discussion on the discord channel - I hope to see more conversations and custom audio with this tool on the future :)

Here's the link

https://beta.elevenlabs.io/speech-synthesis

  • 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

Here is the script event which should work for AIs:

const idEventDef EV_GetLocation("getLocation", EventArgs(), 'e', 
	"Returns the idLocation entity corresponding to the entity's current location.\n" \
	"This was player-specific before, but is now available to all entities."); // grayman #3013

It works by traversing BSP tree from root to leaf according to the 3D point, so should be very quick.
If you query it once per frame for every AI, then you would probably notice performance impact 🤔

 

On 2/25/2023 at 5:32 AM, demagogue said:

A thing to keep in mind is that most AI are mostly frozen when you're not near them anyway.

This is not true in TDM usually.

Unseen AIs can switch to "interleaved thinking", i.e. move at something like 3-5 FPS rate instead of full rendering framerate. But they still do think and continue their patrols.

The original Doom 3 made all AIs go "dormant" when surely out of reach, but this was disabled in TDM because dormant AIs stop patrolling, and this is usually a problem for a mapper. Only a few TDM missions enable dormancy explicitly, perhaps because it improved performance on release date.

  • Like 2
Link to comment
Share on other sites

I really knew that & shouldn't have said it, but thank you for correcting that.

Oh wow, how did I not hear about EV_GetLocation() before? That's great!

As for the performance part, stgatilov makes a good point. If you want to keep running track of the AI's location, you have to keep the script running in a loop, which can really eat up up cycles. (Performance was one of our big concerns with the Location script itself because of that.)

One thing I'd think about is having the script or EV_GetLocation function called only when an AI is ready to make a bark, and it quickly gets its location from there and makes the bark, and then it's done. Then it's only a one-shot script or function call, which is always better if you can do it.

The catch there is I think that'd call for a custom AI script. The issue is if the a future version of the game ever updates that AI script, the custom scripts won't be updated in that version. But since AI scripts should be self-contained, I mean changes almost always take deprecated old stuff into account so it doesn't break old FMs, a custom AI script shouldn't break the FM with new versions of the game. Those AI just won't have any new bells or whistles, which may still be worth it. Or you just quickly add the new things in and kick out a new version if you need to.

Of course another option is that new functionality is added to the core game itself with some new spawnargs added to AI, where barks can be made Location specific. For that matter, the AI scripts might be updated to be more friendly to adding barks to existing AI generally, now that we have a good text-to-voice app to make them. Then all mappers get the ability to do this. That might be nice, if it isn't a big performance hit or otherwise troublesome.

  • Like 1

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

Just poll every second instead of every frame, and hopefully nobody would notice (also probably randomize offset uniformly up to 1 second to spread this polling uniformly).

The problem is that there is a whole matrix of AI - location pairs. If someone decides to implement such a system, how would mapper specify these settings?

Or you mean something like "location kitchen: want_to_eat_bark", and then add "want_to_eat_bark" to vocal set of a particular AI or a class of AIs. If AI has the corresponding entry, it is added to set of barks, otherwise it is not?

By the way, isn't there already some system to notify AIs near a spot about something and force them to say something specific?...

  • Like 1
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

    • MayheM

      Hello, Since this track is originally from TDM,i think it's better to ask here than TTLG. Do you guys have the full version of this ambient track?
      https://sndup.net/z4ty/
      https://sndup.net/qwhy/
      · 2 replies
    • DeTeEff

      Bachelor Mapping Challenge!
      The girlfriend will be away to her mum's place for almost a week, which means more mapping time for me! I'm planning a speed build. Hope it will go my way
      I'm starting by downloading 2.11. Don't know if I'm going to use any fancy new stuff. Just want to crack those itching map muscles that has gone dry and dead since almost a year's worth of no-mapping
      · 3 replies
    • kano

      The cool part of Canonical's Snap, is that my machine can now ray-trace an entire (simple) scene faster than it takes the web browser to start!
      · 5 replies
    • datiswous

      Fm idea (braindump)
      "Experience the life of a mission builder"
      Esentially there are finnished elements placed somewhere in storage in the game and you have to place them in the correct places, build some walls here and there, add guard routes, give them their correct speech lines, etc. Decorate the places.. all in-game. lots of fun.. 😉
      If you do it right in the end you can play the mission.
      (would be even cooler if a thief-ai could play the mission, making it some kind of tower-defence game)
       
      This first started as an idea for an aquarium builder mission where-in you have to fill an empty aquarium with sand, waterplants, castles water and swimming fish. But above idea is more fun.
       
      · 4 replies
    • JackFarmer

      Dear ChatGPT, What are The Builders in the Dark Mod?
       
      The Builders is a popular game mode in the video game community called "Dark Mod," which is a fan-made tribute to the classic "Thief" series of stealth games. In this game mode, players assume the role of builders who construct structures in a dark and ominous environment while trying to avoid detection by patrolling guards.
      The Builders game mode is unique in that it offers players the opportunity to create and design their own levels using the in-game tools and resources provided. Players can experiment with different building materials, construct intricate traps and puzzles, and create their own unique gameplay experiences.
      While The Builders game mode is not an official part of the Dark Mod, it has become one of the most popular and well-loved aspects of the game, thanks to its emphasis on creativity, strategy, and stealth.
       
      You guys did not know that, did you?
      · 2 replies
×
×
  • Create New...