pizzaoverhead

[1.0.x (partial)] Atmospheric Sound Enhancement v2.2 (2015-05-05)

334 posts in this topic

Adds the effects of the density, temperature and relative speed of the atmosphere to craft sounds. When breaking the sound barrier, muffled sounds (or optionally no sounds) will be heard from the craft when the camera is outside of the shock cone. When passing through the cone, you can hear the shockwave. When leaving the atmosphere, the sound gradually fades to muffled (or optionally nothing) in vacuum. Internally, sounds can always be heard but are muffled. Non-craft sounds such as music are unaffected.

Downloads

CurseForge | MediaFire

Source included, project also available on GitHub, licenced under GPL v2.

If you've enjoyed this, consider donating a cup of coffee to help with late night coding:

btn_donate_LG.gif

Credits

Thanks to velusip and szdarkhack for their major contributions to this mod. The plugin also makes reference to Deadly Reentry for compatibility with its particle effects.

Change log

v2.2 (2015-05-05)

  • Rebuilt for KSP 1.0.

v2.1.1

  • Rebuild for KSP 0.23 (no changes).

v2.1 (2013-11-27)

  • Fixed incorrect or missing sound effects in some situations.
  • Fixed some sounds being missed before first staging.
  • Slight performance improvements.

v2.0 (2013-11-21)

  • Added a configuration file.
  • Added the ability to choose between silence or muffled sound when supersonic or in a vacuum (muffled by default).
  • Customised condensation and re-entry effects.
  • Fixed issues with the Mach sounds not always being played at the correct angles.

v1.1 (2013-11-03)

  • Fixed sounds still playing while paused.
  • Fixed slowdown when going supersonic.

v1.0 (2013-11-02)

  • Initial release.

Configuration options

The effects can be customised by modifying settings.cfg in the GameData/AtmosphericSoundEnhancement directory:

  • interiorMaxFreq - How muffled the sounds heard inside the craft are. Sounds above this frequency aren't heard. It can be anywhere between 10 (a deep rumble that can only be heard with high-quality speakers) and 22000 Hz (not muffled at all). 0 disables internal sounds.
  • maxVacuumFreq - How muffled the sounds are in external views when in a vacuum, similar to interiorMaxFreq. 0 disables sounds, 22000 gives normal, unmuffled sounds.
  • maxSupersonicFreq - How muffled the sounds are when the camera is ahead of the supersonic shock wave when in an extarnal view, similar to interiorMaxFreq. 0 disables all sounds, 22000 gives normal, unmuffled sounds.
  • interiorVolumeScale - A multiplier for the volume inside the craft. 1 is 100%, 0.5 is 50%, 2 is 200%, 0 for silence.
  • maxDistortion - How distorted and crunchy the sound of the shock wave is. 0 is off (normal) and 1 is on fully (may cause crackling).
  • lowerMachThreshold - The Mach number at which the sonic boom starts to kick in.
  • upperMachThreshold - The Mach number at which the sonic boom finishes fading away.
  • negativeSlopeWidthDeg - The angle (in degrees) behind the shock cone that the shock wave fades away over.

Current state

Anything using EFFECTS nodes such as multi mode engines like the R.A.P.I.E.R., as well as the NASA engines, jet engines and Hot Rockets mod, currently aren't affected by this mod due to the way they work. I'm working on changes to deal with this, and hopefully improve performance in general.

Edited by pizzaoverhead
7 people like this

Share this post


Link to post
Share on other sites

Huh... you included your source code in the package but no dll...

Share this post


Link to post
Share on other sites

Thanks HoneyFox. It should be fixed now.

Share this post


Link to post
Share on other sites

Nova made a mod like this but it still muffled music and chatterer. Can you still hear music and chatterer in this one?

Share this post


Link to post
Share on other sites

Yes, music and any sound effects that don't come from parts are unaffected. Unlike Nova's mod, there's no sound at all in space, but I plan on adding the option for that in future.

Share this post


Link to post
Share on other sites

Great! I love such immersive mods, thx! ^_^

Share this post


Link to post
Share on other sites

Uh, that looks, err... sounds interesting, testing as we speak.

Edit: This is just... wow. The mach effects... never heard a thing like this... especially with ferram it feels just like you were flying a real supersonic jet.

Edited by MarrusQ
added first impressions

Share this post


Link to post
Share on other sites

One question:

it seems like the mach cone is not after the rocket sometimes... when the rocket is flying forward with a speed above Mach 1 (probably also above Mach 2, i rememer that the speed is around 1000m/s at that moment.), the position that i can hear the sound will be somewhere in front of the rocket sometimes, or sometimes somewhere under the back of the rocket for around 15 degrees, instead of just right behind it. and my rocket is flying with almost zero AOA at around 30000m ASL so that can rule out some possibilities i guess.

Share this post


Link to post
Share on other sites

I like this. However in its current form it kills my performance due to the endless stream of debug logging. I built a version without it and it works great though :)

Now, I'm interested to contribute to this. First off, with this mod the engine sounds continue playing in the pause menu. I'll try to figure out how to stop that from happening.

Secondly, I'm (later on) going to see if I can make this talk to FAR in some way, to get the density and speed of sound from there (way more accurate). I'll post updates if I manage any of these :P

Share this post


Link to post
Share on other sites

Subscribed, been waiting for this... Indeed the FAR integration would be most excellent.

Share this post


Link to post
Share on other sites

Whenever I go supersonic the game slows down like crazy, how do we fix this?

Share this post


Link to post
Share on other sites

Thanks for the bug reports. Version 1.1 is out now with fixes for the sounds when paused and (hopefully) the slowdown.

I'm (later on) going to see if I can make this talk to FAR in some way, to get the density and speed of sound from there (way more accurate). I'll post updates if I manage any of these :P

I haven't used FAR myself in a long time, but getting accurate data from it would give a slight speed bonus rather than calculating values twice, as well as having the effects line up with it. I'll have a look at it. Feel free to have a look at the code yourself too. :)

Edited by pizzaoverhead

Share this post


Link to post
Share on other sites
Thanks for the bug reports. Version 1.1 is out now with fixes for the sounds when paused and (hopefully) the slowdown.

I'm making steady progress. I've cleaned up the code (lots of redundant checks in there) and removed some unused stuff. Here's my current source: AtmosphericSoundEnhancement.cs

It works the same way as the original as far as I can tell, except I changed the shock width to 15 degrees (feel free to change it back) and used the ideal gas formula for the speed of sound. I'm going to try to get a less distorted pressure wave going before Mach 1, it kicks in too suddenly for my liking. Feel free to use (or not use) the code :P

Share this post


Link to post
Share on other sites

Tested it, encountered a few glitches (or maybe this is due to FAR):

- on my hypersonic jet, the sound was muffled from the rear, and full on from the front (over mach 1.7)

- in space sounds disappear alright during ascent, but once i switch view to another ship or if i use time warp, sounds come back.

Share this post


Link to post
Share on other sites

Also, sound explosions in space still occur (such as in pusher plate orion mod, when I launch a nuke to push off, the explosions are still heard even in space).

Share this post


Link to post
Share on other sites

We should have some kind of visual indicator of the shockwave.. Like a sudden flash of intense white raycasting, like they already have,

Share this post


Link to post
Share on other sites

I agree, would like to see something like this.

Also, mabye add hypersonic effects, if there are any.

Share this post


Link to post
Share on other sites

I Don't hear the sonic boom when I enter the shock cone, I hear the sounds changing, But no boom.

.. The Boom is the whole reason I got this mod, Is there something Im missing?

I Have FAR And DRE Installed.

Share this post


Link to post
Share on other sites

Ah, I figured it out, For some reason I was looking in the wrong place. The shock one is at the NOSE, Not the tail! Silly me. There needs to be a Flyby cam for this game though.

Share this post


Link to post
Share on other sites
We should have some kind of visual indicator of the shockwave.. Like a sudden flash of intense white raycasting, like they already have,

I remember that old versions of FAR have some particle effects when rockets are passing Mach 1. Unfortunately ferram removed this effect after the stock game introduced the aerodynamic FX which hardly appears at Mach 1. I really hope that ferram can add that effect back, thus creating deep immersion when used with this sound plugin together.

Share this post


Link to post
Share on other sites

This mod is really cool but I've only got it to work 1 time for some reason, the rest of the times I've launched KSP it isn't working.

edit: Nevermind, apparently I had a left over FAR dll.

Edited by nater

Share this post


Link to post
Share on other sites

Excellent, can't wait to try this!

Share this post


Link to post
Share on other sites
I'm making steady progress. I've cleaned up the code (lots of redundant checks in there) and removed some unused stuff. Here's my current source: AtmosphericSoundEnhancement.cs

It works the same way as the original as far as I can tell, except I changed the shock width to 15 degrees (feel free to change it back) and used the ideal gas formula for the speed of sound. I'm going to try to get a less distorted pressure wave going before Mach 1, it kicks in too suddenly for my liking. Feel free to use (or not use) the code :P

Thanks SZDarkhack, I'll take a look at it. I intend on having the distortion effect fade in (independent of observer position) between Mach 0.8 and Mach 1, similar to

video. The shock width should narrow as the shock cone tightens, but that isn't implemented yet.
Tested it, encountered a few glitches (or maybe this is due to FAR):

- on my hypersonic jet, the sound was muffled from the rear, and full on from the front (over mach 1.7)

- in space sounds disappear alright during ascent, but once i switch view to another ship or if i use time warp, sounds come back.

Thanks for the bug report! I'll check it out.

I remember that old versions of FAR have some particle effects when rockets are passing Mach 1. Unfortunately ferram removed this effect after the stock game introduced the aerodynamic FX which hardly appears at Mach 1. I really hope that ferram can add that effect back, thus creating deep immersion when used with this sound plugin together.

Particle and shader effects aren't something I've worked with before, but I'll see what I can do.

Share this post


Link to post
Share on other sites

The tools to do this seems to already exist inside the game, The same Aerodynamic FX (The White shockwaves off the plane)Could be Amplified for about 3 seconds!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now