Weapons defs sounds questions

Weapons defs sounds questions

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Weapons defs sounds questions

Post by smoth »

question 1) according to:
http://springrts.com/wiki/Weapon_Variables wrote:SoundHit
The sound made when the weapon hits. Must reference a .wav file in the .\Sounds directory. Deprecated in 89.0, use SoundHit{Dry,Wet}
so we have a sound hit table now? like:

Code: Select all

SoundHit = {
			Dry = drySoundFileName,
			Wet = wetSoundFileName,
			}
http://springrts.com/wiki/Weapon_Variables wrote:SoundHitDry
The sound made when the weapon hits land. Must reference a .wav file in the .\Sounds directory.

SoundHitWet
The sound made when the weapon hits water. Must reference a .wav file in the .\Sounds directory.
because these guys indicate they are their own tag as in:

Code: Select all

SoundHitWet = wetSoundFileName,
SoundHitDry = drySoundFileName,
question 2a) so is this how the new sound tags are to be?

question 2b) also the two tags above are described as hitting land or water. What about unit impacts?

question 2c) is this more about if a unit is IN water or ON land?


when a weapon fires there are 3 stages according to (this page)
  • fireweapon(initial trigger to begin a volley of 1-X count shots)
  • shot(happens each shot)
  • EndBurst1(end of the volley, I have not tested if this is called for non burst weapons)
question 3a) is the fire sound played at fireweapon() or shot() stage?

question 3b) is there a way to control whether the fire sound is played at fireweapon() or per shot() stage?
Last edited by smoth on 03 Mar 2014, 19:21, edited 1 time in total.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Weapons defs sounds questions

Post by FLOZi »

1. Clearly I forgot to delete http://springrts.com/wiki/Weapon_Variables 8)

2.a Yes
2.b. My poor description. I would assume (makes an ass out of u and me) that unit/feature hits also fall under SoundHitDry.
2.c. I don't believe so but again, pure assumption. edit: Quick look at the code suggests if water CEG is shown, soundHitWet is used.

3 You missed QueryWeapon
b. Depends on soundTrigger
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Weapons defs sounds questions

Post by smoth »

FLOZi wrote:2.a Yes.
2.b. My poor description. I would assume (makes an ass out of u and me) that unit/feature hits also fall under SoundHitDry.
2.c. I don't believe so but again, pure assumption.
bummer so we are largely unsure on these?
FLOZi wrote:3 You missed QueryWeapon
that is before firecycle. I was concerned with once the unit decides to fire a weapon. Query weapon is called even after a unit stops firing via a stop order for a short period(do some echos you'll see what I mean).
FLOZi wrote: b. Depends on soundTrigger
Does the weapon play soundStart for every round in a burst or only once for each salvo?
it is a boolean. Which one is triggered by true? every round in a burst or each salvo
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Weapons defs sounds questions

Post by FLOZi »

Read my edit. :wink: If water CEG is played, wet sound is used. I think this is dependent solely on relative y position (still looking through code)

QueryWeapon is the start of the fire cycle, at least it was in BOS.

Yeah sorry, I clarified it on the wiki; true = each shot, false = each salvo
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Weapons defs sounds questions

Post by smoth »

Query weapon seems to be called before to check the fire point is clear, with each shot(right after shot() to get the fire point) and several times afterwards for some odd reason.. Bug?
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Weapons defs sounds questions

Post by FLOZi »

Yeah ignore me, talking crap there. :oops:
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Weapons defs sounds questions

Post by Anarchid »

Wrt the entire block 2:

1) I cannot find any information (in memory, wiki, or source) about what sounds will be played when unit, feature, or nothing at all (burnblow) is hit.

2) Therefore.... lua it :|
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Weapons defs sounds questions

Post by smoth »

It isn't that I NEED the feature, just that I wanted to understand it better. I am sure I will just do the same tag for BOTH and be done with it. Just would have been neat if there was different sound possible for ground vs unit vs water hits because I could do a richochet sound.

Still can if I did the "2) LUA it" option/
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Weapons defs sounds questions

Post by Jools »

