[hlcoders] weapon prediction issue

2011-07-12 Thread Priyadarshi Sharma
Hello,

I am having the issue of a weapon being fired multiple times on client
side when there is a lag between client and server (net_fakelag 100).
This is similar to the issue mentioned here :
http://www.mail-archive.com/hlcoders@list.valvesoftware.com/msg19271.html

I've tried the suggested fix but it doesn't seem to help in my case.
It only happens in the burst fire mode though, not otherwise.

Below are the relevant functions. As you can see, even checking for
IsFirstTimePredicted() doesn't solve the issue and the function is
still called multiple times on client side as evident from the
DevMsg() below. How do I go on about solving this issue?

PS - I've also tried the fix mentioned here -
http://www.mail-archive.com/hlcoders@list.valvesoftware.com/msg19344.html,
which indicates a bug with the SDK itself, but no help here too.

Code :

void MyWeapon::ItemPostFrame()
{

// Burstfire continues for 3 shots after we press fire
if(cBurstShots)
BurstFire();
else
BaseClass::ItemPostFrame();
}

void MyWeapon::BurstFire()
{
if (!m_iClip1)
{
cBurstShots = 0;
return;
}

if (tNextBurst  gpGlobals-curtime)
return;

#ifdef CLIENT_DLL
if ( prediction-InPrediction()  !prediction-IsFirstTimePredicted() )
return;
#endif

#ifdef CLIENT_DLL
DevMsg(Time : %f cBurstShots : %d tNextBurst : %f\n,
gpGlobals-curtime, cBurstShots, tNextBurst);
#endif

// making this NOT relative to curtime means it won't be totally
cpu/tickrate dependent
tNextBurst += info.m_tReloadChamber;

--cBurstShots;

Fire();

m_flNextPrimaryAttack = m_flNextSecondaryAttack = gpGlobals-curtime + 
0.1;

WeaponSound( SINGLE );
DoMuzzleFlash();
}


void MyWeapon::PrimaryAttack()
{
if (!fBurstMode)
{
Fire();
return;
}

cBurstShots = 3;
tNextBurst = gpGlobals-curtime;
SendWeaponAnim( ACT_VM_PRIMARYATTACK );
}

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] weapon prediction issue

2011-07-12 Thread Tom Edwards
The function being called multiple times is normal, that's how 
prediction testing works. Does the weapon actually end up in an 
incorrect state after firing multiple times? If not, this is likely to 
be a problem with the viewmodel entity rather than the weapon. Are you 
using predicted_viewmodel?


On 12/07/2011 9:05, Priyadarshi Sharma wrote:

Hello,

I am having the issue of a weapon being fired multiple times on client
side when there is a lag between client and server (net_fakelag 100).
This is similar to the issue mentioned here :
http://www.mail-archive.com/hlcoders@list.valvesoftware.com/msg19271.html

I've tried the suggested fix but it doesn't seem to help in my case.
It only happens in the burst fire mode though, not otherwise.

Below are the relevant functions. As you can see, even checking for
IsFirstTimePredicted() doesn't solve the issue and the function is
still called multiple times on client side as evident from the
DevMsg() below. How do I go on about solving this issue?

PS - I've also tried the fix mentioned here -
http://www.mail-archive.com/hlcoders@list.valvesoftware.com/msg19344.html,
which indicates a bug with the SDK itself, but no help here too.

Code :

void MyWeapon::ItemPostFrame()
{

// Burstfire continues for 3 shots after we press fire
if(cBurstShots)
BurstFire();
else
BaseClass::ItemPostFrame();
}

void MyWeapon::BurstFire()
{
if (!m_iClip1)
{
cBurstShots = 0;
return;
}

if (tNextBurst  gpGlobals-curtime)
return;

#ifdef CLIENT_DLL
 if ( prediction-InPrediction()  !prediction-IsFirstTimePredicted() 
)
 return;
#endif

#ifdef CLIENT_DLL
DevMsg(Time : %f cBurstShots : %d tNextBurst : %f\n,
gpGlobals-curtime, cBurstShots, tNextBurst);
#endif

// making this NOT relative to curtime means it won't be totally
cpu/tickrate dependent
tNextBurst += info.m_tReloadChamber;

--cBurstShots;

Fire();

m_flNextPrimaryAttack = m_flNextSecondaryAttack = gpGlobals-curtime + 
0.1;

WeaponSound( SINGLE );
DoMuzzleFlash();
}


void MyWeapon::PrimaryAttack()
{
if (!fBurstMode)
 {
Fire();
return;
}

cBurstShots = 3;
tNextBurst = gpGlobals-curtime;
SendWeaponAnim( ACT_VM_PRIMARYATTACK );
}

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders




___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] weapon prediction issue

2011-07-12 Thread Will @ Laby
Thanks for the input we'll look into it
cheers

-Original Message-
From: hlcoders-boun...@list.valvesoftware.com
[mailto:hlcoders-boun...@list.valvesoftware.com] On Behalf Of Priyadarshi
Sharma
Sent: Tuesday, 12 July 2011 6:06 PM
To: hlcoders@list.valvesoftware.com
Subject: [hlcoders] weapon prediction issue

Hello,

I am having the issue of a weapon being fired multiple times on client
side when there is a lag between client and server (net_fakelag 100).
This is similar to the issue mentioned here :
http://www.mail-archive.com/hlcoders@list.valvesoftware.com/msg19271.html

