Author Topic: Feature request: Adding custom impact sounds for different weapons.  (Read 4552 times)

0 Members and 1 Guest are viewing this topic.

Offline torc

  • 210
  • Diaspora SFX engineer
Feature request: Adding custom impact sounds for different weapons.

i'll try to explain it better:

In sounds.tbl there's 4 kind of sounds when the player ship has been hit by an enemy:

two for primary impact on shields and hull (sound n. 39,40)
two for secondary impact on shields and hull (sound n. 36,37)

Anyway the limitations are obvious: capship flaks or beams (as istance) don't have any impact feedback sound when them hit the player.

So,i wonder if it's possible to have directly in weapons.tbl the chance to assign at single weapons the sound you want as example using 2 strings like:

$Player ShieldHitSnd:
$Player HullHitSnd:

in  this way, youcan assign the sound you want to a specific weapon (laser,missile beam flak artillery etc)

thanks in advance.
indossare una divisa può avere un prezzo alto...ma a volte...è troppo alto!!! Bill Adama

 

Offline m!m

  • 211
Re: Feature request: Adding custom impact sounds for different weapons.
This seems to be a fairly easy feature to implement. In weapons.cpp from line 5396 everything that needs to be done would be to replace the occurrences of SND_SHIELD_HIT_YOU, SND_PLAYER_HIT_MISSILE and SND_PLAYER_HIT_LASER with the field values of new values in the weapon_info struct.

The attached patch implements the suggested behavior and a code review would be great.

[attachment deleted by a ninja]

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Feature request: Adding custom impact sounds for different weapons.
While we are on the subject of sound
How about being able to assign multiple launch sounds for a weapon? Instead of pewpewpewpewpew we could do pewblewmewpewbew when firing a subach.

And hell, instead of limiting this to the Player. I'd love to see a shield hit impact sound option for whatever weapon. Cause right now when you fire the biggest deadliest missile you have on the enemy. It will only play its GIANT SPACE NUKE SOUND EFFECT when it directly impacts with the hull. If it hits the shield its just 'btzz'.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Steam
Re: Feature request: Adding custom impact sounds for different weapons.
While we are on the subject of sound
How about being able to assign multiple launch sounds for a weapon? Instead of pewpewpewpewpew we could do pewblewmewpewbew when firing a subach.

On another engine I worked with, you had a few more options with sounds.

  • Any sound can have its pitch and/or volume randomized by some defined amount.
  • Sounds can be grouped into sound sets. When the sound set is called, one of the sounds in the set is played.
  • Sound sets can either sequentially cycle (forward or backward) between the included sounds, or randomly pick a sound whenever the sound set is played.

A bit more complicated, but a bunch more flexible. I'm not sure how difficult it will be to get it implemented, however...
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 Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Feature request: Adding custom impact sounds for different weapons.
I would highly approve of that
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Thaeris

  • Can take his lumps
  • 211
  • Away in Limbo
Re: Feature request: Adding custom impact sounds for different weapons.
Why not use science!?

Use the distance and the frequency of the files own effect file to let the computer determine the sound distortion for you?
"trolls are clearly social rejects and therefore should be isolated from society, or perhaps impaled."

-Nuke



"Look on the bright side, how many release dates have been given for Doomsday, and it still isn't out yet.

It's the Duke Nukem Forever of prophecies..."


"Jesus saves.

Everyone else takes normal damage.
"

-Flipside

"pirating software is a lesser evil than stealing but its still evil. but since i pride myself for being evil, almost anything is fair game."


"i never understood why women get the creeps so ****ing easily. i mean most serial killers act perfectly normal, until they kill you."


-Nuke

 

Offline torc

  • 210
  • Diaspora SFX engineer
Re: Feature request: Adding custom impact sounds for different weapons.
well,same thing for a lowpass filter...when a sound is far away it should sound more muffed....this would be better and more natural than  other solutions.
indossare una divisa può avere un prezzo alto...ma a volte...è troppo alto!!! Bill Adama

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
Re: Feature request: Adding custom impact sounds for different weapons.
While we are on the subject of sound
How about being able to assign multiple launch sounds for a weapon? Instead of pewpewpewpewpew we could do pewblewmewpewbew when firing a subach.

On another engine I worked with, you had a few more options with sounds.

  • Any sound can have its pitch and/or volume randomized by some defined amount.
  • Sounds can be grouped into sound sets. When the sound set is called, one of the sounds in the set is played.
  • Sound sets can either sequentially cycle (forward or backward) between the included sounds, or randomly pick a sound whenever the sound set is played.

A bit more complicated, but a bunch more flexible. I'm not sure how difficult it will be to get it implemented, however...

i would like to throw my support behind this one as well.
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Steam
Re: Feature request: Adding custom impact sounds for different weapons.
Possible table format for soundsets:

Code: [Select]
#Sound Sets

$Set: 0               ;; The ID number for this set
    +Cycle: random    ;; Will cycle randomly. Defaults to forward cycling (top of the list down)
$Sound: 10                     ;; The ID number of the first sound
    +Randomize Pitch: 0.3      ;; Pitch Randomization percentage ( between +/- 30%)
    +Randomize Volume: +0.1    ;; Volume Randomization percentage ( up to +10%)
$Sound: 11                     ;; Second Sound ID
$Sound: 12                     ;; Last sound in this set

