Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: FreeSpaceFreak on January 13, 2010, 01:51:02 am
-
Would it be possible to have SEXPs for adjusting the volume of sounds in-game? It would be useful for especially cutscenes, where the camera is close to a ship, and the sound makes the music/speech inaudible (see ASW opening cutscene). Or one could even fully silence the game, that could be a nice effect as well.
Imagine it as being several SEXPs, say one for in-game sounds (warps, explosions,etc), one for the music that plays, one for message sounds. The SEXP would have a floating-point argument that expresses the new volume as a fraction of the default; so 1 is default volume, 0.5 is half the default volume, 2 is double. 0 would be complete silence.
It may also be good to build in a limit to that factor, just in case.
Could it be done?
Clarity edit: "default" here meaning "what the game passes to the computer".
-
No because you cannot know how each individual PC's audio volume have been set up. Some may be lower than average, some higher than average. In the worst case scenario a PC's audio volume is much higher than average while FS2 audio volume is very low, overriding this causes audio volume in mission to be extremely loud. Worse yet, user may wear headphones. To make matters more complicated, Vista and Win7 support per-application volume control.
-
But can't you adjust the volume of the sounds that the game passes to the computer, independently of those individual volume settings?
-
You totally missed the point. You cannot anticipate how an user has his PC/FS2 volume set up. Increasing or lowering volume via sexps is not going to please people since they have the volume set up to their liking.
If you have volume issues, fix your audio assets.
-
About the only volume control that should be in the hands of the modder is that in the tables. Now a feature request for a sexp to alter those setting may not be a bad thing but I agree with Fury with the changing users volume settings is not good. Last thing I need is to be jamming tunes and decide to play your mod and have it blow out my speakers.
-
Really. I don't mean altering the user's settings. I mean just turning down the volume temporarily for certain effects.
For example, if a cutscene camera is close to a ship warping in, it's a pretty sight, but the warp sound from close by is louder than anything else, e.g. voice acting. So if one could just set the game sounds volume to be lower during that cutscene, the voice would still be audible.
Or when a large ship explodes next to the player, the mission designer could make for a temporarily deafening effect, muting all the sounds and having them gradually come back.
As for blowing out your speakers, that's why the factor should probably be limited.
-
Yeah, I can see the potential here.
Fury, the point is not to set the absolute volume of an effect, it's the relative volume that's being manipulated. Meaning that the game would still respect the users' max settings. It just might be quieter than that. Other games do these effects all the time.
-
Like fading out sound effects for a cutscene?
Or when a large ship explodes next to the player, the mission designer could make for a temporarily deafening effect, muting all the sounds and having them gradually come back.
Heheh... like how grenades/explosives in some modern FPS's make your ears ring for several seconds after?
-
Out of curiousity, is there a 'fade-soundtrack' or equivalent?
It'd be nice for some missions I have where the screen fades but the music is constant. . . . I wants uniformity.
-
Fury, the point is not to set the absolute volume of an effect, it's the relative volume that's being manipulated. Meaning that the game would still respect the users' max settings. It just might be quieter than that. Other games do these effects all the time.
Yes, exactly.
*snip*
Indeed, that would be some of the possibilities.
Out of curiousity, is there a 'fade-soundtrack' or equivalent?
It'd be nice for some missions I have where the screen fades but the music is constant. . . . I wants uniformity.
I don't think there's anything right now; the closest you'll get is when using stop-sound-from-file, it gives you the option of fading out the track.
But it might very well be integrated in the SEXP proposed here, as an optional second argument. Like so:
set-music-volume
-0.0
-3000
set-sound-from-file-volume
-0.5
The first one would fade the game music to silence in 3 seconds (3000 milliseconds), much like the fade-out SEXP. The second one would instantaneously adjust the volume of a sound, played via the play-sound-from-file SEXP, to 0.5 times the original volume.
-
... bad idea, or hard to implement?