Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: torc on June 25, 2012, 03:10:15 am
-
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.
-
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]
-
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'.
-
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 highly approve of that
-
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?
-
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.
-
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.
-
Possible table format for soundsets:
#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.
-
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.
-
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.
-
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.
-
You can't do without sounds.tbl. Min/max sound distance and volume etc.
-
sounds table works fine IMO:
It's pretty much intuitive, we'd need just to ''expand'' some functions.
-
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
-
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.
-
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.
-
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]
-
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!