Anarchid wrote: 1) I cannot find any information (in memory, wiki, or source) about what sounds will be played when unit, feature, or nothing at all (burnblow) is hit.
Nothing is played when you hit units. But the weapon will play a sound when it explodes.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Weapons defs sounds questions

Post by FLOZi »

That is the hit sound Jools.

Just because OTA had lava doesn't mean spring does => there is no engine concept of lava.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Weapons defs sounds questions

Post by smoth »

FLOZi wrote:Yeah ignore me, talking crap there. :oops:
Still does not really explain why I am seeing query weapon echoes after stop command

What about calling play sound on hit? Cheap or not as far as cost?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Weapons defs sounds questions

Post by Forboding Angel »

FLOZi wrote:That is the hit sound Jools.

Just because OTA had lava doesn't mean spring does => there is no engine concept of lava.
And to add on to this, waterdamage != to the properties of lava. In OTA, units would not willingly try to path through lava (they couldn't anyway). In spring, water is water, regardless of whether it does damage or not. Your unit will happily path their way through it.

The engine sees water, not whatever texture you plaster onto it.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Weapons defs sounds questions

Post by Anarchid »

On the cost of explosions and playSound done lua wise:
- Requires SetWatchWeapon for every weapon that would have the lua'd sound.
- Requires only the use of Explosion callin otherwise.

In year 2009, i had a game where every weapon of every unit was listened and acted upon, as shooting stuff was used to capture territory. Spamming hundreds of units didn't seem to bring my machine of that age to its knees, and the game ran faster than CA of 2009. So i'd say the cost of a Total Explosion Awareness program is not very significant in my experience.

PlaySound doesn't seem any different or costlier when done via LUS, COB, widget/gadget or a "native projectile event" from my experience, either. That same game tried emulating "ambient engine sounds" for quite a few units, and yet again performance loss was negligible if even notable (the real problem was sound clipping because of no easy looping support, and it was worse in 2009 than it is now)
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Weapons defs sounds questions

Post by Jools »

Have you tried doing it with many units with a beam type weapon? Give 100 pyros and try playing that sound locally, it does have quite a significant effect on performance.

I know there's no engine concept of lava, but what says there could not be?

You can of course also lua that, hence this discussion here. If you check both waterdamage and water colour (whether colour is more red than blue) I think you can detect 90 % of lava. You may get a false positive in maps with a lot of blood.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Weapons defs sounds questions

Post by Anarchid »

Give 100 pyros and try playing that sound locally, it does have quite a significant effect on performance.
Unless i get everything wrong, nobody is trying to play sound on each of the beam+burst weapon's frame-long projectiles, but once per entire burst.
Have you tried doing it with many units with a beam type weapon?
Yes i tried that. The game in question had two weapons that were exactly beam+burst (with added haxes for sweepfire-like functionality that wasn't easy to do back then), and one of them was the faction's cheaper raider unit (and their only ground unit, to boot).

Counter question: have *you* tried this?
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Weapons defs sounds questions

Post by Jools »

Yes, I have tried it.

XTA has a local sound mode where all sounds are sent to unsynced via tracking projectiles and projectile explosion callin. Now there's a filtering applied so that it doesn't send all explosion events, but some weapontypes cause a lot of explosions, for example the d-gun and pyro flame weapon type. Also the annihilator beam causes two explosions to be called during it's beam duration, and you probably only want one.

I remember that before this gagdet had the filtering applied, it was very hungry. Not the fact that you're tracking explosions or that you're sending them to unsynced, but the fact that you're playing a sound on each explosion. At least that's what I think, correct me if I'm wrong.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Weapons defs sounds questions

Post by Anarchid »

Ah, sending things across the sync boundary is bound to be unpleasant.

Unsure how about synced gadgets, but at least in LUS you can play sounds without traversing the boundary. Unsure if that can be used to make things easier.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Weapons defs sounds questions

Post by smoth »

When you send across unsymced you are asking for slowdown do it as rarely as possible
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Weapons defs sounds questions

Post by Jools »

Well, I don't know how LUS works, but projectile explosion is a synced thing and sounds are unsynced things. I don't see how to not have to traverse that boundary.
Post Reply

Return to “Game Development”