Author Topic: Feature Request: Sound Sets (and "Advanced" Sound Effects)  (Read 9560 times)

0 Members and 1 Guest are viewing this topic.

Offline m!m

  • 211
Re: Feature Request: Sound Sets (and "Advanced" Sound Effects)
I'm currently in the process of implementing this request and already mode some progress. The sound play functions now also accept an abstract class which represents a sound information. Currently there is the normal game sound information which just returns the game sound data and gives default values for every other option and there is the SoundSet class which represents the requested sound sets which can contain multiple sounds and can vary the pitch, volume and for 2D sounds the panning of the played sound.
It's not done yet but I will post a patch later today as a backup as I will be leaving for a 3 week vacation tomorrow so don't expect updates in that time period.

EDIT: Patch is attached, I only checked if it compiles and is able to play sounds.
« Last Edit: August 26, 2012, 05:39:48 am by m!m »

 

Offline m!m

  • 211
Re: Feature Request: Sound Sets (and "Advanced" Sound Effects)
With some minor modifications to the previously posted patch I can finally present a first test build of the sound set feature: http://www.mediafire.com/?rbwg1bo4c5bu5dx
To specify a sound set you add either the section #Sound Sets after #Game Sounds End for game sounds (ended with #Sound Sets End) or #Interface Sound Sets (ended with "#Interface Sound Sets End) after #Interface Sounds End for interface sounds.
The sound set is defined with the following syntax:
Code: [Select]
$Set: <name>
    [+Cycle: RANDOM|FORWARD|BACKWARD] (defaults to RANDOM, compares case-insensitively)
    [$Default:] (specifies the default sounds to be used in an environment which isn't configured)
        <entries> (See below)

    [$Environment: <environment name>
        $Sound: <sound identifier>
            +Volume randomize: <float: minimum> <float: maximum> (The amount to raise (positive number) or lower (negative number) the volume of the sound when played, given in percent, has no range limitations)
            +Pitch randomize: <float: minimum> <float: maximum> (The pitch value to be set, minimum may not be lower than zero, given in percent)
            +Pan randomize:: <float: minimum> <float: maximum> (The amount to alter the pitch, accepts values from from -2.0 to 2.0, given in percent)]
        ($Sound can be repeated)
Other notes:
  • A sound set can be used by simply using its name just like you reference a sound currently
  • You have to specify at least $Default or one $Environment entry
  • You may only specify sounds which are defined as game sounds to remove the possibility of an endless recursion
  • The patch also removed the need to specify the hard coded sounds in the exact order, they are now also referenced using the numbers as names
  • Currently the parsing code does not support the modification of a sound set, although I will add it in the future
  • Sound sets may not have the same name as a game sound which isn't checked currently, a check will be added in the future

Thanks for your kind attention,
m!m

[attachment removed and sold on the black market]
« Last Edit: August 27, 2012, 03:52:29 am by m!m »

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: Feature Request: Sound Sets (and "Advanced" Sound Effects)
Awesome! Thanks much, m!m, I'll see that I get to playing around with this shortly.

Edit: Managed to get a few cursory tests done:

  • There's a noticable echo on  voices
  • There's a noticable variation in the volume of voices
  • When pressing the afterburner key, any voice that's currently talking is abrutly cutoff, and sometimes has a "record scratch" effect
  • Both the supplied release and debug build failed to load my #Sound Sets section. :(
« Last Edit: August 27, 2012, 12:46:21 am by z64555 »
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline m!m

  • 211
Re: Feature Request: Sound Sets (and "Advanced" Sound Effects)
I can't reproduce any of those issues using the test builds I posted but there was a mistake with how the pitch was calculated. I updated the patch and the test build in the post above, maybe that will fix your issues.

 

Offline torc

  • 210
  • Diaspora SFX engineer
Re: Feature Request: Sound Sets (and "Advanced" Sound Effects)
great job m!m... i'll make some test ASAP!... for who is interested: i'm working on the restoration of ALL the FS2 sounds...this would be a good implementation, and if this patch works good i could make new sounds fx based on the new patch :)
indossare una divisa può avere un prezzo alto...ma a volte...è troppo alto!!! Bill Adama

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: Feature Request: Sound Sets (and "Advanced" Sound Effects)
Yea... um...

Something's not quite right on my end.

I've attached two logs, one of the SoundSet d build and one of the r8095 (no SSE) d build for comparison.

For both, I'm running retail data - no SoundSet entries in the sounds.tbl. For the SoundSet build, I get CTD's and (if I'm lucky for it to keep running long enough) .ani frame corruption.

I'm compiling a build with the patch applied to whatever's currently in trunk to see if that fixes it on my end...



[Edit] yeah, it's either something up with the Non-SSE builds or something in the patch that's making it not work for me.
[Edit2] Nope. SSE builds have the same problem. :(

[attachment removed and sold on the black market]
« Last Edit: August 27, 2012, 10:38:03 pm by z64555 »
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline m!m

  • 211
Re: Feature Request: Sound Sets (and "Advanced" Sound Effects)
Sorry for not answering the last two days but I've been out of town without time for HLP.
I still can't reproduce your issue and the logs don't show anything unusual.
Can you try to get a stacktrace of the CTD? Maybe that will show what's wrong there...

 

Offline m!m

  • 211
Re: Feature Request: Sound Sets (and "Advanced" Sound Effects)
Small :bump: here to check if anyone tested this or if you have resolved that weird crash thing z64555.
I'd also like to ask for a code review as I added a few new classes within their own files and I'd like to know if that code style can be kept or if the classes should stay inside the gamesnd.cpp/.h files.

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: Feature Request: Sound Sets (and "Advanced" Sound Effects)
I've got a hunch that it has to do with Valathil's new .ani code. Apparently it doesn't like OpenGL 1.4 (and guess which version I just happen to have  :banghead:)

Hopefully later tonight or tomorrow I can try a pre-9109 build with the SoundSet code to see if that is indeed the case.

[Edit] It's definitely the 9109 revision that's giving me trouble.

« Last Edit: September 09, 2012, 04:58:07 pm by z64555 »
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.