Jump to content
The Dark Mod Forums

Having an issue with areas and ambient sounds


Skaruts

Recommended Posts

I've been having this issue in my own fms, where the first time I enter a new area, the ambient sound will start out loud for a second, and then go down to the intended volume, instead of transitioning properly. 

This only seems to happen in my own fms, so maybe it's some setting I overlooked.

I made a small test map:

test_area_sounds.map

There are three areas in the test map. The second area has an ambient volume of -17 db, while the others have 0 db. The problem is noticeable to me right when the map loads and the first ambient starts playing, but it's even more noticeable when crossing to the second area, where the sound starts loud, and then goes way down and stays there. 

After I've entered all areas for the first time, then all is good, the sounds transition fine. As in, the volume goes down and then up to reveal the new ambient sound.

Edited by Skaruts

My FMs: By The Cookbook

My tools: TDM Packer

Link to comment
Share on other sites

1 hour ago, Skaruts said:

 

 

There are three areas in the test map. The second area has an ambient volume of -17 db, while the others have 0 db.

Hm...maybe I'm not understanding this correctly.

When I go from the first room to the second, then the third and back again, the first room is much too loud again. Are you sure it's not the same for you?

The fact that the transition from 1 to 2 is quite noticeable here is more likely due to the fact that ambient 1 is much too loud compared to the others. Why not simply reduce it as you did with ambient 2? I have now also set the volume for the first room to -17 and then I no longer notice a hard transition.

 

Edited by JackFarmer
Link to comment
Share on other sites

The problem isn't with the loudness per se, it's with the transitions. I'll try to put it more clearly.

When the map loads, there should be silence, and the first ambient should fade in from there. But what happens to me is that there's no fading at all, it just starts playing abruptly.

Same thing when going to area 2. What should happen is ambient 1 should fade out, and ambient 2 should fade in. Instead, what happens to me is an abrupt ambient switch, where ambient 1 stops and ambient 2 starts, and then after a second ambient 2 fades out to -17 db.

My FMs: By The Cookbook

My tools: TDM Packer

Link to comment
Share on other sites

It happens in your video too, though slightly less. It's there as the map starts, the ambient starts abruptly, then fades out a bit to the intended level. 

But notice in particular when you cross into area 2, there's a short sound glitch there. That's also this thing I'm referring to, but on my end it lasts quite a bit longer. That's the ambient starting abruptly, and then getting adjusted down to the intended level.

Didn't seem to happen when you went into area 3 though.

And then after that the transitions are all fine in the video.

 

Edited by Skaruts

My FMs: By The Cookbook

My tools: TDM Packer

Link to comment
Share on other sites

Hm, ja, I recall that problem from past projects. I think there is a default fade in time for all location settings based ambient sounds...? @demagogue

I create all my ambiences myself and (I think this problem was also one of the reasons) have provided them with longer fade ins to avoid hard transitions.

 

 

 

Link to comment
Share on other sites

You can walk through every entity and spawnarg in the set up piece by piece and see if there's a logical problem buried in there.

I don't recall how the fade-in works for the initial ambient anymore. It's been too long. But you can experiment to see if it's really borked.

But what I came to say is that note there's a Sound Override setting where you can just set up an ambient transition yourself by some trigger if the location transitions aren't working properly for some reason.

One thing you might try, if the initial ambient always borks the fade in no matter what you do, is to set a dummy initial sound by immediately triggering the Sound Override as soon as the map starts, like just a quarter second of silence, and then turn the Sound Override off a half second later to have the system immediately transition back into the initial location ambient, and then the fade in should work properly. It's a bit of a hack, but it could fix your problem. You might be able to think of other ways to deal with it along those kinds of lines.

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 wonder if this could have anything to do with it (in that same article, under "On Shader Names"):

Quote

One footnote on the sound shader names. The shader tdm_ambient_ambience_zoned.sndshd has a special command ("leadin") for its sounds that begins the ambient with a short pause. This is to pre-empt a possible *pop* of sound for loud ambients which can occur when the player's system slows down (and only occasionally, at that), so the player never hears the pop. (It's a quirk of how Doom3 does fade-ins; when you start a new sound, you have to rapidly fade it out first, like .001 seconds, then slowly fade back in. But if the system slows and the ambient starts loud, it might stretch that .001 to something audible.)

I don't know what they mean by "pop", though.

 

My FMs: By The Cookbook

My tools: TDM Packer

Link to comment
Share on other sites

In the early versions there was an initial pop of sound right at the moment of transition, then an immediate drop to zero sound, and then the fade in, or that's what I thought was happening. I never really understood the source of the problem to begin with, I guessed what I said above, and the shader business was a speculation about how to fix it if that really was the problem. 

I don't recall hearing that kind of pop since like 2010 though. So I figured it fixed itself at some point. It may have been that my laptop at the time was very, very slow, or something like that too.

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

Well, either way, I just found out that raising fidelay to 0.1 actually mitigates the problem I'm having. Raising to 1 makes it virtually gone, but a 1 second delay seems a bit too much to me. I think I can live with 0.1. I can still hear a slight burst of sound, but it's so small that it doesn't really bother me.

I'm also raising fodelay about the same. I suppose it sounds better if they're both the same.

My FMs: By The Cookbook

My tools: TDM Packer

Link to comment
Share on other sites

I wonder what the benefit is of a zone approach over a speaker approach.

Quote

For that there are two different options, a speaker approach which builds off this tutorial (described at the bottom of this tutorial, Adding_ambient_Sounds_to_your_Map#Ambient_Sounds_in_one_Area), and a zone approach described at Ambient Sounds, a zone approach, with the zone approach being the most powerful way to do it

source

 

It does not say why it's more powerful though.

Edited by datiswous
Link to comment
Share on other sites

I think one of the benefits is that you can control the ambient sounds in the menu, in separate slider from the regular sounds (speakers).

Another benefit is that the sound will play the same everywhere, while speakers only get louder based on proximity. Speakers are usually more suited for crickets, dog sounds, tavern sounds, running water, steam leaks, etc.

My FMs: By The Cookbook

My tools: TDM Packer

Link to comment
Share on other sites

On 1/19/2024 at 11:26 PM, Skaruts said:

Another benefit is that the sound will play the same everywhere, while speakers only get louder based on proximity. Speakers are usually more suited for crickets, dog sounds, tavern sounds, running water, steam leaks, etc.

Speakers only get louder or quieter while you are between the inner and outer sound radius. Once you are within the inner radius, the volume is constant. It is entirely possible to cover a large map area with a single omnidirectional speaker playing ambient music with a large inner radius which ensures a constant volume.

However there may be other advantages to using zone-based ambients (such as the ability to adjust the volume in settings, as you mentioned).

Link to comment
Share on other sites

On 1/20/2024 at 12:26 AM, Skaruts said:

I think one of the benefits is that you can control the ambient sounds in the menu, in separate slider from the regular sounds (speakers).

 

Apparently not:

Quote

Control of volume by 'Ambient Volume' menu setting

If you want to give the player user-friendly control over the sound volume (as with ambient music, which some players prefer off), include the keypair "s_music" "1" on the speaker entity.

Source

 

Link to comment
Share on other sites

Yea, there's that too. 

One definitive advantage of the zone approach is that it's easier to setup for irregular places. Speakers work based on a radius, but there might be areas within that radius that should have different ambient sounds.

Zones also let you easily define some transition settings, like fade in/out times, and such.

 

My FMs: By The Cookbook

My tools: TDM Packer

Link to comment
Share on other sites

On 1/22/2024 at 12:09 PM, Skaruts said:

One definitive advantage of the zone approach is that it's easier to setup for irregular places. Speakers work based on a radius, but there might be areas within that radius that should have different ambient sounds.

Keep in mind we're usually talking about something like a massive forest or mansion or cathedral, etc., where it's absurd to think you're going to cover it very well with a simple circle the radius of the whole area, or even 30 circles for all the different rooms or areas, whereas with the location system, the locations are created out of walls and doorways, so 99% of the time they're exactly overlapping where you want your ambients transitioning on and off.

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

On 1/19/2024 at 9:16 PM, demagogue said:

In the early versions there was an initial pop of sound right at the moment of transition, then an immediate drop to zero sound, and then the fade in, or that's what I thought was happening.

Isn't that what I'm experiencing, though? You can hear it in JackFarmer's video (3rd post). It seems to fit the description. 

Edited by Skaruts

My FMs: By The Cookbook

My tools: TDM Packer

Link to comment
Share on other sites

Jack's video seems to be gone, so I recorded a few of my own. (Hopefully you can see them, if imgur doesn't play tricks on me.)

This is what I had initially, before changing fidelay to 0.1 (default fidelay is 0.001). There are no fade-ins. Ambient starts playing abruptly.

 

 

This is what I have now with fidelay 0.1, which makes it bearable, but doesn't fix it. There's a short burst of sound, then silence, then fades in. 

 

 

 I'd like to stress that this only happens the first time I enter a location. After that all transitions work as they should. 

 

I also have issues with some ambient sounds, which I suppose could also be described as popping. 

Rright after the guard snores, there's a small "pfft" sound, and the ambient seems to get slightly louder. (I hope "pfft" sound is really in the video, and not just on my own speakers.)

Edited by Skaruts

My FMs: By The Cookbook

My tools: TDM Packer

Link to comment
Share on other sites

No I can't see the videos. Put them up on Youtube as non-listed videos. Also, what's your system? Is it a relatively slow or older system? The first time one enters a location, there's some work being done that might be pre-churned from then on, so I think it might have something to do with the work load slowing all kinds of things down, including the ambient going online.

