Jump to content

[1.12.3] Rocket Sound Enhancement - Plugin: v0.9.6 - 07/09/22 | Config Pack: v1.2.4 - 07/09/22


ensou04

Recommended Posts

Just now, linuxgurugamer said:

Not sure I missed this, but every time I pan from the front of a rocket to the back, I get the sonic boom.  

Would it be possible to not play that after the first time?  If not, could there be a way to just disable that sound?

You can only disable it in RSE's Settings > Advance Settings > Mach Effects and set to zero or Set Muffling Quality to Normal. This will disable Mach Effects entirely though not just remove the Sonic Boom.

You could manually remove the sonic booms in RocketSoundEnhancementDefault/Configs/ShipEffects.cfg by deleting the entire SONICBOOM node

 

9 hours ago, linuxgurugamer said:
 IndexOutOfRangeException: Index was outside the bounds of the array.
   at RocketSoundEnhancement.PartModules.RSE_Module.PlaySoundLayer (RocketSoundEnhancement.SoundLayer soundLayer, System.Single control, System.Single volume, System.Boolean rndOneShotVol) [0x002e8] in <38e9f5d8981a4a08b8e345cb0552120c>:0 
   at RocketSoundEnhancement.PartModules.RSE_RCS.LateUpdate () [0x000fb] in <38e9f5d8981a4a08b8e345cb0552120c>:0 

I can't seem to recreate this error with ReStock and Near Future Launch Vehicles installed. But I do have a suspicion of what might be causing it and have a quick fix for it.

Link to comment
Share on other sites

Just now, ensou04 said:

can only disable it in RSE's Settings > Advance Settings > Mach Effects and set to zero or Set Muffling Quality to Normal. This will disable Mach Effects entirely though not just remove the Sonic Boom.

You could manually remove the sonic booms in RocketSoundEnhancementDefault/Configs/ShipEffects.cfg by deleting the entire SONICBOOM node

That will suffice, thanks

Just now, ensou04 said:

seem to recreate this error with ReStock and Near Future Launch Vehicles installed. But I do have a suspicion of what might be causing it and have a quick fix for it

Doesn't  happen all the time,  I was in the middle of my Twitch stream when it started.  Might have been after a staging event, I'm not sure.

 

Link to comment
Share on other sites

@linuxgurugamer that narrows it down to possibly only happening after launch. The only array that is unguarded in PlaySoundLayer method is the audioClip array because I assume this will never be unloaded.  These are loaded during part's OnStart().

can you take a look see? https://github.com/ensou04/RocketSoundEnhancement/blob/e80aa384fcae223c66c4be68d07ddac52142a065/Source/RocketSoundEnhancement/PartModules/RSE_Module.cs#L290-L296

 

Link to comment
Share on other sites

1 hour ago, ensou04 said:

@linuxgurugamer that narrows it down to possibly only happening after launch. The only array that is unguarded in PlaySoundLayer method is the audioClip array because I assume this will never be unloaded.  These are loaded during part's OnStart().

can you take a look see? https://github.com/ensou04/RocketSoundEnhancement/blob/e80aa384fcae223c66c4be68d07ddac52142a065/Source/RocketSoundEnhancement/PartModules/RSE_Module.cs#L290-L296

 

What happens when an engine is staged away?  Actually, if I remember correctly, there were two cryo engines staged, then four SRBs, and then a main cryo engine. 

There were RCS engines on the rocket, and what strikes me is this:

at RocketSoundEnhancement.PartModules.RSE_RCS.LateUpdate

which seems to indicate it was related to an RCS module?  The RCS was still there, but the Monoprop tanks might have been jettisoned at that time.

 

I looked at the code, is there any chance that the audioClips would be empty?  You are checking for it to be null, but after you check the length

int index = soundLayer.audioClips.Length > 1 ? Random.Range(0, soundLayer.audioClips.Length - 1) : 0;

