scp-fs2open / fs2open.github.com

Origin Repository for SCP FreeSpace 2 Open
https://www.hard-light.net/
Other
401 stars 161 forks source link

FR: Make mission volume levels at mission start smarter #6291

Open MjnMixael opened 1 month ago

MjnMixael commented 1 month ago

It'd be great if we could get the audio volumes to match any volume changes set via sexp at mission start. The reason is that, for example, if you want to start your mission with an and audio fade-in, you'd set the audio to 0 with a sexp on the first mission frame. However, that sexp doesn't actually run until the second frame and this causes the mission to start with an audible pop as the game plays 1 frame of audio and then cuts the volume as instructed by the sexp.

I have two ideas to address this:

1: Add to the mission post_process code that checks for the audio sexps and pre-sets the game volume to match. I'm not exactly sure if there's a good way to detect events that run on the first event-available frame, but if so, this might be the simplest approach.

2: Systemize the whole thing. Create some kind of way to mark certain sexps as pre-run sexps. Specifically add code to run these before frame 0. This could open all kinds of cans of worms.

3: Add to Mission Specs (or some other menu where it may make sense) volume sliders for the three volume controls. These sliders would be the 'default mission volumes' and would be set before the first in-mission frame. Overridable by SEXPs, of course. I'm not really in favor of adding a whole UI setup and code for this, but it's a fallback if option 1 or 2 is not really viable.

TRBlount commented 4 weeks ago

Could you post an example? Event music is not supposed to start until 1 second after the player is in-mission, as set in event_music_set_start_delay(). This should be more than enough time for any sexps to set the initial volume.

MjnMixael commented 4 weeks ago

This is more for effects, not music

On Sat, Aug 17, 2024, 3:41 PM Tyler Blount @.***> wrote:

Could you post an example? Event music is not supposed to start until 1 second after the player is in-mission, as set in event_music_set_start_delay(). This should be more than enough time for any sexps to set the initial volume.

— Reply to this email directly, view it on GitHub https://github.com/scp-fs2open/fs2open.github.com/issues/6291#issuecomment-2294980258, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3BYNMFG4CDLFECTEOTWY3ZR6YP7AVCNFSM6AAAAABMMKPMKWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJUHE4DAMRVHA . You are receiving this because you authored the thread.Message ID: @.***>