Re: [hlcoders] Player hitbox rotating on the y axis and getting out of sync on strafe ?
Thanks for sharing the fix On Tue, Nov 8, 2011 at 6:02 PM, Psy_Commando wrote: > Alright, I found the problem. The main source is in > "server/player_command.cpp" > in the "void CPlayerMove::FinishMove( CBasePlayer *player, CUserCmd *ucmd, > CMoveData *move )" function : > > float pitch = move->m_vecAngles[ PITCH ]; >> if ( pitch > 180.0f ) >> { >> pitch -= 360.0f; >> } >> pitch = clamp( pitch, -90, 90 ); >> >> move->m_vecAngles[ PITCH ] = pitch; >> >> player->SetBodyPitch( pitch ); >> >> player->SetLocalAngles( move->m_vecAngles ); // <- This is the problem >> > > > I made the same lazy fix they did in the hl2mp code : > > void CHL2MP_Player::PostThink( void ) >> { >>... >> QAngle angles = GetLocalAngles(); >> angles[PITCH] = 0; >> SetLocalAngles( angles ); >>... >> } >> > > And in addition I override the "FinishMove" method in my > "server/asw_playermove.cpp" file, and copied the old code from > "CPlayerMove::FinishMove" and removed the problematic line. > > //PsyCommando : Rewrote this here to remove the bit of code that made the >> player hitboxes move with the camera pitch !!!; >> void CASW_PlayerMove::FinishMove( CBasePlayer *player, CUserCmd *ucmd, >> CMoveData *move ) >> { >> VPROF( "CPlayerMove::FinishMove" ); >> >> player->m_flMaxspeed= move->m_flClientMaxSpeed; >> player->SetAbsOrigin( move->GetAbsOrigin() ); >> player->SetAbsVelocity( move->m_vecVelocity ); >> player->SetPreviouslyPredictedOrigin( move->GetAbsOrigin() ); >> >> player->m_Local.m_nOldButtons= move->m_nButtons; >> >> // Convert final pitch to body pitch >> float pitch = move->m_vecAngles[ PITCH ]; >> if ( pitch > 180.0f ) >> { >> pitch -= 360.0f; >> } >> pitch = clamp( pitch, -90, 90 ); >> >> move->m_vecAngles[ PITCH ] = pitch; >> >> player->SetBodyPitch( pitch ); >> >> //player->SetLocalAngles( move->m_vecAngles ); //<- this was the >> source of headaches - psycommando >> >> // The class had better not have changed during the move!! >> if ( player->m_hConstraintEntity ) >> Assert( move->m_vecConstraintCenter == >> player->m_hConstraintEntity.Get()->GetAbsOrigin() ); >> else >> Assert( move->m_vecConstraintCenter == >> player->m_vecConstraintCenter ); >> Assert( move->m_flConstraintRadius == player->m_flConstraintRadius ); >> Assert( move->m_flConstraintWidth == player->m_flConstraintWidth ); >> Assert( move->m_flConstraintSpeedFactor == >> player->m_flConstraintSpeedFactor ); >> Assert( move->m_bConstraintPastRadius == >> player->m_bConstraintPastRadius ); >> } >> > > > > On Mon, Nov 7, 2011 at 4:17 PM, Psy_Commando wrote: > >> Thanks, but I was pretty much expecting that the viewangles were affected >> to the player's entity somewhere. I'm not sure where to look though. >> >> I noticed that setting third person platformer to 1 stops the problem, >> until you set it back to 0. >> >> >> On Mon, Nov 7, 2011 at 5:17 AM, Saul Rennison wrote: >> >>> Looks like your hitboxes are using pitch from m_angViewAngles, or that >>> you have a SetAbsAngles(m_angViewAngles) somewhere. >>> >>> >>> Kind regards, >>> *Saul Rennison* >>> >>> >>> On 7 November 2011 02:06, Psy_Commando wrote: >>> Hello, I've been looking around for info on why it does this : http://www.youtube.com/watch?v=yP3ZGKfCehQ Basically the hitboxes are moving with the camera on the y axis and the hitboxes get out of sync when I strafe. I use a modified Alien Swarm player (not the marine npc), with the hl2mp animstates. Anybody, has an idea where I should look, or how to fix this ? ___ 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 > > > ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Player hitbox rotating on the y axis and getting out of sync on strafe ?
Alright, I found the problem. The main source is in "server/player_command.cpp" in the "void CPlayerMove::FinishMove( CBasePlayer *player, CUserCmd *ucmd, CMoveData *move )" function : float pitch = move->m_vecAngles[ PITCH ]; > if ( pitch > 180.0f ) > { > pitch -= 360.0f; > } > pitch = clamp( pitch, -90, 90 ); > > move->m_vecAngles[ PITCH ] = pitch; > > player->SetBodyPitch( pitch ); > > player->SetLocalAngles( move->m_vecAngles ); // <- This is the problem > I made the same lazy fix they did in the hl2mp code : void CHL2MP_Player::PostThink( void ) > { >... > QAngle angles = GetLocalAngles(); > angles[PITCH] = 0; > SetLocalAngles( angles ); >... > } > And in addition I override the "FinishMove" method in my "server/asw_playermove.cpp" file, and copied the old code from "CPlayerMove::FinishMove" and removed the problematic line. //PsyCommando : Rewrote this here to remove the bit of code that made the > player hitboxes move with the camera pitch !!!; > void CASW_PlayerMove::FinishMove( CBasePlayer *player, CUserCmd *ucmd, > CMoveData *move ) > { > VPROF( "CPlayerMove::FinishMove" ); > > player->m_flMaxspeed= move->m_flClientMaxSpeed; > player->SetAbsOrigin( move->GetAbsOrigin() ); > player->SetAbsVelocity( move->m_vecVelocity ); > player->SetPreviouslyPredictedOrigin( move->GetAbsOrigin() ); > > player->m_Local.m_nOldButtons= move->m_nButtons; > > // Convert final pitch to body pitch > float pitch = move->m_vecAngles[ PITCH ]; > if ( pitch > 180.0f ) > { > pitch -= 360.0f; > } > pitch = clamp( pitch, -90, 90 ); > > move->m_vecAngles[ PITCH ] = pitch; > > player->SetBodyPitch( pitch ); > > //player->SetLocalAngles( move->m_vecAngles ); //<- this was the > source of headaches - psycommando > > // The class had better not have changed during the move!! > if ( player->m_hConstraintEntity ) > Assert( move->m_vecConstraintCenter == > player->m_hConstraintEntity.Get()->GetAbsOrigin() ); > else > Assert( move->m_vecConstraintCenter == > player->m_vecConstraintCenter ); > Assert( move->m_flConstraintRadius == player->m_flConstraintRadius ); > Assert( move->m_flConstraintWidth == player->m_flConstraintWidth ); > Assert( move->m_flConstraintSpeedFactor == > player->m_flConstraintSpeedFactor ); > Assert( move->m_bConstraintPastRadius == > player->m_bConstraintPastRadius ); > } > On Mon, Nov 7, 2011 at 4:17 PM, Psy_Commando wrote: > Thanks, but I was pretty much expecting that the viewangles were affected > to the player's entity somewhere. I'm not sure where to look though. > > I noticed that setting third person platformer to 1 stops the problem, > until you set it back to 0. > > > On Mon, Nov 7, 2011 at 5:17 AM, Saul Rennison wrote: > >> Looks like your hitboxes are using pitch from m_angViewAngles, or that >> you have a SetAbsAngles(m_angViewAngles) somewhere. >> >> >> Kind regards, >> *Saul Rennison* >> >> >> On 7 November 2011 02:06, Psy_Commando wrote: >> >>> Hello, I've been looking around for info on why it does this : >>> http://www.youtube.com/watch?v=yP3ZGKfCehQ >>> >>> Basically the hitboxes are moving with the camera on the y axis and the >>> hitboxes get out of sync when I strafe. >>> I use a modified Alien Swarm player (not the marine npc), with the hl2mp >>> animstates. >>> >>> Anybody, has an idea where I should look, or how to fix this ? >>> >>> ___ >>> 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
Re: [hlcoders] Player hitbox rotating on the y axis and getting out of sync on strafe ?
Thanks, but I was pretty much expecting that the viewangles were affected to the player's entity somewhere. I'm not sure where to look though. I noticed that setting third person platformer to 1 stops the problem, until you set it back to 0. On Mon, Nov 7, 2011 at 5:17 AM, Saul Rennison wrote: > Looks like your hitboxes are using pitch from m_angViewAngles, or that you > have a SetAbsAngles(m_angViewAngles) somewhere. > > > Kind regards, > *Saul Rennison* > > > On 7 November 2011 02:06, Psy_Commando wrote: > >> Hello, I've been looking around for info on why it does this : >> http://www.youtube.com/watch?v=yP3ZGKfCehQ >> >> Basically the hitboxes are moving with the camera on the y axis and the >> hitboxes get out of sync when I strafe. >> I use a modified Alien Swarm player (not the marine npc), with the hl2mp >> animstates. >> >> Anybody, has an idea where I should look, or how to fix this ? >> >> ___ >> 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
Re: [hlcoders] Player hitbox rotating on the y axis and getting out of sync on strafe ?
Looks like your hitboxes are using pitch from m_angViewAngles, or that you have a SetAbsAngles(m_angViewAngles) somewhere. Kind regards, *Saul Rennison* On 7 November 2011 02:06, Psy_Commando wrote: > Hello, I've been looking around for info on why it does this : > http://www.youtube.com/watch?v=yP3ZGKfCehQ > > Basically the hitboxes are moving with the camera on the y axis and the > hitboxes get out of sync when I strafe. > I use a modified Alien Swarm player (not the marine npc), with the hl2mp > animstates. > > Anybody, has an idea where I should look, or how to fix this ? > > ___ > 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] Player hitbox rotating on the y axis and getting out of sync on strafe ?
Hello, I've been looking around for info on why it does this : http://www.youtube.com/watch?v=yP3ZGKfCehQ Basically the hitboxes are moving with the camera on the y axis and the hitboxes get out of sync when I strafe. I use a modified Alien Swarm player (not the marine npc), with the hl2mp animstates. Anybody, has an idea where I should look, or how to fix this ? ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders