Jump to content
The Dark Mod Forums

Recommended Posts

Posted

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.

Posted

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.

Posted

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.

Posted

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.

Posted

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.

Posted (edited)

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
Posted

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?

Posted

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.

Posted

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.

Posted

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.

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

    • JackFarmer

      "The Year of the Rat." 
      😄

      Al Stewart must be proud of you!
      Happy testing!
      @MirceaKitsune
      · 1 reply
    • datiswous

      I posted about it before, but I think the default tdm logo video looks outdated. For a (i.m.o.) better looking version, you can download the pk4 attached to this post and plonk it in your tdm root folder. Every mission that starts with the tdm logo then starts with the better looking one. Try for example mission COS1 Pearls and Swine.
      tdm_logo_video.pk4
      · 2 replies
    • JackFarmer

      Kill the bots! (see the "Who is online" bar)
      · 3 replies
    • STiFU

      I finished DOOM - The Dark Ages the other day. It is a decent shooter, but not as great as its predecessors, especially because of the soundtrack.
      · 5 replies
    • JackFarmer

      What do you know about a 40 degree day?
      @demagogue
      · 4 replies
×
×
  • Create New...