Author Topic: Let's talk about the sound code... again.  (Read 15978 times)

0 Members and 1 Guest are viewing this topic.

Offline Iss Mneur

  • 210
  • TODO:
Re: Let's talk about the sound code... again.
So I have had a chance to think about it.

As I see it, we have three options that may or may not work:
  • Change the way that we play the sounds so that we will only play two of each type and let them finish before we start again. My concern with this is it will make the thunder less "interesting" because it always plays through.
  • Change the nebula lightning so that it doesn't play thunder for every single strike. As it is right now, FSO attempts to play one of the thunder sounds for every single lightning bolt that is in range (about 1.5km), this is similar to what QD mentioned previously.
  • Try putting the the nebula sounds into 3D to see if we can make them sound better and/or reduce the annoyance of the sounds always being played directly behind your head.

TBH, I will probably try all three variations and see what is liked better.

Wait, so it starts playing a bunch of lightning sounds, but instead of waiting to add another one until the earlier ones are done, it just starts shifting them off starting at the first one played?
Yep.

@Herra Tohtori: I can't see why that wouldn't work, but I have to show my inexperience with OpenAL in this, I don't know if it is able to (though I can't see why not, you can't be the first person to have thought of this).  However, with in the nebula lighting in particular, being able to play 20 lighting sounds (of 48 available) channels seems like a waste to me, I can think of better sounds to be playing in those channels.
"I love deadlines. I like the whooshing sound they make as they fly by." -Douglas Adams
wxLauncher 0.9.4 public beta (now with no config file editing for FRED) | wxLauncher 2.0 Request for Comments

 

Offline Cyborg17

  • 29
  • A-1 Supar
Re: Let's talk about the sound code... again.
Can you change the code to only play lightning that is within about 250m-500m of the player?  That way the frequency of noise is down, but the closest, (most intense) lightning will always be played.

An added slight glare affect for lightning within that same range might help keep lightning interesting. <-- It's ok if that's too complicated, just adding ideas.

 

Offline Zacam

  • Magnificent Bastard
  • Administrator
  • 211
  • I go Sledge-O-Matic on Spammers
    • Minecraft
    • Steam
    • Twitter
    • ModDB Feature
Re: Let's talk about the sound code... again.

I do know that the Nebula Lightning is not currently tabled (in retail) as being a 3D sound, so we'd have to force that if we expect it to work on Retail data.

Course, we'll probably also have to check if a mod makes it a 3D sound and use that setting vs forcing it even if set. (This probably doesn't make much sense, I'll see if I can explain it after coffee)
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!
Talk with the FSU on #SCP-FSU Talk with the SCP on #SCP
"If you can keep a level head in all this confusion, you just don't understand the situation"

