Jump to content
The Dark Mod Forums

Sound Prop Questions


Ishtvan

Recommended Posts

Hi guys :)

 

[Edit - Just to clarify, this is only for sound prop. with regard to AI. ]

 

First of all, I was wondering if anyone could clarify what Theo mentioned about the differences in 'direct' wavefront propagation and diffuse field propagation.

 

I think I understand that direct wavefront amplitude decreases due to geometric spreading of spherical waves (1 / ( radius squared ) ), whereas in the diffuse field, you have an infinite number of standing waves filling up a room. How does this diffuse field amplitude decrease as you move from one room to another?

 

The important question for me is: which one of these models is dominant in indoor and outdoor sound propagation? When someone makes say a footstep or 'impulse sound' in another room, and you hear it a couple rooms away, are you hearing mostly the diffuse field of the sound coupled thru the rooms, or are you hearing the initial wavefront bouncing to you? (I know you actually hear both, but which is the dominant effect?)

 

Also, Theo mentioned that the diffuse field experiences coupling losses when going to another room, and that one model would be to count how many portals sound goes thru and divide the diffuse field amplitude by that. One problem with that approach is: some portals are there solely for rendering purposes and would not really result in a sound coupling loss when going thru them (for example, a portal in the middle of a long hallway).

 

Anyway, if anyone could shed light on this, or direct me to some sources on propagation of the diffuse field, I would be very happy.

Edited by Ishtvan
Link to comment
Share on other sites

The official definitions I found of the two are as follows....

 

Diffuse field-a sound field in which the sound pressure level is the same everywhere and the flow of energy is equally probable in all directions

 

OR

 

Sound field in which the time average of the mean-square sound pressure is everywhere the same and the flow of acoustic energy in all directions is equally probable.

 

Although, I liked this definition best....

 

The area in a room with multiple reflections equally probable in all directions.

 

So, it sounds like it's kind of diffused in a way that almost makes it impossible to hear from exactly which direction the sound is propogated. The sound could be just as loud in one corner of the room as in the center.

 

Direct sound field-the portion of a sound field, in an enclosure, which arrives from the sound source without having undergone any reflection.

 

So, as far as what the AI hears I don't know if we should consider a dead room where very little reflections get back to them (seems like it would take less processing but may be "cheating")

 

Here are some sites and a couple of .pdf files on sound field diffusion that might help....

 

Reverb and room acoustics

 

sound waves study indoors and outdoors

 

beam tracing for modeling sound diffraction

 

propgation of the diffuse sound field document

 

another propogation of the sound diffuse field document-might be the same as above

 

sound propgation in ducts

 

I hope that *any* of these help out!

 

Also, is phase cancellation taken into effect with the sound engine? Just curious as to how that might figure into gameplay. Are we going to take into consideration weather effects on sound (atmospheric absorption) such as fog, rain, dampness, etc.?

"Without music to decorate it, time is just a bunch of boring production deadlines or dates by which bills must be paid."- Frank Zappa

Link to comment
Share on other sites

Haven't had time to read those articles yet, but to answer your question:

 

1. Phase cancellation or addition is not currently considered, but it could be in future releases

(We're keeping track of the total distance sound travels (approximately), and multiple paths, so it would be easy to compare the total distance from two paths to the AI's ears and come up with a phase difference from that... As to what frequency to use for the propagation constant though I'm not sure).

 

2. Weather effects - This can be handled by the current setup. I created map entities that you can place in an area that multiply the loss experienced by sound by a constant. So if you want fog to dampen sound, you put in a loss multiplier greater than 1. If you want an echoing stone room to waveguide the sound with fairly low loss reflections, put in a loss multiplier lower than 1.

 

I'll have to look at those articles to see which sound propagation method is most dominant in which situations (ie, direct vs. diffuse).

 

We could potentially add a flag "diffuse" and "direct" to the func_sound_area_info object. Direct would be the default, and "diffuse" would mark a certain area as a high-reverb environment where intensity is pretty much equal everywhere, and it wouldn't decay (but would probably experience some coupling loss going thru the portals). (eg, a small stone room or short stone hallway)

Edited by Ishtvan
Link to comment
Share on other sites

Very cool! Nice to know the weather can have an affect on the sound. Just being a sound geek! ;)

 

I hope any of those articles helps. I'm no mathematician but basically understand most of the formulaic equations. Better you than I! ;) But, from what I read direct would be better for outdoors and diffuse for indoors. See if it seems the same way for you as well....

"Without music to decorate it, time is just a bunch of boring production deadlines or dates by which bills must be paid."- Frank Zappa

Link to comment
Share on other sites

Got around to reading some of those. Very interesting.

 

Diffuse field

I haven't yet seen a good model for coupling the diffuse field from one room to another (I guess I should say coupling the 'room mode' excitation from one room to another, since I found out the mode energy spacing is too large in small rooms to make a true diffuse field with lots of modes :) ). This is what I'm most interested for indoor propagation in small, reflective rooms where reverb dominates.

 

Does anyone know a rough equation to use for this case?

 

Say you have a small room with a door leading to a larger room, and a point source in that room causes reverb, exciting many of the room's modes. What I want to know is how much intensity from the excited modes in this room couples into the next room thru the door.

 

I would guess that the coupling coefficient would be related to the ratio of open portal surface area to surface area of the wall the portal opening is in (so a very small opening wouldn't couple that much reverb from a very large room, because most of the transverse modes would be hitting the wall instead of leaking out the portal), but I have no idea if that's right. Theo put up an equation for this and I guess I'll just use that, but I'd like to understand vaguely where it comes from.

 

Direct propagation

In those papers they describe well established algorithms for actually ray tracing / beam propagating thru a 3d model (for direct sound propagation), but I think this is much more spatial resolution than we need. For our simplified model, I'm treating every room as a scattering matrix with the ports being the visportals.

 

The most tricky part about my model for direct sound is figuring out the path sound takes to get between two portals in the same room. The most simple way is just distance from the centers of two portals, assuming no bouncing, just a direct path between portals. This fails for two parallel portals that are right next to eachother, where in reality the wave would come out of one portal, bounce off the far wall and go in the other portal.

 

Direct Prop: Calculating single bounce if necessary

If I can get this 'create AALDB' on map compile to work, it means we can take a bit more time to calculate these things like single bounces between portals, if necessary. I could imagine doing a test to see if two portals were more or less across from eachother in the room, and if not, do a trace from the center of the portal along the normal vector to the wall, record the trace distance and point hit, then get distance from that point to the 2nd portal and add it to the first distance, calculating roughly the path length of one bounce (of course we would neglect multiple bounces, and not worry about making the angle of incidence = angle of refraction rule :) ). This would fix the "failure situation" described above.

Edited by Ishtvan
Link to comment
Share on other sites

  • 4 weeks later...

The more I read, the more I'm convinced that indoor sound propagation should use cyllindrical spreading instead of spherical spreading. (spherical means sound intenstiy decreases as 1/r^2, cyllindrical decreases a bit more slowly, as 1/r).

 

Taking a look at this reference on sonar (which is a sound wave) : http://www.npmoc.navy.mil/KBay/soundprop.htm

 

It says that cyllindrical spreading should be used whenever sound is confined by a boundary. This would be practically every case in indoor sound propagation (hallways are approximately big cyllinders). I was wondering about this before, and it seems to make sense to use cyllindrical spreading (1/r falloff) for small indoor areas, and 1/r^2 for large outdoor areas.

 

So my proposal is to do cyllindrical spreading by default, and have the mapper set the spreading to spherical for large outdoor areas (this is accomplished by placing an "area loss" entity anywhere in the area and setting a boolean on it like "use outdoor model" to 1.)

 

Ideally, soundprop should be able to tell from the geometry when compiling whether the area is so large that it should use spherical spreading, or whether it's a confined hallway and use cyllindrical spreading. I'm not sure how to do that at this point though. It would have to look at ALL the geometry in an area, and know which brush boundaries are solid and which are nodraw brushes (like portals). I'll see if I can do that later, but for now it will probably work as I described in the previous paragraph.

 

It's tempting to just use the volume of the area and use spherical if it's large enough, but again to get this volume you have to identify which of the surfaces are real collision surfaces and which are not. I'll look into this after I get the basic functionality working.

Edited by Ishtvan
Link to comment
Share on other sites

Do you also provide for different room styles? A heavily carpeted bedroom has a much more muffled sound than a big cathedral. In Vienna there is a concert room which was built for special sound properties and the cool thing about this is, that you even have echo in there. :) The room is round btw.

Gerhard

Link to comment
Share on other sites

@Domarius yeah that's right, sound will travel farther before attenuating to a given level with the cylindrical model, because it's 1/r instead of 1/r^2 in the spherical.

 

@Sparhawk: They'll be able to do this with the area loss multiplier. We're not planning to actually calculate all the bounces off the walls, etc, which is where the wall/ceiling/floor material comes in. So the mapper will approximate this by multiplying the attenuation constant in air by something greater than 1 for more loss (carpeted floor / tapestried walls case). (this system is already coded with the func_snd_area_info objects, or whatever I called it. yay!)

 

(NOTE: I didn't talk about the attenuation constant in this thread, see the other thread in sound programming for an explanation of that. This only covered geometric spreading loss, not material loss :) )

Edited by Ishtvan
Link to comment
Share on other sites

  • 3 weeks later...

Question : How do you guys want to input the volume of sounds? Do you want to do sound pressure level measured at 1 meter, assuming you're in an anechoic chamber, or would you rather input absolute sound power level for the sound?

 

It's pretty easy to code one or the other, since SPL at 1 m = SWL - 11 (for spherical spreading, or - 8 for half-spherical spreading). So I'll just put in whatever's easier for sound designers, I just need to know which is easier to put in realistic values for.

 

A whisper has SWL of 25 dB, and SPL at 1 meter of 14 dB. Just lemme know which it is easier to obtain real values for, and I'll code it that way. :)

 

[side note:]

 

One advantage of using SWL is we could actually do physics-based sound somewhat correctly: The harder a physics object hits something, the more sound energy it produces. We could say SWL is some fraction of the object's kinetic energy, which we can easily calculate the instant before the collision (1/2 * mass * velocity^2). (The fraction represents how much kinetic energy gets converted to sound vs other forms of energy... it would probably have to be slightly different for different types of objects. When you drop a ball of clay, it deforms and doesn't make much sound. If you dropped a ball of wood of equal mass, it would make a lot more sound).

Edited by Ishtvan
Link to comment
Share on other sites

I think both sound power level and sound pressure level at 1m are in dB. When a sound program outputs a volume in dB, that is probably the sound power level going to your speakers right?

 

Using the same format as D3 is fine, but you'll still need to provide a volume for 'suspicious sounds' to balance for gameplay reasons, etc. Propagated sounds will sort've be a separate definition in a def file. So footsteps on different materials could have several different actual sounds, but for propagation there might be only one existing "default footstep," and the player object would multiply the propagated volume by some amount based on how fast you're moving (creeping/walking/running/crouching) and what material you're on (wood/tile etc)

Edited by Ishtvan
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

    • 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.
      · 6 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
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...