SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SH5 Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=249)
-   -   [TEC] AmbientVolume controller (https://www.subsim.com/radioroom/showthread.php?t=196684)

gap 07-06-12 03:32 PM

[TEC] AmbientVolume controller
 
Hi there,

I am currently working on importing a SHIII unit in SH5. Among other things, I am trying to set the volume of its sounds. For doing it I am using the AmbientVolume controller, that allows us to change sound volumes depending on both camera and parent object's location.

Its main parameters are sorted in arrays. Each array is composed by an identifier (making reference to SounSource identifiers in the same dsd file) and by a group of volume modifiers for different camera and object position:

Code:

ObjectAboveWater
ObjectBelowWater
CameraAboveWater
CameraBelowWater
CameraInterior
CameraSonar

So far so good. I'm experiencing a couple of shortcoming though:

- whenever I set two or more sounds to share the same identifier, trying to set their volume as a group, SounSource stops working and they can be heard "normally" in game as if the controller wasn't there.

- If I am not mistaken, sound modifier parameters seem to be expressed as percentages of the original volume (0=silent, 1=100%); nonetheless, everytime I try to set a value <1, instead of being reduced sounds are zeroed. In other words, the controller behaves like an on/off trigger.

Did anyone else experiment with it? I wonder whether I am missing something, or peraphs AmbientVolume is no longer fully supported by SH5? :hmm2:

TheDarkWraith 07-06-12 03:40 PM

AmbientVolume controller works fine in SH5. Take a look at FX update, it uses it for the flares, debris, torp explosion, etc.. Sounds more like you're using an illegal identifier. What identifiers are you using? You did add your sounds to the Sh.sdl file correct?

gap 07-06-12 03:45 PM

Triggering sounds
 
Another quick question on sounds:

I wish some sounds to be triggered by particle generators (splashes, wakes, etc), i.e. being played during the lifespam of particles, and stopping particles desappear.

I am sure something like this is feasible, but I have no clue on how to do it. Until now simply giving these sound the same parent IDs as the particle generator tha should trigger them, didn't give the expected results.

Probably I could get inspired by some existing unit, but if in the meanwhile some good-hearted oldtimer will read this thread, his help will be much appreciated! :)

TheDarkWraith 07-06-12 03:51 PM

Quote:

Originally Posted by gap (Post 1905931)
Another quick question on sounds:

I wish some sounds to be triggered by particle generators (splashes, wakes, etc), i.e. being played during the lifespam of particles, and stopping particles desappear.

I am sure something like this is feasible, but I have no clue on how to do it. Until now simply giving these sound the same parent IDs as the particle generator tha should trigger them, didn't give the expected results.

Probably I could get inspired by some existing unit, but if in the meanwhile some good-hearted oldtimer will read this thread, his help will be much appreciated! :)

The sound has to be attached (it's parent node) to the type 4/100 node of the particle (if you want the sound to be associated with just the particle) or of the particle generator (thus sound is played where the type 4/100 node's location is)

gap 07-06-12 03:55 PM

Quote:

Originally Posted by TheDarkWraith (Post 1905927)
AmbientVolume controller works fine in SH5. Take a look at FX update, it uses it for the flares, debris, torp explosion, etc.. Sounds more like you're using an illegal identifier. What identifiers are you using? You did add your sounds to the Sh.sdl file correct?

Yes I did, and for any other purpose they play correctly in game.

As for identifiers, I am using custom ones. Suspecting that this could have been the reason, I tried to change them with standard ids (iirc Propeller, or Engine), and it didn't make any difference.

I'll try again anyway. Thanks!

TheDarkWraith 07-06-12 03:59 PM

Quote:

Originally Posted by gap (Post 1905938)
Yes I did, and for any other purpose they play correctly in game.

As for identifiers, I am using custom ones. Suspecting that this could have been the reason, I tried to change them with standard ids (iirc Propeller, or Engine), and it didn't make any difference.

I'll try again anyway. Thanks!

For 'normal' sounds Effect is the correct identifier. For underwater sounds hy2 is the correct identifier.

gap 07-06-12 04:00 PM

Quote:

Originally Posted by TheDarkWraith (Post 1905934)
The sound has to be attached (it's parent node) to the type 4/100 node of the particle (if you want the sound to be associated with just the particle) or of the particle generator (thus sound is played where the type 4/100 node's location is)

Is this enough? Are there no special names/settings to be given in .sdl file? No special identifier to be set in SoundSource controller? No other controller in .dsd file to be associated with generator's ID?

gap 07-06-12 04:01 PM

:hmmm:
Quote:

Originally Posted by TheDarkWraith (Post 1905940)
For 'normal' sounds Effect is the correct identifier. For underwater sounds hy2 is the correct identifier.

Ah okay, I'll try it and report back in a few... thank you very much! :salute: :up:

EDIT:

WHY hy2? Isn't it hyd? On the unit I am workin on the Identifier hyd seems to work correctly.... :hmmm:

TheDarkWraith 07-06-12 04:05 PM

Quote:

Originally Posted by gap (Post 1905941)
Is this enough? Are there no special names/settings to be given in .sdl file? No special identifier to be set in SoundSource controller? No other controller in .dsd file to be associated with generator's ID?