I've tried the suggested fix but it doesn't seem to help in my case.
It only happens in the burst fire mode though, not otherwise.

Below are the relevant functions. As you can see, even checking for
IsFirstTimePredicted() doesn't solve the issue and the function is
still called multiple times on client side as evident from the
DevMsg() below. How do I go on about solving this issue?

PS - I've also tried the fix mentioned here -
http://www.mail-archive.com/hlcoders@list.valvesoftware.com/msg19344.html,
which indicates a bug with the SDK itself, but no help here too.

Code :

void MyWeapon::ItemPostFrame()
{

// Burstfire continues for 3 shots after we press fire
if(cBurstShots)
BurstFire();
else
BaseClass::ItemPostFrame();
}

void MyWeapon::BurstFire()
{
if (!m_iClip1)
{
cBurstShots = 0;
return;
}

if (tNextBurst  gpGlobals-curtime)
return;

#ifdef CLIENT_DLL
if ( prediction-InPrediction() 
!prediction-IsFirstTimePredicted() )
return;
#endif

#ifdef CLIENT_DLL
DevMsg(Time : %f cBurstShots : %d tNextBurst : %f\n,
gpGlobals-curtime, cBurstShots, tNextBurst);
#endif

// making this NOT relative to curtime means it won't be totally
cpu/tickrate dependent
tNextBurst += info.m_tReloadChamber;

--cBurstShots;

Fire();

m_flNextPrimaryAttack = m_flNextSecondaryAttack = gpGlobals-curtime
+ 0.1;

WeaponSound( SINGLE );
DoMuzzleFlash();
}


void MyWeapon::PrimaryAttack()
{
if (!fBurstMode)
{
Fire();
return;
}

cBurstShots = 3;
tNextBurst = gpGlobals-curtime;
SendWeaponAnim( ACT_VM_PRIMARYATTACK );
}

___
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders





___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] weapon prediction issue

2011-07-12 Thread Priyadarshi Sharma
The weapon doesn't end up in an incorrect state and it is using
predicted_viewmodel. But I also see the wall decals corresponding to
the number of times the function was called, so that shouldn't relate
to a viewmodel problem.

On Tue, Jul 12, 2011 at 4:24 PM, Tom Edwards t_edwa...@btinternet.com wrote:
 The function being called multiple times is normal, that's how prediction
 testing works. Does the weapon actually end up in an incorrect state after
 firing multiple times? If not, this is likely to be a problem with the
 viewmodel entity rather than the weapon. Are you using predicted_viewmodel?

 On 12/07/2011 9:05, Priyadarshi Sharma wrote:

 Hello,

 I am having the issue of a weapon being fired multiple times on client
 side when there is a lag between client and server (net_fakelag 100).
 This is similar to the issue mentioned here :
 http://www.mail-archive.com/hlcoders@list.valvesoftware.com/msg19271.html

 I've tried the suggested fix but it doesn't seem to help in my case.
 It only happens in the burst fire mode though, not otherwise.

 Below are the relevant functions. As you can see, even checking for
 IsFirstTimePredicted() doesn't solve the issue and the function is
 still called multiple times on client side as evident from the
 DevMsg() below. How do I go on about solving this issue?

 PS - I've also tried the fix mentioned here -
 http://www.mail-archive.com/hlcoders@list.valvesoftware.com/msg19344.html,
 which indicates a bug with the SDK itself, but no help here too.

 Code :

 void MyWeapon::ItemPostFrame()
 {

        // Burstfire continues for 3 shots after we press fire
        if(cBurstShots)
                BurstFire();
        else
                BaseClass::ItemPostFrame();
 }

 void MyWeapon::BurstFire()
 {
        if (!m_iClip1)
        {
                cBurstShots = 0;
                return;
        }

        if (tNextBurst  gpGlobals-curtime)
                return;

 #ifdef CLIENT_DLL
         if ( prediction-InPrediction()
  !prediction-IsFirstTimePredicted() )
                 return;
 #endif

 #ifdef CLIENT_DLL
        DevMsg(Time : %f cBurstShots : %d tNextBurst : %f\n,
 gpGlobals-curtime, cBurstShots, tNextBurst);
 #endif

        // making this NOT relative to curtime means it won't be totally
 cpu/tickrate dependent
        tNextBurst += info.m_tReloadChamber;

        --cBurstShots;

        Fire();

        m_flNextPrimaryAttack = m_flNextSecondaryAttack =
 gpGlobals-curtime + 0.1;

        WeaponSound( SINGLE );
        DoMuzzleFlash();
 }


 void MyWeapon::PrimaryAttack()
 {
        if (!fBurstMode)
         {
                Fire();
                return;
        }

        cBurstShots = 3;
        tNextBurst = gpGlobals-curtime;
        SendWeaponAnim( ACT_VM_PRIMARYATTACK );
 }

 ___
 To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders



 ___
 To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders



___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



[hlcoders] Choppy motion using the 2007 sdk mp template

2011-07-12 Thread iiyo cc
Hello folks,

I've been toying with the mod from scratch/multiplayer template from the
2007 SDK and have a big issue that I can't figure out how to fix (nor find
any information about - which is odd, because I'm sure it can't only be
me!). Anyway, the issue is when moving around there is a really choppy
motion - the world doesn't transition nicely from view - it pans very
choppily. To describe it, it's like playing Minecraft on a bad computer
while the world is generating, except it's not an FPS issue since that's
constantly at fps_max!

I hope someone knows what the problem could be.

Thanks~
___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders