Jump to content
The Dark Mod Forums

How does sound gameplay-wise work in The Dark Mod?


Expack3

Recommended Posts

I've been wondering how, exactly, The Dark Mod implements sound gameplay-wise, but my searches haven't yet yielded a good technical answer. As such, I'd like to ask a few questions about The Dark Mod's sound implementation (gameplay-wise):

  1. What happens when something which can make noise, like a sword striking a wall, does so gameplay-wise in terms of implementation?
  2. Do walls, their thickness, and/or their materials affect what guards and people hear? For example, if I drop an object onto a hard surface, will the guards in the adjacent room hear the ruckus if the wall is just right?
  3. Does room size and type affect how far and how clearly sounds can be heard? For example, if I kill a guard in a place where sound would, in real life, carry far, such as a cathedral, will his/her death cry be heard from father away, if only enough to alert guards?

If someone knowledgeable with The Dark Mod could please respond to this, I'd greatly appreciate it.

Link to comment
Share on other sites

AI can only "hear" specific sounds. When an object hits something, a sound will be generated for the player to hear on his speakers, and--if specified--a sound wave will be sent out through the map's "rooms" to see if any nearby AI can "hear" the sound wave.

 

So not all sounds generate sound waves. We differentiate between sounds we want AI to "hear" and sounds they shouldn't care about.

 

Materials affect what the player hears and what the AI hear. A bottle dropped on grass makes a softer sound than when dropped on metal. Wall thickness is irrelevant.

 

Room size is not taken into account.

Link to comment
Share on other sites

1. AI make checks for certain stims that put them on alert, one of which is audio. Some sounds count for that check, like world sounds, and some sounds don't count for that check, like ambients.

2. Rooms are usually divided into "leafs", which are areas bound by walls & visportals. In this case, sound travels through the visportals. Whether the guard on the other side of the wall hears the wall depends on if the sound is loud enough to travel through the series of portals between source & AI. If there are no portals & they are in the same leaf, then the sound will travel through the wall as if it isn't there.

3. I thought in the cathedral example, the volume falloff with distance to zero would stop the AI from going on alert, but I don't recall exactly.

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

Interesting post.

 

I've read through the visportal wiki and understand that the sounds propagate through the center of visportals. I don't recall reading if sound went through closed visportals though, I'll have to look at it again.

 

Do brushes in the shape of a box with visportaled doors on either side create a contained leaf; and also, sound will not propagate through a closed visportal? I thought they were strictly for graphical performance optimization.

 

This opens avenues for sound propagation puzzles. I'll have to keep this in mind when graphical optimizing so I don't shut off sounds I want nearby AI to hear if they're on the other side of a closed visportal if that's the case.

Link to comment
Share on other sites

I've read through the visportal wiki and understand that the sounds propagate through the center of visportals.

 

If the wiki says only that, it's wrong. Sounds travel through the nearest edges of portals. Tie a string at the sound origin, then walk the string to the listening ear. Pull the string tight and that's how sound travels through portals. For portals that are oddly shaped, or where it's difficult to determine the correct edge to use, the path (string) defaults to the center of the portal.

 

I don't recall reading if sound went through closed visportals though, I'll have to look at it again.

 

It does, but the map author can control sound loss through closed portals by using doors or other special entities that touch the portal.

 

Do brushes in the shape of a box with visportaled doors on either side create a contained leaf; and also, sound will not propagate through a closed visportal? I thought they were strictly for graphical performance optimization.

 

Portals are used for both leaf creation (graphical performance) and more realistic sound propagation.

 

This opens avenues for sound propagation puzzles. I'll have to keep this in mind when graphical optimizing so I don't shut off sounds I want nearby AI to hear if they're on the other side of a closed visportal if that's the case.

 

Sound occlusion across portals only occurs where the map author wants it to.

Link to comment
Share on other sites

If the wiki says only that, it's wrong. Sounds travel through the nearest edges of portals. Tie a string at the sound origin, then walk the string to the listening ear. Pull the string tight and that's how sound travels through portals. For portals that are oddly shaped, or where it's difficult to determine the correct edge to use, the path (string) defaults to the center of the portal.

 

Thanks, it was worth a refresh after my first read. From the wiki:

 

"Sound going to the AI travels the shortest distance through a visportal, passing at any point on the visportal surface."

 

I think I just speed read the intro and glanced at the pics and the pics do not show the sound line taking the shortest path. Then I saw a speaker from ID talking about visportals on boobtube that was talking about sound going through the center of portals I seem to recall.

 

From the wiki:

