Jump to content

Home

Sound Trackers not followins ents


=X=Master HeX

Recommended Posts

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....

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 years later...

*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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...