Jump to content
flyingsaucerinvasion

Artillery Explosion, Different Sounds at Ranges

Recommended Posts

I'm making a sound mod. 

 

I notice that the game uses different sounds for an artillery shell explosion depending on how far away the explsion is.  Does anybody know how this is done?  I see nothing in the config files that seems to indicate any variability over distance.

Share this post


Link to post
Share on other sites

if you want sounds at different distances you have to make a script.
 

A question, why do you want to make a sound mod? you just want to create your mod or don't you know that there are already sound mods?

Because you can use the JSRS mod and you save yourself the problems that you are going to have to make the sound mod, not to mention the time it will take.

Share this post


Link to post
Share on other sites
On 1/6/2022 at 6:47 PM, dalber24 said:

if you want sounds at different distances you have to make a script.

What kind of script will allow different sounds for explosions at different distances?

 

Quote

A question, why do you want to make a sound mod? you just want to create your mod or don't you know that there are already sound mods?

Becuase I've checked out those mods, and they really suck!  JSRS sounds like poop.

Share this post


Link to post
Share on other sites
15 hours ago, flyingsaucerinvasion said:

What kind of script will allow different sounds for explosions at different distances? 

 


the type of scripts that you have to create yourself as JSRS did.

 

 

15 hours ago, flyingsaucerinvasion said:

Becuase I've checked out those mods, and they really suck!  JSRS sounds like poop.

 

Regardless of whether you like the sounds of JSRS or not, the mod is excellent, the sounds... it's true that we don't all like the same sounds, each one has a different perception, different tastes etc, if I were you I would talk to @LordJarhead to ask for his authorization and modify the sounds and save you a ton of suffering and work, since creating all the scripts from scratch and if you have no idea how to do it, I assure you your head will explode.

I must also tell you that you cannot copy all or part of their scripts, without asking for permission.

Share this post


Link to post
Share on other sites
Spoiler

 

On 1/3/2022 at 2:44 AM, flyingsaucerinvasion said:

I'm making a sound mod. 

 

I notice that the game uses different sounds for an artillery shell explosion depending on how far away the explsion is.  Does anybody know how this is done?  I see nothing in the config files that seems to indicate any variability over distance.


Making sounds in Arma is quite simple once you understand the system. 

For each weapon firing mode or ammo explosion there is a parameter called "SoundSet yxz". That defines what sort of soundset is applied to what specific situation. Soundsetexplosion is for all explosives the one parameter that defines what set of sounds you want to use if that ammo type explodes.

 

SoundSets use a bunch of SoundShaders which are basically little groups of sound files. And each group of these soundfiles you can give specific values, like what volume, what distance, what environment (like weapon tails only on forests or interior and such). So:

 

A3_SoundMainScheme.jpg

This is the base structure. Let's start at the bottom and pretend you have 3 different sound files, a close explosion sound, a medium distant explosion sound, and a really far distant explosion sound. We name these "Close_1.ogg", "Medium_1.ogg" and "Far_1.ogg". 

 

Now that you have these three files, all of these need to have the same audio settings, like 2 channel, 48khz, .ogg format. They need to be the same in order to run in a single set of sounds, otherwise the game's engine is unable to mix these sounds together in a single mix. We come to that later.

Let's create your Shaders:

 


class CfgSoundShaders
{
	class MyClose_Explosion_Shader
	{
		samples[] = 
		{
			{ "MyMod\Sounds\Explosions\Close_1.ogg",1}
		};
		volume = 1;
		range = 2000;
		rangeCurve = {{0,1},{100,0},{2000,0}};
	};
	class MyMedium_Explosion_Shader
	{
		samples[] = 
		{
			{ "MyMod\Sounds\Explosions\Medium_1.ogg",1}
		};
		volume = 1;
		range = 2000;
		rangeCurve = {{0,0},{100,1},{1000,0},{2000,0}};
	};
	class MyFar_Explosion_Shader
	{
		samples[] = 
		{
			{ "MyMod\Sounds\Explosions\Far_1.ogg",1}
		};
		volume = 1;
		range = 2000;
		rangeCurve = {{0,1},{100,0},{1000,1},{2000,0}};
	};
};

Now your first SoundShaders exist. These all can be combined in a single SoundSet that will be played if the condition is triggered (explosion). So, this is how you do the distances and have each distance sound different: Range and RangeCurves are the keys here. You see that Close has 0,1, which means that at 0 Meters, the sound is 1 (= 100% volume) audible. But at 100 meters it is 0% audible (100,0). Because the second shader medium is now 0,0, so 0% volume at 0 Meters, and 100% volume at 100 meters. (100,1). Same at 1000 meters, the medium is 0% volume and far is 100% volume. 

 