if (soundLayer.loop && soundLayer.audioClips != null && (source.clip == null || source.clip != soundLayer.audioClips[index]))
{
	source.clip = soundLayer.audioClips[index];
	source.time = soundLayer.loopAtRandom ? loopRandomStart * source.clip.length : 0;
}
AudioUtility.PlayAtChannel(source, soundLayer.channel, vessel == FlightGlobals.ActiveVessel, soundLayer.loop, volumeScale, !soundLayer.loop ? soundLayer.audioClips[index] : null);

I'd suggest doing something like this instead:

if (soundLayer.audioClips != null && soundLayer.audioClips.Length > 0)
{
	int index = soundLayer.audioClips.Length > 1 ? Random.Range(0, soundLayer.audioClips.Length - 1) : 0;

	if (soundLayer.loop && (source.clip == null || source.clip != soundLayer.audioClips[index]))
	{
		source.clip = soundLayer.audioClips[index];
		source.time = soundLayer.loopAtRandom ? loopRandomStart * source.clip.length : 0;
	}
	 AudioUtility.PlayAtChannel(source, soundLayer.channel, vessel == FlightGlobals.ActiveVessel, soundLayer.loop, volumeScale, !soundLayer.loop ? soundLayer.audioClips[index] : null);
}

 

Not sure if I got the code correct for the PlayAtChannel, but I think you will get my idea

Link to comment
Share on other sites

2 hours ago, linuxgurugamer said:

What happens when an engine is staged away?  Actually, if I remember correctly, there were two cryo engines staged, then four SRBs, and then a main cryo engine.

RSE_Module doesn't do anything in particular on stage events so I'm not sure what might be an issue. Log also indicates that the out of bounds happened on PlaySoundLayer so I assumed the error might have been there.

RSE_RCS code is short enough though so it should be easy to spot what might be the issue :

//RSE_RCS LateUpdate()
var thrustTransformsCount = moduleRCSFX.thrusterTransforms.Count > 0 ? moduleRCSFX.thrusterTransforms.Count : 1;
var thrustForces = moduleRCSFX.thrustForces;
float control = thrustForces.Take(thrustTransformsCount).Average() / moduleRCSFX.thrusterPower;

foreach (var soundLayer in SoundLayers)
{
    string sourceLayerName = soundLayer.name;

    if (!Controls.ContainsKey(sourceLayerName))
    {
        Controls.Add(sourceLayerName, 0);
    }

    float smoothControl = AudioUtility.SmoothControl.Evaluate(control) * (30 * Time.deltaTime);
    Controls[sourceLayerName] = Mathf.MoveTowards(Controls[sourceLayerName], control, smoothControl);

    PlaySoundLayer(soundLayer, Controls[sourceLayerName], Volume * thrustTransformsCount);
}

Particularly my references to moduleRCSFX. Is it possible that either moduleRCSFX.thrusterTransforms or moduleRCSFX.thrustForces length could have changed during staging events ?

 

2 hours ago, linuxgurugamer said:

I looked at the code, is there any chance that the audioClips would be empty?  You are checking for it to be null, but after you check the length

it shouldn't be empty because they are initialize on soundLayer parsing, I left it unguarded so its easier to spot if you assigned the wrong clip path in the configs.

the only way it could be empty is if audioClip is empty or incorrect in the config.

2 hours ago, linuxgurugamer said:

I'd suggest doing something like this instead:

I'll do this and then just log an error on soundLayer creation when the it fails to load an audioClip.

thank you!

 

Edited by ensou04
Link to comment
Share on other sites

Hello,

I get some issues with last update (0.9.6).

With UI, I can't save Mach Effects Amount. Other settings are saved correctly but not Mach Effects Amount. Each time I'm reload scene, Mach Effects back to 90%.

