Jump to content
The Dark Mod Forums

Visportals that can decrease sound


RPGista

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
Link to comment
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).

Link to comment
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?

Link to comment
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

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
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

Link to comment
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

Link to comment
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
Link to comment
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

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

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

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

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

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

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

Link to comment
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

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

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

Link to comment
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

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

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

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

    • Ansome

      Finally got my PC back from the shop after my SSD got corrupted a week ago and damaged my motherboard. Scary stuff, but thank goodness it happened right after two months of FM development instead of wiping all my work before I could release it. New SSD, repaired Motherboard and BIOS, and we're ready to start working on my second FM with some added version control in the cloud just to be safe!
      · 0 replies
    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
×
×
  • Create New...