That is all. It's really that simple to add new sounds (besides needed entries in DSD file and Sh.sdl also) :yep:

Your SoundSource, AmbientVolume, and SonarTarget entries parent ID will be what I spoke about above.

gap 07-06-12 04:17 PM

Sorry, one more question:

according to your experience, is sounds volume, especially on hydrophone, somehow related to ship's current speed? Perhaphs through the ShipSound controller (StdByMaxRpm parameter)? If so, is there any way to set sounds free from this constrain?

TheDarkWraith 07-06-12 04:26 PM

Quote:

Originally Posted by gap (Post 1905942)
WHY hy2? Isn't it hyd? On the unit I am workin on the Identifier hyd seems to work correctly.... :hmmm:

hy2 is what all the stock DSD files in SH5 are using for underwater (hydrophone) sounds. It appears they made a change to the game engine and hy2 is the new underwater identifier. No idea what happens if you use hyd.

Quote:

Originally Posted by gap (Post 1905953)
Sorry, one more question:

according to your experience, is sounds volume, especially on hydrophone, somehow related to ship's current speed? Perhaphs through the ShipSound controller (StdByMaxRpm parameter)? If so, is there any way to set sounds free from this constrain?

If the sound's SoundSource identifier is Effect or hy2 it's free of this constraint. I've found that only sounds made through a controller (i.e. ShipSound) have this constraint.

gap 07-06-12 04:53 PM

Quote:

Originally Posted by TheDarkWraith (Post 1905963)
hy2 is what all the stock DSD files in SH5 are using for underwater (hydrophone) sounds. It appears they made a change to the game engine and hy2 is the new underwater identifier. No idea what happens if you use hyd.

It works too. Tested several times during these days. Also imported units contained in OHII do use this identifier and by the way with no exception they miss the SonarTarget controller, with no apparent problem.

Quote:

Originally Posted by TheDarkWraith (Post 1905963)
If the sound's SoundSource identifier is Effect or hy2 it's free of this constraint. I've found that only sounds made through a controller (i.e. ShipSound) have this constraint.

So maybe I know what is happening: probably sh5 sound's volume can be modified only once. In other words, you can't apply a sound modifier on top of another one.
My sounds, not having the hy2/Effect identifier, are subject to the ShipSound controller. That's why SoundVolume behaves like a switch: everytime it tries to change the volume for the second time, sound aren't played at all. This is the theory. Now it has to be proved or controverted in practice.

Here comes my next question: what if I want to set two or more groups of sounds having different SoundVolume settings, since we have only the "Effect" option for non hydrophone identifiers? Is it possible that devs din't think about it? :hmm2:

TheDarkWraith 07-06-12 04:58 PM

Quote:

Originally Posted by gap (Post 1905974)
Here comes my next question: what if I want to set two or more groups of sounds having different SoundVolume settings, since we have only the "Effect" option for non hydrophone identifiers? Is it possible that devs din't think about it? :hmm2:

You create another type 4/100 node that has the parent of the original type 4/100 with 0 for position and rotation data. Now you set your next sound to this (it's ID). You keep adding type 4/100 nodes to the main 4/100 node for each sound you need a SoundVolume controller to work on :up:

structure would look like this:

main 4/100 node - SoundSource, AmbientVolume, SonarTarget
|
- child 4/100 node - SoundSource, AmbientVolume, SonarTarget
|
- child 4/100 node - SoundSource, AmbientVolume, SonarTarget
|
etc.

gap 07-06-12 05:37 PM

Quote:

Originally Posted by TheDarkWraith (Post 1905976)
You create another type 4/100 node that has the parent of the original type 4/100 with 0 for position and rotation data. Now you set your next sound to this (it's ID). You keep adding type 4/100 nodes to the main 4/100 node for each sound you need a SoundVolume controller to work on :up:

structure would look like this:

main 4/100 node - SoundSource, AmbientVolume, SonarTarget
|
- child 4/100 node - SoundSource, AmbientVolume, SonarTarget
|
- child 4/100 node - SoundSource, AmbientVolume, SonarTarget
|
etc.

Yep, I thought of this easy method just after pushing the "Submit Reply" button :oops:

As for hydrophone sounds, it seems we don't need to resort to the node structure you have depicted. I got several hydro-sounds linked to the very same parent node playing at once, by simply putting a SonarTarget controller after each SoundSource entry in DSD file. But, since they had different min and max radius set in sdl file, I had to sort them from the lowest (on top) to the loudest, otherwise only the loudest, the one having the highest maximum range set in sdl, was played.

P.S. as suggested by you, I've tried to switch to "Effect" the identifier of sounds whose volume I wanted to change. But something was wrong:

they started to be played in sonar room (where their volume was set to 0) while on external camera their audible range was greatly shortened (ignoring sdl ranges). On the other hand, external cam above water volume was set to .5, and this time the sound was audible, but I couldn't hear any differece with the underwater volume that was set to full (1). I am missing something, or for what I am trying to do the Effect identifier doesn't work either... :shifty:

TheDarkWraith 07-06-12 05:48 PM

what exactly are you trying to do :06:


All times are GMT -5. The time now is 03:11 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.