Jump to content
The Dark Mod Forums
Sign in to follow this  
RPGista

Visportals that can decrease sound

Recommended Posts

When I commit the sound improvements, I'll include a test map for those with SVN access.

 

It includes examples of:

 

1 - Variable occlusion as doors (and windows) open and close.

 

2 - Use of the "transparent" flag on glass doors (windows) that can now have visportals touching them. The flag prevents the portal from closing when the door is closed.

 

3 - Occlusion through a hole in the floor using a location separator. (Springheel's famous "patrolling guard is in the room with me" problem.)

 

4 - Location separator on a door now contributes to occlusion.

 

5 - The new portal settings entity contributing to door occlusion.

 

6 - A func_fracture changing occlusion based on whether it's intact or broken. (aka brittle fracture)

 

7 - A func_portal closing w/o occluding sound.

 

Are there any other situations folks can think of that they'd want an example of?

 

Thanks.

  • Like 1

Share this post


Link to post
Share on other sites

After I've committed the sound improvements, I'll update the wiki sound pages to discuss them. If there isn't already a page focused on sound occlusion, I'll add one showing how sound inclusion works, both for AI and the player. Perhaps one for mappers and one for developers (we'll see how much gas I have left in this tank).

Share this post


Link to post
Share on other sites

This all sounds fantastic; a huge improvement for 1.09.

 

The sound loss spawnargs on doors, location separators, and the portal settings entities are all in dB, and affect both AI- and player-heard sounds.

 

Is dB the unit for "volume" in soundshaders?

Share this post


Link to post
Share on other sites

Is dB the unit for "volume" in soundshaders?

 

Yes. The default setting for sound shader volume is 0dB, which means "don't adjust the volume".

Share this post


Link to post
Share on other sites

Please comment.

 

These things sound like an excellent update (pun intentional) and I have nothing to add. New features and a wiki article describing how to use them. Perfect!


Clipper

-The mapper's best friend.

Share this post


Link to post
Share on other sites

Excellent work. Congats. :smile:

Please comment.

I don't think this is really neccesary in general. But some mappers may want to use it sometimes, so if the effort isn't that high ...


FM's: Builder Roads, Old Habits, Old Habits Rebuild

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites
I don't think this is really neccesary in general. But some mappers may want to use it sometimes, so if the effort isn't that high ...

 

+1

Share this post


Link to post
Share on other sites

6 - A func_fracture changing occlusion based on whether it's intact or broken. (aka brittle fracture)

 

 

probably not needed but this made me think of something. A possible checkbox to close touching portal. Not needed for glass but if someone build a stone wall that needs blown up, would be nice for the portal to be closed (but like I said, probably not necessary, don't even know if it would ever be used anyway.


Dark is the sway that mows like a harvest

Share this post


Link to post
Share on other sites

This would let mappers create different occlusion values on portals. For example, if they want to make it easier for the player to hear through a portal than an AI. Or vice versa.

 

I can definitely see uses for this - maybe the mapper wants the player to overhear a conversation going on in the next room, through a small opening, and want to artificially increase the volume for that purpose; so yes, if not too much trouble, this gives more control to mappers and that is always positive.

Edited by RPGista

Share this post


Link to post
Share on other sites

probably not needed but this made me think of something. A possible checkbox to close touching portal. Not needed for glass but if someone build a stone wall that needs blown up, would be nice for the portal to be closed (but like I said, probably not necessary, don't even know if it would ever be used anyway.

This can be done via a func_portal.


FM's: Builder Roads, Old Habits, Old Habits Rebuild

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

Really looking forward to trying the changes. :) This has been something that people have mentioned about the TDM sound for a long time. It should definitely make an impression. :)

Share this post


Link to post
Share on other sites

I think having a spawnarg to turn it on for AI & players differently would be worth it ... I can think of cases when you want the player to be cued to something & not an AI.

 

One question, what's the reason for making a new entity on top of the locationSeparator again? It seems there's already an entity for this job (in the locationSeparator) that could have everything unified in one place. It's not a big deal and I don't doubt you had a good reason, but I just didn't get the logic of making a new entity.


What do you see when you turn out the light? I can't tell you but I know that it's mine.

Share this post


Link to post
Share on other sites

One question, what's the reason for making a new entity on top of the locationSeparator again? It seems there's already an entity for this job (in the locationSeparator) that could have everything unified in one place. It's not a big deal and I don't doubt you had a good reason, but I just didn't get the logic of making a new entity.

 

So we can provide the same sound loss functionality w/o splitting a location in half. Locations can become very confusing and complicated very quickly w/o having to add more of them just to control sound.

Share this post


Link to post
Share on other sites

Getting and setting the sound loss on location separators and portal settings entities via script is now working.

 

I added an example to the test map of increasing and decreasing sound volume through a brittle fracture via buttons.

 

Today I'll look at whether it's possible to have AI-only sound loss and player-only sound loss on these entities.

Share this post


Link to post
Share on other sites

Today I'll look at whether it's possible to have AI-only sound loss and player-only sound loss on these entities.

 

Done and working.

 

Tomorrow I'll clean everything up and commit to SVN.

  • Like 2

Share this post


Link to post
Share on other sites

Thanks for this grayman.

 

So we can provide the same sound loss functionality w/o splitting a location in half. Locations can become very confusing and complicated very quickly w/o having to add more of them just to control sound.

 

Sorry I was getting confused about the very thing I used to work on. Of course you can have portals that don't separate locations; don't know why I didn't remember that. I guess I was just assuming things like windows are natural places to switch, but you're right, there's no need to force that on people.


What do you see when you turn out the light? I can't tell you but I know that it's mine.

Share this post


Link to post
Share on other sites

Might not be done today.

 

Ran into the problem of sound from the same speaker reaching the player from two portals.

 

Imagine you're in a room with an open door and a closed window onto another room with a loud sound in it. The sound is reaching you through the closed window and open door. The sound code is picking the path with the smallest distance, ignoring any other paths.

 

So if you walk from the window (closed, lots of sound loss) to the door (open, no sound loss), the sound jumps from quiet to loud when the path through the door is shorter than the path through the window.

 

I'm working on an averaging scheme that considers all paths. Somewhat working, but not mathematically accurate yet.

 

This isn't a problem in 1.08 because the window doesn't have any sound loss, so with the door open, the sound is loud wherever you go. (Close the door and the sound is still loud, because it's coming through the window.)

 

So, for improved sound, the math needs to get a bit more picky.

 

Perhaps tomorrow.

Share this post


Link to post
Share on other sites

Instead of choosing the shortest path it may be an option to choose the "loudest" one.


FM's: Builder Roads, Old Habits, Old Habits Rebuild

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

Say you have two possible pathways from a sound source to the listener. If you account for the length of each path and the speed of sound you get an time of arrival. This slight offset is one of the cues your brain uses to locate the source of a sound. By using separate speaker entities placed at each visportal you can easily have a sound play in two distinct locations at slightly different times.

Share this post


Link to post
Share on other sites

This is not the problem. The problem is that the sound reduction is choosen by the shortest path. But this path must not be the one on which the sound reduction is the lowest. This causes jumps in the volume of sounds when using doors in connedtion with windows where you can look trough.


FM's: Builder Roads, Old Habits, Old Habits Rebuild

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

This work is done and commited. Src rev 5695 and darkmod rev 13326.

 

Find all the details here.

 

I included a test map, playersound.map. Read playersound.txt for a walkthrough. You can play this map with 1.08 for comparison, but you'll have to put "//" (comment) on these lines in playersound.script:

 


void IncreaseSoundLoss()
{
//  float loss = $PortalSettingsGen.getSoundLoss(); // get current sound loss
//  loss = loss + 1; // increase loss by 1 (lower volume)
//  $PortalSettingsGen.setSoundLoss(loss);
}

void DecreaseSoundLoss()
{
//  float loss = $PortalSettingsGen.getSoundLoss(); // get current sound loss
//  loss = loss - 1; // decrease loss by 1 (raise volume)
//  $PortalSettingsGen.setSoundLoss(loss);
}

 

These script routines are for the volume-adjusting buttons near the end of the map, which won't work in 1.08.

 

I included tdm_game01.pk4 and TheDarkMod.exe for Windows.

 

I tried building the linux files, but got a scons error, so a linux person will need to provide these.

 

If you find things you don't like, or have other suggestions, post them here and I'll see what can be done.

  • Like 1

Share this post


Link to post
Share on other sites

So it averages the volume and then projects the same value through all openings, windows or open doors?

I would have thought it might be more like a fading effect, it's still a little quieter by a closed window & a bit louder by an open door, and the volume might gradually fade from one to the other by proximity as you move from one to the other or some variation of fading.

 

But maybe that's more complex than it needs to be and your fix here (if I understand it) is fine for practical purposes. So no worries.


What do you see when you turn out the light? I can't tell you but I know that it's mine.

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...