I tried to directly change MachEffectsAmount to 0 in settings file and it work (when I'm reload scene, Mach Effects is to 0%)., but I get no sound from engines and some time the game crash.

I'm revert back to 0.9.5 and everything is fine.

I haven't been further in my investigations, I thought you may be will know where it from, but if you need more tell me.

Link to comment
Share on other sites

@Vandest thanks for letting me know! you can give new build a try and see if it works well for you https://github.com/ensou04/RocketSoundEnhancement/tree/master/GameData/RocketSoundEnhancement/Plugins

For everyone else, do not set MachEffectsAmount to zero as its broken in the current release, just use Muffler Quality: Normal for now if you don't want mach effects.

Link to comment
Share on other sites

On 7/11/2022 at 12:00 PM, ensou04 said:

RSE_Module doesn't do anything in particular on stage events so I'm not sure what might be an issue. Log also indicates that the out of bounds happened on PlaySoundLayer so I assumed the error might have been there.

RSE_RCS code is short enough though so it should be easy to spot what might be the issue :

//RSE_RCS LateUpdate()
var thrustTransformsCount = moduleRCSFX.thrusterTransforms.Count > 0 ? moduleRCSFX.thrusterTransforms.Count : 1;
var thrustForces = moduleRCSFX.thrustForces;
float control = thrustForces.Take(thrustTransformsCount).Average() / moduleRCSFX.thrusterPower;

foreach (var soundLayer in SoundLayers)
{
    string sourceLayerName = soundLayer.name;

    if (!Controls.ContainsKey(sourceLayerName))
    {
        Controls.Add(sourceLayerName, 0);
    }

    float smoothControl = AudioUtility.SmoothControl.Evaluate(control) * (30 * Time.deltaTime);
    Controls[sourceLayerName] = Mathf.MoveTowards(Controls[sourceLayerName], control, smoothControl);

    PlaySoundLayer(soundLayer, Controls[sourceLayerName], Volume * thrustTransformsCount);
}

Particularly my references to moduleRCSFX. Is it possible that either moduleRCSFX.thrusterTransforms or moduleRCSFX.thrustForces length could have changed during staging events ?

 

it shouldn't be empty because they are initialize on soundLayer parsing, I left it unguarded so its easier to spot if you assigned the wrong clip path in the configs.

the only way it could be empty is if audioClip is empty or incorrect in the config.

I'll do this and then just log an error on soundLayer creation when the it fails to load an audioClip.

thank you!

 

Some more detailed info:

This only happens when RCS is used.  The part in question causing the problem (not saying it's the only one) is:

Mod: ReStockPlus
Name: restock-rcs-block-multi-2
Path: ReStockPlus/Parts/Control/RCS/restock-rcs-block-multi-2/restock-rcs-block-multi-2

I have confirmed that this doesn't happen with the stock RCS

 

Edit: I've looked at both parts, the only difference that I can see in the configs is that the Restock ones have two MODEL_MULTI_PARTICLE sections while the stock one only has one.  Also, Restock has an additional module:   ModuleRestockDepthMask.  See the configs below

Stock:

Quote
	EFFECTS
	{
		running
		{
			AUDIO_MULTI_POOL
			{
				channel = Ship
				transformName = RCSjet
				clip = sound_rocket_mini
				volume = 0.0 0.0
				volume = 0.02 0.1
				volume = 0.5 0.1
				volume = 1.0 0.1
				pitch = 0.0 0.75
				pitch = 1.0 1.5
				loop = true
			}
			MODEL_MULTI_PARTICLE
			{
				modelName = Squad/FX/Monoprop_small
				transformName = RCSjet
				emission = 0.0 0.0
				emission = 0.1 0.0
				emission = 1.0 1.0
				speed = 0.0 0.8
				speed = 1.0 1.0
				localRotation = -90, 0, 0
			}
		}		
	}
	
	MODULE
	{
		name = ModuleRCSFX
		stagingEnabled = False
		thrusterTransformName = RCSthruster
		thrusterPower = 1
		resourceName = MonoPropellant
		resourceFlowMode = STAGE_PRIORITY_FLOW
		runningEffectName = running
		atmosphereCurve
		{
			key = 0 240
			key = 1 100
			key = 4 0.001
		}
	}

 

 

Restock:

Quote
 EFFECTS
  {
    running
    {
      AUDIO_MULTI_POOL
      {
        channel = Ship
        transformName = RCSjet
        clip = sound_rocket_mini
        volume = 0.0 0.0
        volume = 0.1 0.0
        volume = 0.5 0.025
        volume = 1.0 0.1
        pitch = 1.0
        loop = true
      }
      MODEL_MULTI_PARTICLE
      {
        name = FX1
        modelName = ReStock/FX/restock-fx-rcs-1
        transformName = RCSjet
        emission = 0.0 0.0
        emission = 0.1 0.0
        emission = 1.0 1.0
        speed = 0.0 0.8
        speed = 1.0 1.0
      }
      MODEL_MULTI_PARTICLE
      {
        name = fx2
        modelName = ReStock/FX/restock-fx-rcs-1
        transformName = RCSjet
        emission = 0.0 0.0
        emission = 0.2 0.0
        emission = 1.0 1.0
        speed = 0.0 1.0
        speed = 1.0 1.0
        localRotation = 0, 0, 0
        localOffset = 0, 0.1, 0
      }
    }
  }
  MODULE
  {
    name = ModuleRCSFX
    thrusterTransformName = RCSthruster
    thrusterPower = 1
    stagingEnabled = False
    resourceFlowMode = STAGE_PRIORITY_FLOW
    resourceName = MonoPropellant
    runningEffectName = running
    atmosphereCurve
    {
      key = 0 240
      key = 1 100
    }
  }
  MODULE
  {
    name = ModuleRestockDepthMask
    maskTransform = RCSMask
  }

 

 

Edited by linuxgurugamer
Link to comment
Share on other sites

I don't know if this is a feature or a bug but SRBs have like no sound at all for me except for the startup. I guess this is decent so we can just listen to the main engines roar but when flying rockets that have solely solid rocket stages like Titan III/IV or Ares-I it gets kinda awkward flying a silent rocket. Thanks

Link to comment
Share on other sites

1 hour ago, SpaceFace545 said:

I don't know if this is a feature or a bug but SRBs have like no sound at all for me except for the startup. I guess this is decent so we can just listen to the main engines roar but when flying rockets that have solely solid rocket stages like Titan III/IV or Ares-I it gets kinda awkward flying a silent rocket. Thanks

That's definitely a bug, I will look into it

Edited by ensou04
Link to comment
Share on other sites

  • 2 weeks later...
On 7/21/2022 at 7:22 PM, SpaceFace545 said:

I don't know if this is a feature or a bug but SRBs have like no sound at all for me except for the startup. I guess this is decent so we can just listen to the main engines roar but when flying rockets that have solely solid rocket stages like Titan III/IV or Ares-I it gets kinda awkward flying a silent rocket. Thanks

Do you happen to have SWE installed? It may be an overlap of the sounds

Link to comment
Share on other sites

  • 3 weeks later...

This appears to have a conflict with Kerbalism. When an engine fails, the sound gets stuck and keeps playing a rocket rumble. I tested it by failing an engine with minimal throttle and you get really no noise... but if you full-throttle a failure you get stuck with this rumble.

Although... when an engine fails on me in Kerbalism even before the mod, I had problems with the 'shaking' persisting, too, so I don't know if this is actually a bug caused by something else.

Edited by Frostiken
Link to comment
Share on other sites

On 7/30/2022 at 10:57 AM, Adiri said:

Do you happen to have SWE installed? It may be an overlap of the sounds

There is definetly a confict between SWE and Rocket Sound Enhancement , tried without SWE and srb sound were ok with RSE .
However when i tried to uninstall RSE and keep SWE the sounds of certain SRB were still missing .

Link to comment
Share on other sites

1 hour ago, ProCrast said:

There is definetly a confict between SWE and Rocket Sound Enhancement , tried without SWE and srb sound were ok with RSE .
However when i tried to uninstall RSE and keep SWE the sounds of certain SRB were still missing .

Yes some people have issues with the sounds in SWE, I will have to look at it

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...

I have encountered a problem,the volume of envrionment sounds gets barely audible when i launch a craft to another planet,and it stays that way...  how do i fix this?  help me :mellow:

PS:the  chatterer sounds has being influent as well.

Edited by jebycheek
Link to comment
Share on other sites

20 minutes ago, jebycheek said:

I have encountered a problem,the volume of envrionment sounds gets barely audible when i launch a craft to another planet,and it stays that way...  how do i fix this?  help me :mellow:

PS:the  chatterer sounds has being influent as well.

That is the mod working as it should, in space there is no sound as in a planet like Kerbin since there is no medium to carry it. But if you don't like it or if you prefer a little less the option that you have the reduce is the audio muffler in the mod settings (The "RSE" button)

Edited by Guest
Link to comment
Share on other sites

34 minutes ago, Forked Camphor said:

That is the mod working as it should, in space there is no sound as in a planet like Kerbin since there is no medium to carry it. But if you don't like it or if you prefer a little less the option that you have the reduce is the audio muffler in the mod settings (The "RSE" button)

I may have discribe it wrong, it's not happening in space, this is what happened:on kerbin every thing is cool -> to kerbin orbit ,still fine-> deep space ,working like how it should be -> landed on Mars,barely can hear back ground music,nor the chatterer sounds,and  airlock sounds... but the wheel and motor sounds  worked fine.

Edited by jebycheek
Link to comment
Share on other sites

6 hours ago, jebycheek said:

I may have discribe it wrong, it's not happening in space, this is what happened:on kerbin every thing is cool -> to kerbin orbit ,still fine-> deep space ,working like how it should be -> landed on Mars,barely can hear back ground music,nor the chatterer sounds,and  airlock sounds... but the wheel and motor sounds  worked fine.

Oh, that should not happen, music shouldn't get muffled, it was a problem fixed some time ago. Are you using the latest version? Try to do a test with only RSE and dependencies to eliminate possible interactions with other mods. If you're using steam is easy to do and conserve your original install: Rename the KSP folder to something else (Steam looks for "Kerbal Space Program", so remaning it to something like "KSP 1.12.3" should do the trick),-> Uninstall the game from steam (Don't worry, since you change the folder name your original install should be safe. A backup wouldn't hurt though)->Reinstall->Run once to the main menu->Install RSE (Or better, use CKAN to do it)->Test to see if the problem persists

Link to comment
Share on other sites

  • 2 weeks later...
On 10/1/2022 at 4:42 AM, Forked Camphor said:

Oh, that should not happen, music shouldn't get muffled, it was a problem fixed some time ago. 

Sounds like (hah) the sound issue fixed by KSPCF a while back. The bug was that almost all sounds would disappear, typically after some sort of scene change (eg. enter/leave of map):

Quote
  • LostSoundAfterSceneSwitch [KSP 1.12.0 - 1.12.3]
    Fix audio source not being centered/aligned with the current vessel after scene switches, causing loss of vessel effects audio and random volume or left/right channel weirdness.

Quote above is from below, so try installing this mod also. I used to get this issue say 1 in 5 games, and now with KSPCF fix never had it again.

 

Link to comment
Share on other sites

20 minutes ago, 610yesnolovely said:

Sounds like (hah) the sound issue fixed by KSPCF a while back. The bug was that almost all sounds would disappear, typically after some sort of scene change (eg. enter/leave of map):

Yeah, it was rare but very annoying when happened, and reloading KSP with 200 mods to fix that issue was not something that I wanted to do regularly :D

@jebycheek check if installing KSPCF solves your problem

Link to comment
Share on other sites

4 hours ago, 610yesnolovely said:

Sounds like (hah) the sound issue fixed by KSPCF a while back. The bug was that almost all sounds would disappear, typically after some sort of scene change (eg. enter/leave of map):

Quote above is from below, so try installing this mod also. I used to get this issue say 1 in 5 games, and now with KSPCF fix never had it again.

 

Thanks for the help!but unfortunately nothing changes...i found it's directly effect by CameraTools,when i switch the “use audio effect”button or just uninstall it,things turn normal. 

3 hours ago, Forked Camphor said:

Yeah, it was rare but very annoying when happened, and reloading KSP with 200 mods to fix that issue was not something that I wanted to do regularly :D

@jebycheek check if installing KSPCF solves your problem

Yes,thanks for reaching out.

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.
Note: Your post will require moderator approval before it will be visible.

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.

×
×
  • Create New...