"Visportals do NOT need to be closed to correctly channel sound to the player. Sometimes it is worth adding visportals even if they will not help with rendering (because they will always be open) in order to make sound travel the way it should."

 

This tid-bit is also very welcome:

----------------------------------------

"Starting with Rev 2.00, sound_loss is also used in determining sound volume to the player. This aligns what AI hear with what the player hears. It also allows sound coming through the door to increase as the door opens, or decrease as the door closes, making for a more realistic experience."

 

It does, but the map author can control sound loss through closed portals by using doors or other special entities that touch the portal.

 

Besides doors/windows/sarcophagus lids (user entered args I would guess on that one) what other special entities effect sound propagation through visportals?

 

Sound occlusion across portals only occurs where the map author wants it to.

 

If the map author is aware of this. Which I was and then forgot but now I am reborn in the words of the gray man.

 

Thanks :D Seriously.

Edited by Lux
Link to comment
Share on other sites

Interesting. If I'm reading all this correctly, the sound system, gameplay-wise, handles sound in a similar way to how Thief II did (with obvious improvements to AI reactions). Is my interpretation correct?

 

I don't have an answer for that, not knowing how T2 did it.

Link to comment
Share on other sites

There are some similarities to T2, but the analogy might be more confusing than helpful on some points.

 

In T2 you created sound "rooms" with rectangular brushes, overlapped on each other at doorways and hallway corners and such, and sound propagates through the touch-points and automatically shut off where the room brushes stop (which is all computed by the portalize process). In Darkmod the equivalent of T2 rooms are the "leafs", which are created by the dmap process and can be any shape and always filling the entire space, whatever is enclosed by brushes/walls and portals which connect two leafs, and then sound propagates through the portals. So there's a little resemblance there, with the T2 "room" touchpoints and TDM "portal" touchpoints serving a similar role.

 

But aside from that it's very different from the mapper's perspective, since in T2 she or he's spending all the time creating "room" brushes all over the playable areas to match the architecture (so room-borders & walls line up & don't bleed through, not always easy), and in TDM spending all the time making sure leafs are sealed & creating portals and putting spawnargs on them.

 

Edit: Sorry, if you're talking about AI's uptake of sounds... I know some arguments you can put on T2 AI that change things like their acuity to sound alerts and such or make them deaf, etc, but I don't know exactly how the system works internally either, although since the sourcecode is out one could look it up. Superficially they seem the same. AI go on alert for world sounds and not ambients.

  • 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

There are some similarities to T2, but the analogy might be more confusing than helpful on some points.

 

In T2 you created sound "rooms" with rectangular brushes, overlapped on each other at doorways and hallway corners and such, and sound propagates through the touch-points and automatically shut off where the room brushes stop (which is all computed by the portalize process). In Darkmod the equivalent of T2 rooms are the "leafs", which are created by the dmap process and can be any shape and always filling the entire space, whatever is enclosed by brushes/walls and portals which connect two leafs, and then sound propagates through the portals. So there's a little resemblance there, with the T2 "room" touchpoints and TDM "portal" touchpoints serving a similar role.

 

But aside from that it's very different from the mapper's perspective, since in T2 she or he's spending all the time creating "room" brushes all over the playable areas to match the architecture (so room-borders & walls line up & don't bleed through, not always easy), and in TDM spending all the time making sure leafs are sealed & creating portals and putting spawnargs on them.

 

Edit: Sorry, if you're talking about AI's uptake of sounds... I know some arguments you can put on T2 AI that change things like their acuity to sound alerts and such or make them deaf, etc, but I don't know exactly how the system works internally either, although since the sourcecode is out one could look it up. Superficially they seem the same. AI go on alert for world sounds and not ambients.

I was actually talking about both, so you're good. :)

 

Thanks to everyone for their responses. They were quite informative, and I learned a lot.

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

      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
    • Ansome

      Well then, it's been about a week since I released my first FM and I must say that I was very pleasantly surprised by its reception. I had expected half as much interest in my short little FM as I received and even less when it came to positive feedback, but I am glad that the aspects of my mission that I put the most heart into were often the most appreciated. It was also delightful to read plenty of honest criticism and helpful feedback, as I've already been given plenty of useful pointers on improving my brushwork, level design, and gameplay difficulty.
      I've gotten back into the groove of chipping away at my reading and game list, as well as the endless FM catalogue here, but I may very well try my hand at the 15th anniversary contest should it materialize. That is assuming my eyes are ready for a few more months of Dark Radiant's bright interface while burning the midnight oil, of course!
      · 4 replies
×
×
  • Create New...