If you know your way around DR (or editing the map file directly), you could test things like setting the native volume of the location entity to zero from the start, and see if it happens when other speakers turn on for other reasons the first time, like a trigger. It may be an issue that all speakers face that this system inherits.

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

Updated my previous post with youtube vids. Youtube is a lousy website for this kind of thing, though... If only imgur wasn't being a crap...

Anyway, my system is old and slow, yea, but I'm not sure this has to do with that. This seems to never happen to me in other people's missions, and in my missions it's only the first time I enter a location.

I've also had @Mat99reporting having this issue with my mission as well, but I don't know what kind of system he has.

 

My FMs: By The Cookbook

My tools: TDM Packer

Link to comment
Share on other sites

This is a different issue than the click of sound at the start of every transition that I was talking about in earlier posts that you're referencing. This may be a problem that's always been there but nobody really noticed or commented on it, or maybe only for certain ambients?

So the first problem is that the ambient starts abruptly at game start presumably because the sound system isn't online yet to process the fade in, and it just starts the ambient at full sound. So then you added a delay, but since you're not coming off of a previous fade out to sets the volume to zero, it plays the full volume ambient through that delay and then cuts to zero and fades in.

My idea is that if you want a fade in from the start, don't start with that ambient as it is. Start with a .1 second of silence, and then fade in the ambient.

There are two ways I can think to do that. (There might be other ways.)

1. Some ambient soundshaders start with a "leadin" spawnarg that starts it with a bit of silence, originally used to stop the click of sound (soundshaders ending in "_z", there were two versions, one with and one without the _z, unless that was later changed). You could confirm that the soundshader for that ambient uses a "leadin" arg, or if it does but it's not long enough, maybe use a custom soundshader to use a longer leadin blip of silence. (In that case you'd have to make the longer silence file yourself.)

2. Or another possibly easier way may be to start with an "override" sound, look at the Sound Override part of the tutorial with silence, and then after .1 second or whatever, transition that to the normal location-based ambient according to the instructions, and then the override sound will fade out and yours will fade in. I think you'd do that by setting the override arg to "1" from the start and then change it back to "0" after 0.1 seconds using Target_setKeyVal as the instructions say. Confirm that the "silence" sound is stereo. I noticed if you start it with a non-stereo sound, the system stays non-stereo. I think that was fixed, but good to double check. If it isn't, then you could do the same thing with a normal ambient that just starts off silent or very quiet for that first .1 second.

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

I think the issue was that I was using a zoned approach with non-zoned sounds. I switched to the *_z variations of them and the problem seems to be gone. Although, for some reason it seems I still need to have fidelay 0.1, which is probably a sign that there's still something wrong.

@demagogueIt took me a while to notice the _z sounds are in a separate folder, though... I had no idea what you were talking about when you mentioned them. Now I do. :) 

@peter_spy it's hopefully fixed in the latest, which I just released a couple hours ago. 

  • Like 1

My FMs: By The Cookbook

My tools: TDM Packer

Link to comment
Share on other sites

Since it's a one-off problem, only for the first ambient at game start, then the way you fixed it is really the right way, because the system-level alternative would be whole a little subsystem (a specialized fidelay and mandatory _z soundshader) just to handle the first 0.1 seconds of game start, and then the old system for all the maps already out there, which is a bit much. And I think it's not even that common because many ambients start quietly to begin with.

That said, there might be an easy bit of code that could make sure the fade in always works for the first ambient that doesn't mess with anything else in the system, like a hardcoded initial 0.1 sec. delay only for it, and that may be worth doing. But it'd need experimenting and testing to make sure it works as intended and doesn't have unintended consequences.

Anyway, it's good we have this documented for now as the way to fix the problem for other people in the future that run into it searching for a fix. In fact it'd be good to put in the wiki to make sure the fix doesn't get lost.

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

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

    • Sotha

      WIP mission name confirmed: "The Last Offering"
       
      · 5 replies
    • Sotha

      Today I started writing readables for my WIP mission.
      I wrote my usual text and then crammed it into AI and boom, high quality stuff comes out.
      I used to say that clipper is the mappers best friend, but now it seems it is more like "AI is the mappers best friend."
      · 2 replies
    • The Black Arrow

      Just saw further into 2.13 development, or is it 2.14? Anyway, proper Parallax Mapping...Absolutely fuck yes, please!
      · 2 replies
    • nbohr1more

      Happy Halloween! "Gem of Souls" is out:
       
      Psst, someone let Darkfate know...
      · 1 reply
    • The Black Arrow

      Is there a thread for "Moving Day 2: Look Who's Moving Now"? If not, could someone hint me on what is Dick's birthday? This mission is quite enjoyable on its disturbing creepy implications.
      · 3 replies
×
×
  • Create New...