Jump to content
MrDongles

Any help fixing my TF2 stuttering?

Recommended Posts

Lerp is a mathematical term that is short for (linear) interpolation. Interpolation in a nutshell just means blending between two things.  The explanations given in those links are a lot of speculation by ill-informed gamers trying to explain it in terms of how they've experienced it.  One tries to explain it as a form of lag compensation, another explains it as a level of accuracy, and yet another calls it an intentional delay added to the game.  None of these are exactly right, but they do describe problems lerping is used to solve.

 

This is a more accurate description of what interpolation is, and the "interpolation period" is what is meant by the "delay" described in the previous links.  Your lerp settings can modify the lerp period, which is probably why gamers start using the terms interchangeably.

https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking

 

In physics, when you have a start position, end position, and a rate of speed, you use how much time has elapsed to interpolate between the two points to see where between them you are.  When you're standing still but rotate to a different orientation, you are spherically interpolating, which is referred to as slerp.  When you have an animation, an animation has a start and end keyframe, and you interpolate between them as time passes to step through the frames between them.  When rendering, you use a combination of the current interpolated physical position and the current interpolated running animation to produce a final image of where a character model is and what stage of its animation it's in.  With client-server networking models, the game server sends snapshots of the world to all connected clients.  Because latency is always going to be there, rather than display the most updated game world, your client will instead interpolate between its last state and the newest state received from the server.  In order to reduce the amount of data that needs to go across the network, games also use something called delta compression, which is where the game server, instead of sending full snapshots of the current state of the game world, will send only the parts of it that changed since the last snapshot was sent.  Meanwhile, your client-side prediction guesses what the game world state will be based on what's currently happening.  Your renderer interpolates between the previous game world state and the updated state.  All of this is done to make your game visually appear to be running smoothly at the cost of not being precise.  If you fall too far out of sync, your game will skip ahead to the most recent state, which would visually manifest as a stutter or rubber banding.  This is probably what you're seeing.

 

Because all these things can result in a rendered game state that is not precise, where you see everything is not where it really is.  Like this, you would think you're hitting enemies but always miss.  Lag compensation is what's done to handle this problem.  It's a different and completely server-side mechanism that exists so that if you shoot at something in a location where your client thinks it is, your shot hits, even if that's not where it is on that player's screen.  The server essentially rewinds the game, going back in time to process player commands.  This can make it seem like bullets travel around corners to hit you, because your client-side prediction was ahead and showed you ducking behind the corner, but the server's lag compensation favors the attacker (on the shooter's screen, you haven't hidden around the corner yet).  This is also how face-stabbing occurs, since back-pedaling from a spy while he's butter-knifing you can cause the server to incorrectly interpret his position as so close to you that he'd be inside you or behind you, which can cause his knife to hit your back, since TF2 just uses basic aabb (axis-aligned bounding box) collision detection and does not do a halfspace test to see if it's even possible for the spy to backstab you at the current angle.  Without a combination of the prediction, interpolation, and lag compensation, multiplayer games like this would be too laggy to be playable.  Hopefully that makes it more clear.  If you're falling out of sync and stuttering, your network throughput could be too slow to keep up with the number of snapshots you're receiving, or your graphics card could not be able to keep up with the rendering tasks, or your processor could be too slow to keep up with the interpolation of everything else, or your lerp period could be set to a very long time, and modifying the interpolation settings can help (make sure your cl_interp is set to 0).  Glad you found something that works!   :D

  • Upvote 1

Share this post


Link to post
Share on other sites

OK. It seems that the new network I am on now does not have any problems running TF2. So the network at my old apartment was the issue. So far I have not had any noticeable stutters or lag spikes. Thanks again for all the help. It seems my problems have been solved for now.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...