Re: [hlcoders] Solution to laggy first-person spectating
You do not seem to understand what I'm talking about. m_iv_angEyeAngles will not be interpolated if ShouldInterpolate() returns false. Please study carefully how the game's interpolation system works. m_angEyeAngles will not appear smoothly updated to a spectator if m_iv_angEyeAngles is not being interpolated due to ShouldInterpolate() returning false. Date: Sun, 31 May 2015 02:37:01 +0100 From: st...@swires.me To: hlcoders@list.valvesoftware.com Subject: Re: [hlcoders] Solution to laggy first-person spectating Your fix is a hack, not a fix, let's get that right for a start. If you look at the code around it, you'll see that m_iv_angEyeAngles sets up interpolation on m_angEyeAngles, which is a networked copy of a player's eye angles which is sent to everyone but the local player. In C_HL2MPPlayer, the interpolated version is used in ::PreThink and ::EyeAngles also has an override. This makes eye angles in spectator interpolated (ie. smooth) and is Valve's way of implementing this. You probably derived from CBasePlayer or CBaseMultiplayerPlayer and didn't set this up, which again isn't an engine thing. On Sun, May 31, 2015 at 2:31 AM, Peter McKeown pmckeown2...@hotmail.com wrote: I'm not seeing how what you posted is relevant, the declaration of m_angEyeAngles is fine, but no interpolated variables are processed for a spectated player if ShouldInterpolate() returns false, which it does in some cases when spectating a player in first person. I haven't tracked down exactly why since this is a simple fix, most likely their viewmodels (which are visible, the spectator target is not rendered in first person) is chain requiring interpolation and that keeps m_angEyeAngles going. Date: Sun, 31 May 2015 02:25:52 +0100 From: st...@swires.me To: hlcoders@list.valvesoftware.com Subject: Re: [hlcoders] Solution to laggy first-person spectating It's not a bug with the code base and that isn't the proper way to fix it. This is how Valve's games handle it: https://github.com/ValveSoftware/source-sdk-2013/search?utf8=%E2%9C%93q=m_iv_angEyeAngles On Sun, May 31, 2015 at 2:21 AM, Peter McKeown pmckeown2...@hotmail.com wrote: Greetings everyone, There is a bug with the codebase where in some situations the first person spectating of other players can become very laggy, as interpolation for m_angEyeAngles stops. This bug is present in TF2's code as well as I've seen it there too. The issue is that the player's ShouldInterpolate() doesn't take into account if the local player is spectating this player or not, causing it to no longer have it's interpolated variables (like m_iv_angEyeAngles) processed. I've been hunting this bug for a while in my mod and finally solved it, and I figured I'd share the solution here: In c_baseplayer.cpp, go to the ShouldInterpolate() function, and add this at the bottom above BaseClass::ShouldInterpolate(): if ( GetLocalPlayer() GetLocalPlayer()-GetObserverTarget() == this ) return true; This will fix it. Hope this helps! Note: I didn't look too much into this, but the spectating of players is done via CalcView which doesn't appear to change what render-GetViewEntity() would return - the entity returned by this always interpolated, which would seem to be the intended way for this to work, but doesn't. Regards, Peter ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
Re: [hlcoders] Solution to laggy first-person spectating
Your fix is a hack, not a fix, let's get that right for a start. If you look at the code around it, you'll see that m_iv_angEyeAngles sets up interpolation on m_angEyeAngles, which is a networked copy of a player's eye angles which is sent to everyone but the local player. In C_HL2MPPlayer, the interpolated version is used in ::PreThink and ::EyeAngles also has an override. This makes eye angles in spectator interpolated (ie. smooth) and is Valve's way of implementing this. You probably derived from CBasePlayer or CBaseMultiplayerPlayer and didn't set this up, which again isn't an engine thing. On Sun, May 31, 2015 at 2:31 AM, Peter McKeown pmckeown2...@hotmail.com wrote: I'm not seeing how what you posted is relevant, the declaration of m_angEyeAngles is fine, but no interpolated variables are processed for a spectated player if ShouldInterpolate() returns false, which it does in some cases when spectating a player in first person. I haven't tracked down exactly why since this is a simple fix, most likely their viewmodels (which are visible, the spectator target is not rendered in first person) is chain requiring interpolation and that keeps m_angEyeAngles going. -- Date: Sun, 31 May 2015 02:25:52 +0100 From: st...@swires.me To: hlcoders@list.valvesoftware.com Subject: Re: [hlcoders] Solution to laggy first-person spectating It's not a bug with the code base and that isn't the proper way to fix it. This is how Valve's games handle it: https://github.com/ValveSoftware/source-sdk-2013/search?utf8=%E2%9C%93q=m_iv_angEyeAngles On Sun, May 31, 2015 at 2:21 AM, Peter McKeown pmckeown2...@hotmail.com wrote: Greetings everyone, There is a bug with the codebase where in some situations the first person spectating of other players can become very laggy, as interpolation for m_angEyeAngles stops. This bug is present in TF2's code as well as I've seen it there too. The issue is that the player's ShouldInterpolate() doesn't take into account if the local player is spectating this player or not, causing it to no longer have it's interpolated variables (like m_iv_angEyeAngles) processed. I've been hunting this bug for a while in my mod and finally solved it, and I figured I'd share the solution here: In c_baseplayer.cpp, go to the ShouldInterpolate() function, and add this at the bottom above BaseClass::ShouldInterpolate(): if ( GetLocalPlayer() GetLocalPlayer()-GetObserverTarget() == this ) return true; This will fix it. Hope this helps! Note: I didn't look too much into this, but the spectating of players is done via CalcView which doesn't appear to change what render-GetViewEntity() would return - the entity returned by this always interpolated, which would seem to be the intended way for this to work, but doesn't. Regards, Peter ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
Re: [hlcoders] Solution to laggy first-person spectating
It's not a bug with the code base and that isn't the proper way to fix it. This is how Valve's games handle it: https://github.com/ValveSoftware/source-sdk-2013/search?utf8=%E2%9C%93q=m_iv_angEyeAngles On Sun, May 31, 2015 at 2:21 AM, Peter McKeown pmckeown2...@hotmail.com wrote: Greetings everyone, There is a bug with the codebase where in some situations the first person spectating of other players can become very laggy, as interpolation for m_angEyeAngles stops. This bug is present in TF2's code as well as I've seen it there too. The issue is that the player's ShouldInterpolate() doesn't take into account if the local player is spectating this player or not, causing it to no longer have it's interpolated variables (like m_iv_angEyeAngles) processed. I've been hunting this bug for a while in my mod and finally solved it, and I figured I'd share the solution here: In c_baseplayer.cpp, go to the ShouldInterpolate() function, and add this at the bottom above BaseClass::ShouldInterpolate(): if ( GetLocalPlayer() GetLocalPlayer()-GetObserverTarget() == this ) return true; This will fix it. Hope this helps! Note: I didn't look too much into this, but the spectating of players is done via CalcView which doesn't appear to change what render-GetViewEntity() would return - the entity returned by this always interpolated, which would seem to be the intended way for this to work, but doesn't. Regards, Peter ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
Re: [hlcoders] Solution to laggy first-person spectating
I'm not seeing how what you posted is relevant, the declaration of m_angEyeAngles is fine, but no interpolated variables are processed for a spectated player if ShouldInterpolate() returns false, which it does in some cases when spectating a player in first person. I haven't tracked down exactly why since this is a simple fix, most likely their viewmodels (which are visible, the spectator target is not rendered in first person) is chain requiring interpolation and that keeps m_angEyeAngles going. Date: Sun, 31 May 2015 02:25:52 +0100 From: st...@swires.me To: hlcoders@list.valvesoftware.com Subject: Re: [hlcoders] Solution to laggy first-person spectating It's not a bug with the code base and that isn't the proper way to fix it. This is how Valve's games handle it: https://github.com/ValveSoftware/source-sdk-2013/search?utf8=%E2%9C%93q=m_iv_angEyeAngles On Sun, May 31, 2015 at 2:21 AM, Peter McKeown pmckeown2...@hotmail.com wrote: Greetings everyone, There is a bug with the codebase where in some situations the first person spectating of other players can become very laggy, as interpolation for m_angEyeAngles stops. This bug is present in TF2's code as well as I've seen it there too. The issue is that the player's ShouldInterpolate() doesn't take into account if the local player is spectating this player or not, causing it to no longer have it's interpolated variables (like m_iv_angEyeAngles) processed. I've been hunting this bug for a while in my mod and finally solved it, and I figured I'd share the solution here: In c_baseplayer.cpp, go to the ShouldInterpolate() function, and add this at the bottom above BaseClass::ShouldInterpolate(): if ( GetLocalPlayer() GetLocalPlayer()-GetObserverTarget() == this ) return true; This will fix it. Hope this helps! Note: I didn't look too much into this, but the spectating of players is done via CalcView which doesn't appear to change what render-GetViewEntity() would return - the entity returned by this always interpolated, which would seem to be the intended way for this to work, but doesn't. Regards, Peter ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
Re: [hlcoders] Solution to laggy first-person spectating
Apologies for the double post, encountered an error in Outlook. From: pmckeown2...@hotmail.com To: hlcoders@list.valvesoftware.com Date: Sun, 31 May 2015 02:27:42 +0100 Subject: [hlcoders] Solution to laggy first-person spectating Greetings everyone, There is an intermittent bug with the codebase where in some situations the first person spectating of other players can become very laggy, as interpolation for m_angEyeAngles stops. This problem is most easily found when the spectator target's viewmodel is hidden and thus isn't requiring interpolation (meaning there is no reason to interpolate the parent player either). This bug is present in TF2's code as well as I've seen it there too. The issue is that the player's ShouldInterpolate() doesn't take into account if the local player is spectating this player or not, causing it to no longer have it's interpolated variables (like m_iv_angEyeAngles) processed. I've been hunting this bug for a while in my mod and finally solved it, and I figured I'd share the solution here: In c_baseplayer.cpp, go to the ShouldInterpolate() function, and add this at the bottom above BaseClass::ShouldInterpolate(): if ( GetLocalPlayer() GetLocalPlayer()-GetObserverTarget() == this ) return true; This will fix it. Hope this helps! Note: I didn't look too much into this, but the spectating of players is done via CalcView which doesn't appear to change what render-GetViewEntity() returns - the entity returned by this always interpolated, which would seem to be the intended way for this to work, but doesn't in practice. Regards, Peter ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders