Jump to content
The Dark Mod Forums

Visportals and Sound


Springheel

Recommended Posts

There has been some confusion in the past about the effect of visportals on sound. Specifically, there was a suggestion that open visportals do not affect sound, meaning that you could hear an AI on the other side of a wall if the visportal that separated the two areas was open.

 

I just did a test of two hallways stacked on top of each other, with a visportal separating them at the far end. With no visportal, I could hear the AI below me as if he was right next to me (he essentially was). But with a visportal, I could no longer hear him, even though the portal was in an open hallway, and was itself open.

 

Turns out this image is correct:

 

800px-Vis.jpg

 

This means that it is actually important to put visportals in places where they may never close in order to make sure sound flows properly from area to area.

Link to comment
Share on other sites

Good to know.

 

I wonder though if adding these extra visportals will adversely affect performance? Too many visportals is supposedly bad for performance. If so, is it possible for us to create a branch off of visportals, essentially soundportals, specifically for sound prop? Then they wouldn't be calculated with the rest of the visportals. Visportals could continue to function as they normally do, so that mappers don't have to place both a vis and sound portal at the same location, and would only need the extra sound portals for proper sound prop. This approach would ensure current maps aren't broken either.

Link to comment
Share on other sites

I must admit I don't think about sound when placing visportals. If that were a U shaped room and fairly simple then I doubt I would put those visportals in. Visually one of them would be open almost all the time and they would both be open much of the time anyway. But if it guides the sound better...

 

Do we have any facts about the loss of performance from visportals? It might be that it makes not detectable difference if we have 50% more visportals in a typical FM.

 

Otherwise, NH's idea of a sound portal is a good one as it should not break existing maps.

Link to comment
Share on other sites

Question: What happens if that were a 'circular' room or say a corridor going around in a square circle with visportals as shown? In other words, two routes for the sound to propagate. Does it go both ways and add up like stereo speakers so it sounds as if it comes through the middle? What happens in RL come to that!

Link to comment
Share on other sites

Turns out this image is correct:

 

That is consistent with how I imagined visportal-based sound propagation works, so it's good to know for certain.

 

If that were a U shaped room and fairly simple then I doubt I would put those visportals in. Visually one of them would be open almost all the time and they would both be open much of the time anyway. But if it guides the sound better...

 

The thing is, in that situation putting those visportals in does make sense. It doesn't matter that one of them would be open, because it would allow the other one to close if you couldn't see through both (remembering that visportals are only occluded by other visportals, not level geometry). It would also improve model culling and scissoring when they were both open; even open visportals provide a potential performance benefit.

Link to comment
Share on other sites

No I meant in a trivial situation where the room is small and simple and it saves almost nothing to put in a visportal even if the far one is closed. You might step in the door to the room and the far visportal is closed and fps is 55fps. Take two or three steps and the far one opens and fps drops to 54fps if at all. That is the situation where it still might make sense to put in visportals if there might be sound from an AI around the loop.

 

In the trainer, take the approach to the desk guy in the stealth area. This is an L shaped room only. I can't remember but I guess we would have put in visportals around there but hardly worth it for performance alone. There would be one in door itself and one in the far door to the warehouse to close when in the warehouse. To have that entire L shaped room rendered I don't think is a big deal.

Link to comment
Share on other sites

What happens if that were a 'circular' room or say a corridor going around in a square circle with visportals as shown

 

There are a lot of spiral staircased towers in missions. So how do you decide where the diameter-slice visportal/soundportals go?

"A Rhapsody Of Feigned And Ill-Invented Nonsense" - Thomas Aikenhead, On Theology, ca. 1696

Link to comment
Share on other sites

No I meant in a trivial situation where the room is small and simple and it saves almost nothing to put in a visportal even if the far one is closed. You might step in the door to the room and the far visportal is closed and fps is 55fps. Take two or three steps and the far one opens and fps drops to 54fps if at all. That is the situation where it still might make sense to put in visportals if there might be sound from an AI around the loop

 

Right. I guess my point was not so much that adding these visportals would necessarily make a big impact on performance, but it wouldn't harm performance because it is already a logical place to put visportals. It's not like the visportal placement strategy for the purposes of sound propagation is fundamentally opposed to that needed for rendering performance.

 

The take-home message is therefore: place visportals where they will help EITHER sound propagation OR rendering performance, and they might provide a benefit to the other one as a side-effect.

Link to comment
Share on other sites

Do we have any facts about the loss of performance from visportals? It might be that it makes not detectable difference if we have 50% more visportals in a typical FM.

 

From what I've read it isn't very significant, but I have no tests to back that up.

 