So you hear the close explosion for 0 to 100 meters, 100 to 1000 is medium, and 1000 to 2000 meters is far. They fade into each other based on either specific rancecurves that can be pre-defined, or based on the rangecurves you create. You can go really fancy with the volumes and transitions here, like rangeCurve = {{0,0},{10,0.5},{50,0.75},{100,1},{250,0.5},{1000,0},{2000,0}}; and raise and lower volumes as you like. So that the sound is not slowly fading over distance but maybe is really loud close range and drops off pretty fast. This is what you make of it, you have all options here. 

So, now that we have these Shaders, we want to combine them in a Set! That would look like this:

 


class CfgSoundSets
{
	class MyExplosionSoundSet
	{
		soundShaders[] = 
		{
			MyClose_Explosion_Shader,
			MyMedium_Explosion_Shader,
			MyFar_Explosion_Shader
		};
		volumeFactor = 1.6;
		volumeCurve = InverseSquare2Curve;
		sound3DProcessingType = Explosion3DProcessingType;
		distanceFilter = ExplosionDistanceFreqAttenuationFilter; 
		spatial = 1;
		doppler = 0;
		loop = 0;
	};
};

So what this does, is that it combines all three shaders you made and mixes them together into a single set (sound). It also contains certain values to manipulate the sounds, like a 3DProcessor that defines if the sound is stereo or mono (really basically, you can do so much more with that) and a distance filter that can also muffle sounds over distances. Because even if you have multiple shaders for different distances, it gives the sounds a little bit more realistic muffling. 

 

Important to know is that for each sort of sound you should have a specific sound set. Like for weapons firing, you have the initial firing sound but also the tails. You don't want the weapons firing to be Stereo on further distances, but the tails should be because they reflect from the surroundings and shouldn't be mono. So you'd need to make two sets with each different 3DProcessors, you can't mix that in one set. 

 

No, to make this set play on an explosion, you need to pick an ammo class like 8Rnd_82mm_Mo_shells:

 


class CfgAmmo
{
	class 8Rnd_82mm_Mo_shells
	{
		soundSetExplosion = {MyExplosion_Soundset};
	};
};

 

The inheritances are missing, so I just put it really basic down here, writing all this out of my head rn^^ 

 

Now your soundset is defined for when an 82mm Mortar Shell is exploding. That means the explosion calls your SoundSet, the SoundSet calls your three shaders, and based on distances to the camera is defining the muffling, volume, and 3DProcessing, the 3 SoundShader define which one is bearable based on the distance to the camera.

 

That is roughly the idea of the whole Sound thing, nothing magical^^ There is also an documentation that can be very helpful: https://community.bistudio.com/wiki/Category:Arma_3:_Sound

And one little tip I can give you when you start modding: Don't shit on people's work! You don't say that some mods are "poop" or "suck". We are all here doing this stuff for free and sharing it along, be grateful someone gives you his time and efforts to make our favorite games more enjoyable. 😉

LJ

 

 

I just realized this is regarding Arma 2... oh boy, nevermind, won't work then^^

  • Like 1

Share this post


Link to post
Share on other sites
On 1/27/2022 at 8:56 AM, LordJarhead said:
  Hide contents

 


Making sounds in Arma is quite simple once you understand the system. 

For each weapon firing mode or ammo explosion there is a parameter called "SoundSet yxz". That defines what sort of soundset is applied to what specific situation. Soundsetexplosion is for all explosives the one parameter that defines what set of sounds you want to use if that ammo type explodes.

 

SoundSets use a bunch of SoundShaders which are basically little groups of sound files. And each group of these soundfiles you can give specific values, like what volume, what distance, what environment (like weapon tails only on forests or interior and such). So:

 

A3_SoundMainScheme.jpg

This is the base structure. Let's start at the bottom and pretend you have 3 different sound files, a close explosion sound, a medium distant explosion sound, and a really far distant explosion sound. We name these "Close_1.ogg", "Medium_1.ogg" and "Far_1.ogg". 

 

Now that you have these three files, all of these need to have the same audio settings, like 2 channel, 48khz, .ogg format. They need to be the same in order to run in a single set of sounds, otherwise the game's engine is unable to mix these sounds together in a single mix. We come to that later.

Let's create your Shaders:

 



