Sound effects of streaming weapons

Sound effects of streaming weapons

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

IMSabbel
Posts: 747
Joined: 30 Jul 2005, 13:29

Sound effects of streaming weapons

Post by IMSabbel »

It seems that weapons like the beam-lasers, or the pyro flamethrower, start a new sound effect with each emitted particle.
With numbers of sounds at once put to 30 or 40, this creates a noisy mess as soon as a single pyro or d-gun is used :(

Wouldn't it be better to create a looping "flamethrower" or "laser" sample and just play it as long as the weapon fires?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

It depends, cus then short bursts of fire wouldnt sound very good. There's a slider in settigns to change the number of sounds you hear at once, and those sounds are meant to be buitl ontop fo eachother, fi ti sounds a mess its either a hardware problem or its meant ot eb a mess.
IMSabbel
Posts: 747
Joined: 30 Jul 2005, 13:29

Post by IMSabbel »

Well, i seriously doubt there is a hardware problem, because eveything else works, thank you very much.

You cant seriously think its _the right thing_ to mindlessly flood the sound mixer with scores of overlapping samples from a single weapon as long as channel slots are free, right?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Well there's a limited nubmer, and when we fire a weapon such as a pyros flamethrower, we're usually doing it with quite a few pyros infront of us. Eitherway sound works alright and I dont see any reason to change it.
Betalord
Former Engine Dev
Posts: 543
Joined: 29 Jun 2005, 09:31

Post by Betalord »

I guess IMSabbel is right and looping is the right way to do it. Playing many samples at the same time means adding the amplitudes which increases the volume unrealisticly. When I use D-Gun, it gets so loud I have to immidiately decrease speakers volume. This is an issue and should be fixed.
User avatar
GrOuNd_ZeRo
Posts: 1370
Joined: 30 Apr 2005, 01:10

Post by GrOuNd_ZeRo »

the Soundtrigger=1; tag is not supported, this is why you hear so many shots...

it's QUITE annoying.
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Post by aGorm »

whats that do?? I've not seen it.

aGorm
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

From Cavedog themselves, in WEAPONS.TDF:

// This stuff affects the sounds the weapons make

// soundstart = Sound to make when the weapon fires
// soundhit = Sound to make when the weapon detonates (if the weapon detonates)
// soundwater = Sound to make when the weapon hits the water
// soundtrigger = Make the weapon sound when the weapon fires in burst mode
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Post by aGorm »

Ahhh, is that why bursting wepons sounds altered as they fired? they had a loop for while they were bursting... makes sence. Thats should be the case here i think.

aGorm
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

As a vaguely relevant aside, it would be great if we could make units activate sounds from scripting alone.

That way we can make it so the ATAT makes a "stomping" sound whenever its feet touch the ground, as well as numerous other auditory additions.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

In TA:Kingdoms it was apparently possible. Found that in tarfire script:
play-sound ("FIREDEM", PLAYSOUND_PRIORITY_BATTLE );
User avatar
GrOuNd_ZeRo
Posts: 1370
Joined: 30 Apr 2005, 01:10

Post by GrOuNd_ZeRo »

I'd love having sounds for tracks moving, Kbots-Infantry walking, aircraft flying...

I could use alot of idle type sounds from all sorts of sources.
IMSabbel
Posts: 747
Joined: 30 Jul 2005, 13:29

Post by IMSabbel »

Just one question: Doees spring use a priority system?

I mean, can a high priority sound kick a low priority channel out, even while it has not finished playing?

Because that would be really usefull, because 50 moving tanks could fill the fixer and you dont hear the berta shells exploding or something...
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

Well, the script activated sounds was for particular units, such as the ATAT.

For tanks to make tread noises, and kbots to have walk noises, I think that the sounds should be built into the game, not scripted. Otherwise filesizes would be enormous, and scripting would be a massive hassle.

So, basically, if you have a tank, you put:
AmbientSound=1 (or use "ambientlighttank.wav" instead of a number for more flexibility)

Or an Aircraft:
AmbientSound=2

Or a Kbot:
AmbientSound=3
AmbientSoundInterval=1.6

Where 1 refers to the sound of caterpillar treads, 2 refers to jet engine sound, and 3 refers to the kbot walk soudn (with the soundinterval code letting spring know the speed of the units footstep so that it can play it in synch with its walk).

Then you would have sounds for all the different unit classes in TA, not just "kbot" or "aircraft" (ie: light kbot, heavy kbot, super unit kbot, scout craft, fighter aircraft, bomber, gunship). Extra units could refer to such sounds as they wished, or could add new sounds in if they wanted their own sounds.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

I'd much much rather have:
AmbientSound=ambientlighttank.wav, yeah.

And no SoundInterval, just make it loop.
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Re: Sound effects of streaming weapons

Post by Pendrokar »

I really want to get back to this, because:
The flamethrower weapon (BA5.5) fires 22 bursts of flame every 1.5 secs and then reloads. Every burst makes a sound and checking from the weapontimer the sound is played 0.068 a second!!! You just can't withstand 5 pyro's firing while being close to them!

Code: Select all

reloadtime=1.1;
weapontimer=1.5;
burst=22;
soundstart=Flamhvy1;
soundtrigger=0;
So for a normal sound you need to use a sound thats 0.068 secs from which you can't make anything! Maybe some scratch.
This can be resolved by adding a sound that loops until weapontimer has ended or (if reloadtime is very short, about 0.1) loop that sound until unit stops firing!
This just gives me a problem with a flamethrower sound that smoth has asked me for the Tower Defence Mod, because the flamethrower turret has a reloadtime of 0.1 ("weapontime = 0" I suppose)
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Sound effects of streaming weapons

Post by Argh »

soundstart=Flamhvy1;
soundtrigger=0;
Soundtrigger=0 means that it will not just play one sound clip, but instead plays the sound every time it fires. It's a problem with BA, basically. BA is full of junk and bad practices like this. I do not recommend it as a reference, nobody maintaining that mod has done a good job of cleaning it up or fixing stuff like this, frankly.

See how I set up the machineguns for the Heavy Shells in P.U.R.E. (Heavy_Shell_Gun)- it's a single sound, using Soundtrigger=1, that sounds like 5 shots being fired, which fits the burst timing perfectly. With flamethrowers, it's straightforward- just make a sound that is as long as the longest possible burst (usually, this is a second or two, with timing that allows for continuous fire). The "worst" thing that happens is that the sound is trailing off but the burst has already been ended by Spring's code handling bursts (it treats them as single shots, basically). As an alternative, it's quite simple to make a weapon fire a pre-determined number of shots via COB (or, for that matter, a random number, and new stuff in SVN lets us play with other nifty things as well), so you could have a flamethrower that was forced to use a burst-length that matched a sound-length (and some BOS code to lock it from rotating the originating piece while doing so is trivial).

In short:

A. Soundtrigger=1 works just fine, and plays the sound ONCE per BURST. Not the other way around.

B. To get the behaviors you want, you can take a variety of approaches, even going so far as different sounds with different lengths to reflect different lengths of bursts forced via COB. It's not really hard to do unless you're totally stuck with COB stuff, in which case, you need to sit down and learn how it works, or settle for sounds that may keep playing after the weapon has really quit firing, which with a flamethrower isn't a big deal anyhow, frankly.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Re: Sound effects of streaming weapons

Post by Snipawolf »

All the sound options work, it is up to modders to fix the problem of sound flood.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Sound effects of streaming weapons

Post by bobthedinosaur »

so Soundtrigger=0 on burst will play the sound file once? :shock:
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Sound effects of streaming weapons

Post by Argh »

A. Soundtrigger=1 works just fine, and plays the sound ONCE per BURST. Not the other way around.
:roll:
Post Reply

Return to “Engine”