Question: What happens if that were a 'circular' room or say a corridor going around in a square circle with visportals as shown? In other words, two routes for the sound to propagate

 

I haven't specifically tested that either, but my understanding is that the entire room would be considered the same area, and therefore sound would go in a straight line. Visportals are used to break the map into areas, and sound travels from area to area based on the visportals even if they are open. (that last bit is the part we weren't sure about)

 

I suspect this is why people have complained in the past about being able to hear AI in other rooms like they're right next to you...the rooms probably weren't separate areas.

 

I think I'll run a couple more tests, just to be sure. Are we aware of any difference between sound travelling through brushwork and travelling through the void?

Link to comment
Share on other sites

From what I've read it isn't very significant, but I have no tests to back that up.

 

I too remain very sceptical of this; I suspect it falls into the same category of misconceptions as the "3 lights are bad" myth that was (and probably still is) floating around Doom 3 editing guides. Tests would confirm either way.

 

Are we aware of any difference between sound travelling through brushwork and travelling through the void?

 

There shouldn't be, because there is no difference between brushwork and a void once the map is compiled. There are only polygonal surfaces enclosing accessible areas.

Link to comment
Share on other sites

I noticed sound following the visPortals like that diagram because I turned on the "show sound propagation" in the console (forgot the exact command) and followed one of my AI around the block, and you'll see a green line going from the AI's feet to the portal to you, then when you pass the portal the line clicks back into a straight line. Then when he passes a portal it clicks back into two segments.

 

In fact, all of these kinds of tests should be done with that command turned on so you can see exactly where the sound is going. (In retrospect, it'd probably also be useful when you're placing VPs to control soundflow more exactly.)

 

Edit: Another question. When you have a leaf inside or partially inside another leaf, like a house in a street, I wonder when you're on the street, the sound still travels in a straight line (if no portal, or from the intervening portal), even though that may sometimes require it going *through* the other leaf (cutting the corner; i.e., another leaf is in the black area in that diagram, and it's like the 2nd situation). But when you enter the house, then the sound is cut off and doesn't come in through the street. I believe this is what I saw following that AI around the block, because sometimes the sound cut corners coming from the portal on the other side (through the house), but I never heard them while actually inside the house. That would make sense, even though maybe counter-intuitive.

 

Edit2: And the lesson there, I guess, is that the sound propagation is really agnostic about what's really going on in space. It just finds itself in a leaf and looks for an intervening (open) visPortal to the player to emit from, and that's it. So it's good to have that sort of abstracted, basic image of what the sound-prop "sees" in mind when thinking about sound prop, and generally think in terms of leaf-space and their touch-points.

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

When you have a leaf inside or partially inside another leaf, like a house in a street, I wonder when you're on the street, the sound still travels in a straight line (if no portal, or from the intervening portal), even though that may sometimes require it going *through* the other leaf (cutting the corner; i.e., another leaf is in the black area in that diagram, and it's like the 2nd situation).

 

Presumably it would have to behave like this, since the sound propagation is only taking into account visportals. For it to automatically avoid the house it would also need to be aware of the extent of the brushwork separating the house from the external area.

Link to comment
Share on other sites

Bah, this is not as simple as I thought. I'm still getting unexpected behaviour in my map. In some cases, sound is working the way it should, but in others I'm hearing things that I should not. When I stand on the first floor I can hear the guard patrolling in the basement like he was right next to me. But when I'm in the basement, I can't hear any of the AI talking on the first floor, even when they're right above me.

 

Is it possible that footstep sounds behave differently than other sounds??

 

I noticed sound following the visPortals like that diagram because I turned on the "show sound propagation" in the console (forgot the exact command) and followed one of my AI around the block, and you'll see a green line going from the AI's feet to the portal to you

 