$Set: 1
$Sound: 13

#End

The + and - there is an additional feature, which would essentially allow the tabler some flexibility for the randomization. The value is a % of the volume or pitch (might actually be the .wav's total playtime), and has to be a float value to allow for fine adjustments (especially for randomizing the pitch).

Next problem for the .tbl's would be to figure out how to differentiate between individual sounds and sound sets with the existing system. Ideally, the implementation would be backwards compatible... so if you don't specify to use a sound set somewhere, the sound ID will be used.
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 zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Feature request: Adding custom impact sounds for different weapons.
Wouldn't it be better to just expand the functionality of sounds.tbl? I don't see why that wouldn't be entirely possible. Also, places where you reference sound names/id's/numbers (such as $LaunchSnd:) could simply accept lists of sounds ("$LaunchSnd: (231, 232, 233)") as well.

 

Offline m!m

  • 211
Re: Feature request: Adding custom impact sounds for different weapons.
Wouldn't it be better to just expand the functionality of sounds.tbl? I don't see why that wouldn't be entirely possible. Also, places where you reference sound names/id's/numbers (such as $LaunchSnd:) could simply accept lists of sounds ("$LaunchSnd: (231, 232, 233)") as well.
That would essentially need as much work as the proposed sound set feature with less flexibility as you would still need to change every invocation of snd_play and friends to use the list so we could just as easily refactor the sound management system and add that feature on the way.

 
Re: Feature request: Adding custom impact sounds for different weapons.
I HATE sounds.tbl.


personally if i could reference sounds directly from the weapon tables as files it would be perfect.

stuff like a line that says:

fileSndlaunch:      rocketlaunch.ogg,65,  rocketlaunch2ogg,35
filesndflyby:    rocketfly.ogg,
fileshieldsndhit: rockethit.ogg,45, rockethit2.ogg,55
filehullsndhit: rockethit.ogg,45, rockethit2.ogg,55

the "," used to separate each sound and the number is the weight for randomness

and as mentioned before use the sound engine to handle the distortion from distance and alike by using the file frequency.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Feature request: Adding custom impact sounds for different weapons.
You can't do without sounds.tbl. Min/max sound distance and volume etc.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline torc

  • 210
  • Diaspora SFX engineer
Re: Feature request: Adding custom impact sounds for different weapons.
sounds table works fine IMO:
It's pretty much intuitive, we'd need just to ''expand'' some functions.
indossare una divisa può avere un prezzo alto...ma a volte...è troppo alto!!! Bill Adama

 

Offline torc

  • 210
  • Diaspora SFX engineer
Re: Feature request: Adding custom impact sounds for different weapons.
BUMP!!! Just a little reminder: the patch has been done....it needs only review...

If somebody have the time to take a look at it would be great.

thanks a lot.

http://www.hard-light.net/forums/index.php?action=dlattach;topic=81216.0;attach=19503
« Last Edit: July 05, 2012, 04:11:25 pm by torc »
indossare una divisa può avere un prezzo alto...ma a volte...è troppo alto!!! Bill Adama

 

Offline Iss Mneur

  • 210
  • TODO:
Re: Feature request: Adding custom impact sounds for different weapons.
m!m: that looks good to me.

I agree with Spoon (uh oh, the end of the world may actually come in 2012 :P) that this should be extended to not just be a player only feature and allow individual weapons to specify the impact sound for not player impacts as well.
« Last Edit: July 05, 2012, 10:33:33 pm by Iss Mneur »
"I love deadlines. I like the whooshing sound they make as they fly by." -Douglas Adams
wxLauncher 0.9.4 public beta (now with no config file editing for FRED) | wxLauncher 2.0 Request for Comments

 

Offline torc

  • 210
  • Diaspora SFX engineer
Re: Feature request: Adding custom impact sounds for different weapons.
If you wanna implement this too, i'm fine...but i hope there will be the way to assign 2 different sounds: one for the player and one for the other ships, since you'll be able to use 2 different sounds and entry in sounds table giving different pitch and distance values.
indossare una divisa può avere un prezzo alto...ma a volte...è troppo alto!!! Bill Adama

 

Offline m!m

  • 211
Re: Feature request: Adding custom impact sounds for different weapons.
I attached a patch which now also includes custom shield impact sounds for all weapons for both armed and disarmed states.
I also noticed that "$Disarmed ImpactSnd" never actually worked as it saved the index specified in the table as the impact sound of the weapon so I also fixed that in the attached patch.

[attachment deleted by a ninja]

  
Re: Feature request: Adding custom impact sounds for different weapons.
While we are on the subject of sound
How about being able to assign multiple launch sounds for a weapon? Instead of pewpewpewpewpew we could do pewblewmewpewbew when firing a subach.

And hell, instead of limiting this to the Player. I'd love to see a shield hit impact sound option for whatever weapon. Cause right now when you fire the biggest deadliest missile you have on the enemy. It will only play its GIANT SPACE NUKE SOUND EFFECT when it directly impacts with the hull. If it hits the shield its just 'btzz'.


Or maybe the sound can be altered based on the strength of the shields remaining when hit?   (Full strength shields vs only 1/2 remaining?)
When firing something weak like the subach over and over, you cant tell how low the enemy shields are until you start hearing the impact to the hull.
Maybe even the visual effect could be different as the shields get weaker!