class CfgSoundShaders
{
	class MyClose_Explosion_Shader
	{
		samples[] = 
		{
			{ "MyMod\Sounds\Explosions\Close_1.ogg",1}
		};
		volume = 1;
		range = 2000;
		rangeCurve = {{0,1},{100,0},{2000,0}};
	};
	class MyMedium_Explosion_Shader
	{
		samples[] = 
		{
			{ "MyMod\Sounds\Explosions\Medium_1.ogg",1}
		};
		volume = 1;
		range = 2000;
		rangeCurve = {{0,0},{100,1},{1000,0},{2000,0}};
	};
	class MyFar_Explosion_Shader
	{
		samples[] = 
		{
			{ "MyMod\Sounds\Explosions\Far_1.ogg",1}
		};
		volume = 1;
		range = 2000;
		rangeCurve = {{0,1},{100,0},{1000,1},{2000,0}};
	};
};

Now your first SoundShaders exist. These all can be combined in a single SoundSet that will be played if the condition is triggered (explosion). So, this is how you do the distances and have each distance sound different: Range and RangeCurves are the keys here. You see that Close has 0,1, which means that at 0 Meters, the sound is 1 (= 100% volume) audible. But at 100 meters it is 0% audible (100,0). Because the second shader medium is now 0,0, so 0% volume at 0 Meters, and 100% volume at 100 meters. (100,1). Same at 1000 meters, the medium is 0% volume and far is 100% volume. 

 

So you hear the close explosion for 0 to 100 meters, 100 to 1000 is medium, and 1000 to 2000 meters is far. They fade into each other based on either specific rancecurves that can be pre-defined, or based on the rangecurves you create. You can go really fancy with the volumes and transitions here, like rangeCurve = {{0,0},{10,0.5},{50,0.75},{100,1},{250,0.5},{1000,0},{2000,0}}; and raise and lower volumes as you like. So that the sound is not slowly fading over distance but maybe is really loud close range and drops off pretty fast. This is what you make of it, you have all options here. 

So, now that we have these Shaders, we want to combine them in a Set! That would look like this:

 



class CfgSoundSets
{
	class MyExplosionSoundSet
	{
		soundShaders[] = 
		{
			MyClose_Explosion_Shader,
			MyMedium_Explosion_Shader,
			MyFar_Explosion_Shader
		};
		volumeFactor = 1.6;
		volumeCurve = InverseSquare2Curve;
		sound3DProcessingType = Explosion3DProcessingType;
		distanceFilter = ExplosionDistanceFreqAttenuationFilter; 
		spatial = 1;
		doppler = 0;
		loop = 0;
	};
};

So what this does, is that it combines all three shaders you made and mixes them together into a single set (sound). It also contains certain values to manipulate the sounds, like a 3DProcessor that defines if the sound is stereo or mono (really basically, you can do so much more with that) and a distance filter that can also muffle sounds over distances. Because even if you have multiple shaders for different distances, it gives the sounds a little bit more realistic muffling. 

 

Important to know is that for each sort of sound you should have a specific sound set. Like for weapons firing, you have the initial firing sound but also the tails. You don't want the weapons firing to be Stereo on further distances, but the tails should be because they reflect from the surroundings and shouldn't be mono. So you'd need to make two sets with each different 3DProcessors, you can't mix that in one set. 

 

No, to make this set play on an explosion, you need to pick an ammo class like 8Rnd_82mm_Mo_shells:

 



class CfgAmmo
{
	class 8Rnd_82mm_Mo_shells
	{
		soundSetExplosion = {MyExplosion_Soundset};
	};
};

 

The inheritances are missing, so I just put it really basic down here, writing all this out of my head rn^^ 

 

Now your soundset is defined for when an 82mm Mortar Shell is exploding. That means the explosion calls your SoundSet, the SoundSet calls your three shaders, and based on distances to the camera is defining the muffling, volume, and 3DProcessing, the 3 SoundShader define which one is bearable based on the distance to the camera.

 

That is roughly the idea of the whole Sound thing, nothing magical^^ There is also an documentation that can be very helpful: https://community.bistudio.com/wiki/Category:Arma_3:_Sound

And one little tip I can give you when you start modding: Don't shit on people's work! You don't say that some mods are "poop" or "suck". We are all here doing this stuff for free and sharing it along, be grateful someone gives you his time and efforts to make our favorite games more enjoyable. 😉

LJ

 

 

I just realized this is regarding Arma 2... oh boy, nevermind, won't work then^^

Sorry for hijacking the thread ;(, but thank you so much for this. I just have a question how would this apply to a vehicle explosion (I want my own explosion sound that a vehicle plays on death. Say3d and Playsound3D didn't work out for me due to how muffled the sound is if you are in a vehicle). I really couldn't find the class that I would need to override or does it work differently? 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×