What command is this? I tried tdm_showsprop = 1, but got no lines at all from footsteps (I got red and green lines when the AI spoke, but couldn't really understand what they meant--see image).

post-9-12761318216_thumb.jpg

Link to comment
Share on other sites

It's been so long since I used it but that doesn't look right. As I recall you should see red rectangles for VPs and green lines starting from the sound origin, passing through the centre of any VP, and then arriving at the player.

 

Footfall sounds have been given a mindistance of 0 in the soundshaders now. Maybe that causes problems. Maybe try increasing that?

Link to comment
Share on other sites

Not to detract from the discussion too much but I found this noteworthy...

 

 

Isn't something like this already implemented in the mod? I recall reading something about pre-computing sound propagation data during map load. Is this only used for alerting AI?

Edited by rich_is_bored
Link to comment
Share on other sites

It's been so long since I used it but that doesn't look right. As I recall you should see red rectangles for VPs and green lines starting from the sound origin, passing through the centre of any VP, and then arriving at the player.

 

Yes, I realised that the one I was using, "tdm_showsprop", is probably for tracing sound propogation to AI. That's why footsteps weren't doing anything (AI footsteps don't alert AI) while their alert barks were.

 

I need the command for showing sound propagation to the player. Anyone know which one that is off hand?

 

I don't have the mod checked out here, but do any of the problematic sounds have "no_occlusion" specified in the sndshd?

 

I'm fairly certain they don't. The mindistance of 0 occurred to me too, though I thought vocals had that as well. I'll have to poke around a bit more tonight when I have some time. I'll redo the test I did earlier with footstep sounds to see if I get a different result.

Link to comment
Share on other sites

I think it's s_drawsound 1

 

That draws a purple box around and identifies the soundfile being played, but doesn't trace its path.

 

Is it possible that footstep sounds behave differently than other sounds??

 

 

I did a test in my previous map with walking, and while I could hear the walking clearly without a visportal (and the AI could hear me when I took a step), as soon as I added one way down at the end of the hall, I could no longer hear the footsteps.

 

So there doesn't appear to be a specific issue with footsteps. I'll need to track down that console command to do further research.

 

As I recall you should see red rectangles for VPs and green lines starting from the sound origin, passing through the centre of any VP, and then arriving at the player.

 

I've searched through all the console commands I can find, and none of them do the above. Anyone have another guess?

Link to comment
Share on other sites

Not to detract from the discussion too much but I found this noteworthy...

 

 

Isn't something like this already implemented in the mod? I recall reading something about pre-computing sound propagation data during map load. Is this only used for alerting AI?

 

Holy shit, that video rocks. And they implemented it into Half-Life 2, so it should be possible to implement it into D3, too. (Although it might require D3 open source first *sigh*)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

That draws a purple box around and identifies the soundfile being played, but doesn't trace its path.

 

I've searched through all the console commands I can find, and none of them do the above. Anyone have another guess?

 

Spring - part of this was discussed previously - http://forums.thedarkmod.com/topic/8828-how-sound-works/page__hl__sound

 

I can't test the command right now but Ishtvan also suggests its s_drawsound 1 (well he actually suggests its r_drawsound but r_ is for render and s_ is for sound commands AFAIK)

 

Have you tried the commands on other maps? Maybe a leak is causing issues?

Link to comment
Share on other sites

I tried s_drawsounds 1, but as I said, it doesn't show any traces or directional information. It just shows a purple box around the sound origin, and gives the name of the sound (and possibly the min/max values as well; it's all text).

Link to comment
Share on other sites

IIRC I saw that command in a DarkMod thread somewhere a while back (or wiki?), so it's around here somewhere. Though I guess that doesn't help much if you don't know what to search for. You could look through the big threads on sound. (I'll search too; IIRC I posted about that experiment right after I did it too, so maybe I mentioned what it was there too.)

 

 

Isn't something like this already implemented in the mod? I recall reading something about pre-computing sound propagation data during map load. Is this only used for alerting AI?

 

At first I thought that's just normal EAX, then I realized as the video went on that (as I understood it) it was baked in according to the actual geometry and room properties and it's dynamic through space (integrating propagation and EAX?), which is a big thing. D3 EAX let's you set (by hand) EAX data for an entire location like reverb, room size, and air density, but it will be static through the whole location, and isn't sensitive to any geometry or actual properties of the room (actual size, textures, etc.), i.e., totally separate from actual propagation, which is as I understand it in D3 is just straight lines through VPs modulated by the EAX settings. Of all the cool things their system does, the occlusion of sound by geometry and realistic propagation simulation would probably be most awesome for us, especially if we could rig it player->guard.

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

I tried s_drawsounds 1, but as I said, it doesn't show any traces or directional information. It just shows a purple box around the sound origin, and gives the name of the sound (and possibly the min/max values as well; it's all text).

 

Ok, I've just checked this in standard Doom 3. s_drawsounds 1 DOES show directional information of where a sound is coming from and up to the last VP it travels through to get to you.

 

Spring, please make sure you are testing a sound generated through at least 1 VP away and there are no leaks.

 

I can't check in TDM right now but, if it's not working, something else is wrong.

Link to comment
Share on other sites

Spring, please make sure you are testing a sound generated through at least 1 VP away and there are no leaks.

 

Hmm, I was doing this in the tiny testmap with only two rooms and one visportal. There are no leaks. Yet I was not getting that behaviour at all.

 

Hmm, come to think of it, maybe it's because the visportal was very far away from the sound, so it wasn't actually going through any visportals. If the sound isn't going through any will any trace show up?

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

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • 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.
      · 7 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
×
×
  • Create New...