playing sounds to the player only??

Discuss programming in the QuakeC language.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: playing sounds to the player only??

Post by Spike »

if the mod is stuffcmding or writebyting a cd track at the start of the map, you're fighting the engine's svc, so might still sound glitchy.
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: playing sounds to the player only??

Post by Cobalt »

If you attenuate it to the lowest : ATTN_STATIC , the sound is so low that the only way it could be heard by another player is if they were right on top of you.
Also, the volume level (0-1) can be decimal values to further tweak it.
drm_wayne
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Re: playing sounds to the player only??

Post by drm_wayne »

i had added it to the engine just for testing stuff:

The muzzleflash effect was emiting a firingsound that was heard only by the player, and in the qc the weapons only played a ATTN_NONE firing sound so
you could hear gunshots in the distance, but the sounds got cutted off so i kicked it out again..
But it was cool :mrgreen:
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: playing sounds to the player only??

Post by Cobalt »

ATTN_NONE pretty much means it will be heard all over the level no matter where it comes from. If you notice all the player death sounds are ATTN_NONE...so if a player dies underwater, you still hear the udeath noise. Sort of unreal, but it makes for I guess a more humorous game play.

ATTN_NORM would add some atttenuation depending on sistance, so will STATIC and IDLE. In reality I think a gunshot sound would have attenuaiton over distance, so ATTN_NONE would probably not be a good choice for it. Also the muzzleflash effect has some other uses, such as in the superspike touch for when it hits a map BSP...it can simulate a random spark flash.
drm_wayne wrote:i had added it to the engine just for testing stuff:

The muzzleflash effect was emiting a firingsound that was heard only by the player, and in the qc the weapons only played a ATTN_NONE firing sound so
you could hear gunshots in the distance, but the sounds got cutted off so i kicked it out again..
But it was cool :mrgreen:
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: playing sounds to the player only??

Post by leileilol »

Cobalt wrote:ATTN_NONE pretty much means it will be heard all over the level no matter where it comes from. If you notice all the player death sounds are ATTN_NONE...so if a player dies underwater, you still hear the udeath noise. Sort of unreal, but it makes for I guess a more humorous game play.
and it's a feature i hated for years :( very spammy in 12+ player matches. This gets even worse in some engines that disable spatialization for ATTN_NONE sounds to accompany the old method of looping large WAV files for music (As many mods did in 1999-2002, particularly FrikaC and RenegadeC productions and the whole movie scene), because you can't hear where this death scream is coming from.

Had to do an engine hack to workaround that weird decision, forcing all player/ sounds to ATTN_NORM as an option.
i should not be here
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: playing sounds to the player only??

Post by Cobalt »

You could work around it in QC, simply scan all the files for ATTN_NONE, and set to NORM as you see fit. I have some sounds for the rain and other weather type effects going on and was using NONE for them, but after doing some waterdepth tests in DP, and changing the cvar snd_attenuation_decibel based in his water depth, thats when I discovered all the weather sounds could still be heard underwater no matter what that cvar was set to because they were NONE. So I had to set them to NORM so it would observe the new setting in tha attenuaiton decibel cvar.

Another gimmick I did which helped , was a SUB_Db () call to deaden the sound if it was in liquid:

Code: Select all


float() SUB_Db =
{
//float ATTN_NONE    = 0;
//loat ATTN_NORM    = 1;
//float ATTN_IDLE    = 2;
//float ATTN_STATIC    = 3;

//float CONTENT_EMPTY    = -1;
//float CONTENT_SOLID    = -2;
//float CONTENT_WATER    = -3;
//float CONTENT_SLIME    = -4;
//float CONTENT_LAVA    = -5;
//float CONTENT_SKY    = -6;


local float pc;
pc = pointcontents(self.origin);
if (pc == -3 || pc == -4)
return (3);



//if (pc == -2) Sound somehow spawns in solid...rare


if (random () < 0.5)
return (2);
else
return (1);

};







sound (self, CHAN_WEAPON, "player/axhit2.wav", 1, SUB_Db());


leileilol wrote:Had to do an engine hack to workaround that weird decision, forcing all player/ sounds to ATTN_NORM as an option.
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: playing sounds to the player only??

Post by r00k »

leileilol wrote: and it's a feature i hated for years :( very spammy in 12+ player matches. This gets even worse in some engines that disable spatialization for ATTN_NONE sounds to accompany the old method of looping large WAV files for music (As many mods did in 1999-2002, particularly FrikaC and RenegadeC productions and the whole movie scene), because you can't hear where this death scream is coming from.

Had to do an engine hack to workaround that weird decision, forcing all player/ sounds to ATTN_NORM as an option.

i know im right there with you... i gues carmack wanted Quake to sound like standing in an 80s arcade with all the bells going off!!
drm_wayne
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Re: playing sounds to the player only??

Post by drm_wayne »

Cobalt wrote: Also the muzzleflash effect has some other uses, such as in the superspike touch for when it hits a map BSP...it can simulate a random spark flash.
i know, it was for a custom mod without any quake content. I only added a very very short "BAM!" sound to the engine where it spawns the muzzleflash sprite,
and 2 random ATTN_NONE "distance" weaponsound" but as i said it was horrible and it cuts off player sounds and alot more.

But now im using the epic soundpitch feature from Engoo which gives me something similar i wanted ;)
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: playing sounds to the player only??

Post by leileilol »

Cobalt wrote:You could work around it in QC, simply scan all the files for ATTN_NONE, and set to NORM as you see fit.
Aware of that (and is usually one of the first changes I do), it's just that those closed-source mods needed to have this treatment.

should be a DP cvar imho
i should not be here
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: playing sounds to the player only??

Post by r00k »

the beauty of open source, just do it....
or decompile it, then do it.
Post Reply