Modding, Mission Design, and Coding > Test Builds

Sound set test builds

(1/6) > >>

m!m:
Some time ago, there was a request for "advanced" sound effects which would allow to specify multiple sound files for a single sound.tbl entry. I even wrote an implementation of that feature but for some reason it never got merged and that was a good thing. The code was so horribly written that I refuse to even look at it now. So, now I decided that it may be a good time to revisit that problem but with a better solution than the one I used originally.

Test builds are available here: http://swc.fs2downloads.com/builds/test/soundSets/

Even if you are not a modder who might use this feature you can still try the builds above to test if the normal sound playback still works.

If you are a modder who might use this feature then you will need some documentation on how this new feature works. The new sound set syntax is based on the existing SCP syntax so if you already use this then it should be easy to use this new feature. Other than the feature described in the original thread, these sound sets do not use a separate section in the sounds table and can be used in all sections documented in the sounds.tbl wiki page.

You start your sound entry as usual with $Name to give your sound a name. Then you can add as many sounds as you like with separate +Entry parameters (but there has to be at least one entry):

--- Code: ---$Name: TestSet
+Entry: L_Sidearm.wav
+Entry: L_Scalpel.wav
+Entry: L_Flail2.wav
+Entry: L_Prom_R.wav
+Entry: L_Prom_S.wav

--- End code ---

This is a complete sound entry that will use the default values for all entries but you probably want to change those. Every option listed here must come in the exact sequence they are listed here but you can omit an option and it will use a default value.

+Cycle type: This specified how the next entry of the various sound entries is selected. Possible values are sequential and random. These types do exactly what their names suggest. The first uses the sounds sequentially one after another and the second type selects a random sound entry every time the sound is played. The way the sequential mode works at the moment is that one sound entry only has a single global index counter so if two sources use the same sound effect then the first source will use sound 1, the second will use sound 2 and if source one wants to play the sound again it will use sound 3 of the list.

+Preload: Same as with the usual SCP syntax

+Volume: Specifies the volume of the sound but now this accepts a range of possible values from which a random value will be chosen every time the sound is played. The syntax is a list of floating point numbers like this:

--- Code: --- +Volume: (0.4 0.6)

--- End code ---
This will cause the sound to use 40% to 60% volume.

+3D Sound, +Priority, +Limit: Same as with the usual SCP syntax.

+Pitch: This is another new addition to the sound sets which lets you specify the pitch of the sound. This is also a random range like volume:

--- Code: --- +Pitch: (0.5 2.0)

--- End code ---
The values must be greater than zero and 1.0 will use the original sound without changing the pitch. What these values mean is quite technical so I would suggest trying different values and checking how they sound like.

Here is an example of a full sound set table:

--- Code: (soundSets-snd.tbm) ---#Game Sounds Start

$Name: TestSet
+Entry: L_Sidearm.wav
+Entry: L_Scalpel.wav
+Entry: L_Flail2.wav
+Entry: L_Prom_R.wav
+Entry: L_Prom_S.wav

+Cycle type: sequential
+Preload: False
+Volume: (0.4 0.6)
+3D Sound:
+Attenuation start: 50
+Attenuation end: 400
+Priority: Medium-Low
+Limit: 8
+Pitch: (0.5 2.0)

#Game Sounds End

--- End code ---

Let me know if you find any bugs or if the existing behavior should be changed in any way. The current implementation and table syntax is not set in stone so if you have a suggestion for how this could be improved please let me know here.

AdmiralRalwood:
Nice work! :yes:

Spoon:
This looks amazing, this should improve the soundscape a lot. (Now I can stop having multiple substitute weapon entries just to have sound variation)

But I dont think you uploaded the right build here? I've been trying the fs2_open_3_8_1_soundSets_x64_SSE2 one, but it gives me:
Error: sounds.tbl(line 1314):
Error: Missing required token: [+Preload:]. Found [+Entry: Light laser.ogg] instead.

m!m:
I am pretty sure that those builds are correct since that error message would look very different if the build didn't support sound sets.

What is your entire table? Maybe you found a bug in the parsing code.

Spoon:

--- Quote from: m!m on October 10, 2017, 04:17:57 am ---I am pretty sure that those builds are correct since that error message would look very different if the build didn't support sound sets.
--- End quote ---
Actually, thats how those error messages always look when a build doesn't support some table feature. I would know, I've had a very long history of running into these things  :p
And I even checked with another build just to be sure, and it gave me that exact same error message.


--- Quote from: m!m on October 10, 2017, 04:17:57 am ---What is your entire table? Maybe you found a bug in the parsing code.

--- End quote ---



--- Code: ---$Name: 330
+Filename: Light laser.ogg
+Entry: Light laser.ogg
+Cycle type: sequential
+Preload: no
+Volume: (0.55 0.65)
+3D Sound:
        +Attenuation start: 250
        +Attenuation end: 1200
+Priority: High
+Limit: 10 ; VX-02 fired
+Pitch: (0,8 1,2)
--- End code ---
I've tried a bunch of different variations, removing and adding bits. But any of the new features throw up an error. I don't think its a parsing code bug.

Navigation

[0] Message Index

[#] Next page

Go to full version