¤[D+¬>

[08/01 16:53:11] <sigtau> EveningTea: I have decided that I am a 32-bit registerkin.  Pronouns are eax, ebx, ecx, edx.
[08/01 16:53:31] <EveningTea> dhauidahh
[08/01 16:53:32] <EveningTea> sak
[08/01 16:53:40] * EveningTea froths at the mouth
[08/01 16:53:40] <sigtau> i broke him, boys

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Let's talk about the sound code... again.
How hard would it be to make it a 3D sound and write a table?  Or am I completely missing the point?

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Let's talk about the sound code... again.
@Herra Tohtori: I can't see why that wouldn't work, but I have to show my inexperience with OpenAL in this, I don't know if it is able to (though I can't see why not, you can't be the first person to have thought of this).  However, with in the nebula lighting in particular, being able to play 20 lighting sounds (of 48 available) channels seems like a waste to me, I can think of better sounds to be playing in those channels.

you should always try to make use of every sound channel there is. if sounds have a priority you could use up more sound channels for environmental effects when theres not much action going on, then have them use up fewer channels when there is combat. if priority worked like this:

1 self sounds (ship, hud, firing of player weapons etc)
2 combat sounds (beams, guns, missiles, other ships, explosions, etc)
3 environmental sounds (lightning)

priority 1 sounds always play and get first dibs on available sound channels
priority 2 and 3 sounds get 2nd and 3rd dibs on remaining sound channels.

sounds should also be further prioritized by distance from the player, play volume, and age in queue. drop distant and/or quiet sounds of priority 2 or greater. some sounds also need not be played on time, such as low priority sounds or sounds behind you that have no real effect on what your doing (things like shockwave explosions that hit you or that bogey on your six and its weapons would probably be excluded). so sounds are queued up as they are requested, and when this happens sounds are assigned a timestamp for its creation and also when it expires. expired sounds are removed from the queue. but an old sound that hasnt expired yet is a good candidate for de-prioritization.

of course before that happens you cull out a bunch of sounds if you have multiple instances of a single sound playing in close proximity to each other at close to the same time (probably determined using some 4d vector math), then the time and position should be averaged and a single sound played from that location and time (this would require some foreknowledge of what was gonna happen, as if the sounds were sitting in the queue for a couple of frames). this would improve the sounds of simultaneous lightning strikes and ship warpins, and assuming there wont be any clipping the sound could be played at a slightly higher volume (if your typical sound plays at 75% then you could amp the loud sound an additional 25% before clipping occurs). predictable events can even do this before hand making the sound queue smaller.

« Last Edit: August 27, 2011, 05:05:11 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: Let's talk about the sound code... again.
That's a great idea. This should get rid of problems with rapid-fire weapons causing sound problems, as well as improve overall immersion in a sound-rich environment (think a battle with a lot of rapid-fire guns).

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Let's talk about the sound code... again.
rapid fire weapons should just run a sound loop that lasts for several shots. youd have to have a real ocd to figure out that you fired fewer shots than shot sounds you heard. if the cables are still too thick you could probibly play part of a loop to represent the loose shots so it doesnt make you pluck your eyes out and eat them. if a loop represents 5 shots and only 3 shots are fired, play 60% of the sound. i think this is what stream was meant to do but either wasnt implemented or didnt work and was made to do nothing so that it didnt break a bunch of tables before the game was released. the fact that the flag mostly appears on rapid fire weapons really makes me think thats what happened.
« Last Edit: August 27, 2011, 05:48:17 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Zacam

  • Magnificent Bastard
  • Administrator
  • 211
  • I go Sledge-O-Matic on Spammers
    • Minecraft
    • Steam
    • Twitter
    • ModDB Feature
Re: Let's talk about the sound code... again.
How hard would it be to make it a 3D sound and write a table?  Or am I completely missing the point?

how does that help anybody running in "Retail" mode?
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!
Talk with the FSU on #SCP-FSU Talk with the SCP on #SCP
"If you can keep a level head in all this confusion, you just don't understand the situation"

¤[D+¬>

[08/01 16:53:11] <sigtau> EveningTea: I have decided that I am a 32-bit registerkin.  Pronouns are eax, ebx, ecx, edx.
[08/01 16:53:31] <EveningTea> dhauidahh
[08/01 16:53:32] <EveningTea> sak
[08/01 16:53:40] * EveningTea froths at the mouth
[08/01 16:53:40] <sigtau> i broke him, boys

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Let's talk about the sound code... again.
How hard would it be to make it a 3D sound and write a table?  Or am I completely missing the point?

how does that help anybody running in "Retail" mode?

If you are running retail, you don't need a build with the sound code. If you are playing with mediavp's this is a none issue.
Or am I missing something about this "Retail mode" ?
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Zacam

  • Magnificent Bastard
  • Administrator
  • 211
  • I go Sledge-O-Matic on Spammers
    • Minecraft
    • Steam
    • Twitter
    • ModDB Feature
Re: Let's talk about the sound code... again.

"Retail" mode means: FSO exec, sans MediaVPs. Note the quotes around Retail indicating that I don't mean Retail.
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!
Talk with the FSU on #SCP-FSU Talk with the SCP on #SCP
"If you can keep a level head in all this confusion, you just don't understand the situation"

¤[D+¬>

[08/01 16:53:11] <sigtau> EveningTea: I have decided that I am a 32-bit registerkin.  Pronouns are eax, ebx, ecx, edx.
[08/01 16:53:31] <EveningTea> dhauidahh
[08/01 16:53:32] <EveningTea> sak
[08/01 16:53:40] * EveningTea froths at the mouth
[08/01 16:53:40] <sigtau> i broke him, boys

 
Re: Let's talk about the sound code... again.
Pardon my ignorance, but are the nebula lightning sounds internally (from the engine's PoV) considered objects (models) generating sound or just an environmental thing that has X% of playing every Y seconds? I'm guessing the former based on Zacam's comments, but I just want to know for sure.
MentalPower
Lead Developer for the Auctioneer AddOns package.
http://auctioneeraddon.com/  |  http://enchantrix.org/

"When life hands you lemons, ask for tequila and salt." -Anonymous

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Let's talk about the sound code... again.
How hard would it be to make it a 3D sound and write a table?  Or am I completely missing the point?

how does that help anybody running in "Retail" mode?

Put the table as a vp in FS2 Root\tables or wherever they go.

 
Re: Let's talk about the sound code... again.
How hard would it be to make it a 3D sound and write a table?  Or am I completely missing the point?

how does that help anybody running in "Retail" mode?

Put the table as a vp in FS2 Root\tables or wherever they go.
That would not work since the SCP doesn't do VPs, only the FSU does VPs. In short, it would go against what the SCP is supposed to do.
MentalPower
Lead Developer for the Auctioneer AddOns package.
http://auctioneeraddon.com/  |  http://enchantrix.org/

"When life hands you lemons, ask for tequila and salt." -Anonymous

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Let's talk about the sound code... again.
Not if the table had a conditional to make it only be read by 3.6.xx like the music table for FSPort does.  Then it wouldn't be read unless you were using FSO exes.

 
Re: Let's talk about the sound code... again.
Not if the table had a conditional to make it only be read by 3.6.xx like the music table for FSPort does.  Then it wouldn't be read unless you were using FSO exes.
That's not the point. Both FSPort and FSU are content projects, VPs are their purpose. The SCP does code only, so if anyone were to do VPs it would have to be the FSU. However it would then be a moot point since Zacam's entire argument was what to do about people that don't use the MediaVPs that the FSU provides.
MentalPower
Lead Developer for the Auctioneer AddOns package.
http://auctioneeraddon.com/  |  http://enchantrix.org/

"When life hands you lemons, ask for tequila and salt." -Anonymous

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Let's talk about the sound code... again.
I thought that at this point, FSO required at minimum MV_Root.vp to operate?  And besides, .vps are just containers for the files.  If you wanted, you could make the table hard-coded into the FSO .exes and just have it able to be overridden by an actual .vp or .tbl in the FS2 file structure.  Right?

 

Offline The E

  • He's Ebeneezer Goode
  • Global Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Let's talk about the sound code... again.
What? No. I am quite sure that the exe still runs the retail data just fine. If it doesn't, that would be a serious regression.
Let there be light
Let there be moon
Let there be stars and let there be you
Let there be monsters and let there be pain
Let us begin to feel again
--Devin Townsend, Genesis

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: Let's talk about the sound code... again.
Several mods require a bare minimum of FSU compatibility provided by MV_Root.vp; many more mods require full MediaVP's. At least, as far as I know. I typically use mediavps anyway so I wouldn't know what mods can be run without...

The retail data still should work quite fine with FS2_Open engine.
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: Let's talk about the sound code... again.
Someone please give this patch a try and see if it does anything for the volume problems.

It seems quite apparent that the volume for all sound has increased at some point.  The actual volume for individual sounds appears to be the same, so I don't really have an explanation for the difference.  This patch just drops the gain for the master volume in OpenAL to more approximately match what the pre-new-sound code had (according to my ears in a quick test).

This does nothing for nebula lightning frequency though.  A better fix for that is simply editing the neblightning code to avoid playing sound too frequently, as opposed to re-imposing the hard playback count limits in the sound code directly (which was necessary at the time, but is a bug at this point).  There is really no reason to make nebula lightning 3D, as that isn't going to fix anything.  And it already avoids sound playback for any bolt over 400m away.  The code just needs to be modified to be smart about not playing too much sound in busy storms, which is something that it used to rely on the hardware limitations of the sound code to sort out.

[attachment deleted by ninja]

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Let's talk about the sound code... again.
I'd test but I'd like a file I can actually do anything with.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them