Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Sound Trackers not followins ents

Page: 1 of 1
 =X=Master HeX
08-01-2004, 7:24 AM
#1
Before I rack my brain on this one and try to hunt down the bug does anyone have any ideas?

Sound trackers (absorb loop/speed loop/rage loop/etc) don't follow the ent like they did in jk2. I started looking into this and noticed they changed the way the trackers are updated client side. Still no idea why the personal tracker follows but not other peoples.

Server? Client? sigh....
 stubert
08-01-2004, 1:07 PM
#2
how do you mean? and why is it a problem?


but i did find


trap_S_AddLoopingSound(entityNum, lerpOrg, cSound->velocity, cSound->sfx);


check out G_Sound in g_utils... it seems to update a ents flags that include ones to play sounds?


te->s.eFlags = EF_SOUNDTRACKER;


looking around it seems that vectors/events for the sounds are read independently on the client and server from the same sv_Flags (good thing) since jk2 had so many latencey issues i wouldn't bother changing it back since it'd probably create those issues again
 =X=Master HeX
08-01-2004, 3:29 PM
#3
Well, bad news is we can't go back to using the trap command for the sound.

What I'm talking about is back in jk2 if someone put absorb on and walked next to you, you could hear the absorb looping sound. Same for rage/speed/protect. Now in jka the sound is created at a fixed point and doesn't follow the player. So people can only hear the sound where it started.
 razorace
08-01-2004, 3:55 PM
#4
which function is used to start the sound? G_Sound or G_SoundonEnt?
 =X=Master HeX
08-01-2004, 4:47 PM
#5
It's G_Sound.. I'm thinking though that it's a clientside bug because all the old sound tracker code is basically the same. I'm only noticing changes to the client and how they handle sound trackers.
 =X=Master HeX
08-01-2004, 5:40 PM
#6
Fixed.. it's a bug in CG_UpdateSoundTrackers client side.
 stubert
08-01-2004, 5:50 PM
#7
lets see it?
 razorace
08-02-2004, 12:52 AM
#8
Originally posted by =X=Master HeX
It's G_Sound.. I'm thinking though that it's a clientside bug because all the old sound tracker code is basically the same. I'm only noticing changes to the client and how they handle sound trackers.

Well, from my experiences with G_Sound and G_SoundonEnt, G_Sound just creates a temp entity at the given location and doesn't attach it to the entity. That's what G_SoundonEnt is for.

This is important as G_Sound ent sounds won't activate the lip syncing. I honestly don't know what the difference is as to moving sounds or looped stuff thou.
 ensiform
08-03-2006, 12:05 AM
#9
*Massive Bump*

JKA's CG_UpdateSoundTrackers:

void CG_UpdateSoundTrackers()
{
int num;
centity_t *cent;

for ( num = 0 ; num < ENTITYNUM_NONE ; num++ )
{
cent = &cg_entities[num];

if (cent && (cent->currentState.eFlags & EF_SOUNDTRACKER) && cent->currentState.number == num)
//make sure the thing is valid at least.
{ //keep sound for this entity updated in accordance with its attached entity at all times
if (cg.snap && cent->currentState.trickedentindex == cg.snap->ps.clientNum)
{ //this is actually the player, so center the sound origin right on top of us
VectorCopy(cg.refdef.vieworg, cent->lerpOrigin);
trap_S_UpdateEntityPosition( cent->currentState.number, cent->lerpOrigin );
}
else
{
trap_S_UpdateEntityPosition( cent->currentState.number, cg_entities[cent->currentState.trickedentindex].lerpOrigin );
}
}

if (cent->currentState.number == num)
{
//update all looping sounds..
CG_S_UpdateLoopingSounds(num);
}
}
}

JK2's:

void CG_UpdateSoundTrackers()
{
int num;
centity_t *cent;

for ( num = 0 ; num < ENTITYNUM_NONE ; num++ )
{
cent = &cg_entities[num];

if (cent && cent->currentState.eFlags & EF_SOUNDTRACKER)
{ //keep sound for this entity updated in accordance with its attached entity at all times
if (cg.snap && cent->currentState.trickedentindex == cg.snap->ps.clientNum)
{ //this is actually the player, so center the sound origin right on top of us
VectorCopy(cg.refdef.vieworg, cent->lerpOrigin);
trap_S_UpdateEntityPosition( cent->currentState.number, cent->lerpOrigin );
}
else
{
trap_S_UpdateEntityPosition( cent->currentState.number, cg_entities[cent->currentState.trickedentindex].lerpOrigin );
}
}
}
}

The Looping Sound Code Is New to JKA so im assuming it is not that but possibly this piece in jka code:

if (cent && (cent->currentState.eFlags & EF_SOUNDTRACKER) && cent->currentState.number == num)

also, im not sure if it is related to this at all but (usually happens during siege) but at times many in-game sounds tend to not play or are like extremely quiet. For example, force sounds, saber sounds, player deaths, etc.
 stubert
08-03-2006, 4:44 AM
#10
from this thread i can tell i used to know something about jka xDD
 ensiform
08-03-2006, 11:30 AM
#11
xD
Page: 1 of 1