{"id":278,"date":"2010-03-09T22:57:21","date_gmt":"2010-03-10T06:57:21","guid":{"rendered":"http:\/\/technofovea.com\/blog\/?p=278"},"modified":"2016-03-16T22:58:02","modified_gmt":"2016-03-17T05:58:02","slug":"tf2-backstab-mechanics","status":"publish","type":"post","link":"http:\/\/technofovea.com\/blog\/archives\/278","title":{"rendered":"TF2 Backstab mechanics"},"content":{"rendered":"<p>I&#8217;ve been writing in certain forums for a while about the workings of TF2&#8217;s &#8220;backstab&#8221; attack. Since there seems to be a lot of confusion and rage over this instant-kill-from-behind gameplay mechanic, I&#8217;ve decided to collect some of my findings here so I don&#8217;t need to re-type them often. \u00c2\u00a0First I&#8217;ll explain some basic concepts, and then show some diagrams to see how they add up to describing the backstab behavior.<!--more--><\/p>\n<h2>Player collision hulls<\/h2>\n<p>How does TF2 decide when you bump into an enemy player? The hulls. These boxes (one per player) are also used to determine if you get hit by a projectile weapon, such as a rocket, grenade, or <a href=\"http:\/\/www.youtube.com\/watch?v=hx-YFFnruDs\">huntsman arrow<\/a>. The collision hull is the big red box in these shots. (Ignore the blue box and white lines on the sides.) The player collision hull is the same size for all players! As far as TF2 is concerned, a Scout takes up just as much floor space as a Heavy.<\/p>\n<div id=\"attachment_285\" style=\"width: 310px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/technofovea.com\/blog\/wp-content\/uploads\/2010\/03\/hulls.png\"><img aria-describedby=\"caption-attachment-285\" loading=\"lazy\" class=\"size-medium wp-image-285\" title=\"Player collision hulls\" src=\"http:\/\/technofovea.com\/blog\/wp-content\/uploads\/2010\/03\/hulls-300x176.png\" alt=\"\" width=\"300\" height=\"176\" srcset=\"http:\/\/technofovea.com\/blog\/wp-content\/uploads\/2010\/03\/hulls-300x176.png 300w, http:\/\/technofovea.com\/blog\/wp-content\/uploads\/2010\/03\/hulls.png 845w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-285\" class=\"wp-caption-text\">The collision hull (red) and hitboxes (multicolored) for a Heavy.<\/p><\/div>\n<p>For performance reasons, collision hulls don&#8217;t &#8220;turn&#8221;. They always face the same direction. This is a good thing: It would be really annoying if you had to turn your view to the side in order to get through certain doorways. However, it has implications for melee attacks as we&#8217;ll see later.<\/p>\n<h2>Melee means invisible bullets hitting hulls<\/h2>\n<p>TF2&#8217;s melee attacks appear to be implemented as a single powerful <em>bullet<\/em> that disappears after it travels a very short distance.  Normally, when you think of &#8220;bullets&#8221;, you think of the hitboxes used for most bullet-based attacks. \u00c2\u00a0But there&#8217;s also another form of hitbox being used&#8230; Yes, the player hull we just saw! \u00c2\u00a0Although they&#8217;re treated like a bullet, melee attacks use the player hull to determine if they hit an enemy. Why? Because if they didn&#8217;t you&#8217;d have ridiculously harder time hitting anybody at close range.<\/p>\n<h2>The spy&#8217;s knife has no firing delay<\/h2>\n<p>The Spy&#8217;s knife is different from other melee weapons in a few ways.<\/p>\n<ol>\n<li>It can trigger backstabs. \u00c2\u00a0(Of course.)<\/li>\n<li>It usually does less damage.<\/li>\n<li>It cannot randomly crit to do extra damage.<\/li>\n<li><strong>It shoots instantly without a windup time<\/strong><\/li>\n<\/ol>\n<p>The last one is important to know. The instant you click, the knife&#8217;s &#8220;melee bullet&#8221; fires out. With other weapons, there&#8217;s a delay and midway through the animation the &#8220;bullet&#8221; fires. It used to be different in earlier versions of TF2, and there are some good reasons that it changed which I won&#8217;t go into here. \u00c2\u00a0(For historians, my notes say that the pre-patch knife either had a 1\/8th or a 1\/4th second delay, depending on the animation.)<\/p>\n<h2>The backstab angle is based on victim&#8217;s aiming<\/h2>\n<p>The angle for a backstab is 180\u00c2\u00b0, and it&#8217;s based on where the spy is standing relative to where the victim is looking. And I do mean <strong>looking<\/strong>. The angle calculation has nothing to do with the player model, and everything to do with where the victim&#8217;s crosshairs are pointing at the moment the spy attacks. In this next picture, I show you a Demoman who is about to be backstabbed.<\/p>\n<div id=\"attachment_279\" style=\"width: 310px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/technofovea.com\/blog\/wp-content\/uploads\/2010\/03\/stance.png\"><img aria-describedby=\"caption-attachment-279\" loading=\"lazy\" class=\"size-medium wp-image-279\" title=\"Backstab stance\" src=\"http:\/\/technofovea.com\/blog\/wp-content\/uploads\/2010\/03\/stance-300x201.png\" alt=\"\" width=\"300\" height=\"201\" srcset=\"http:\/\/technofovea.com\/blog\/wp-content\/uploads\/2010\/03\/stance-300x201.png 300w, http:\/\/technofovea.com\/blog\/wp-content\/uploads\/2010\/03\/stance.png 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-279\" class=\"wp-caption-text\">This is a marginal backstab. The demoman is actually facing slightly away from the Spy, as evidenced by the direction of his weapon and head.<\/p><\/div>\n<p>As you can see, the victim&#8217;s head and his weapon are what you must look at to know where they are aiming. Pay no attention at all to the feet and shoulders! That demoman is looking slightly away from you and can be be backstabbed with a single mouse click. (If he turns just a tiny bit to his right, he&#8217;ll be safe.)<\/p>\n<h2>Lag compensation leads to &#8220;false facestabs&#8221;<\/h2>\n<p>In simplistic terms, a lag-compensated weapon (in TF2, anything that shoots bullets) is one which hits and does damage based on what the attacker sees, even if the attacker has high ping. If you are looking away from the spy the moment he clicks to attack on <strong>his<\/strong> screen, \u00c2\u00a0he&#8217;ll get a backstab and you will die. If you happen turn around <em>before<\/em> his message gets to the server&#8211;and the server&#8217;s &#8220;You&#8217;re Dead&#8221; message gets to you&#8211;you will <strong>appear<\/strong> to be face-stabbed. This is similar to how people can complain about being &#8220;shot even though I had already run behind the wall&#8221; from some bullet weapons. On the Spy&#8217;s screen, it&#8217;s a perfectly legitimate kill.<\/p>\n<div class=\"editbox\">\n<p><strong>EDIT:<\/strong><\/p>\n<ul>\n<li>There are still &#8220;true&#8221; facestabs, which are a genuine bug rather than a subjective difference between players. I may make a followup post at some point on them if I can get a theory or two to pan out, but it seems most of the time it involves the Spy running at the victim and the victim backpedaling.<\/li>\n<li>Perhaps the best source for detailed information on lag-compensation and the game&#8217;s networking model is found in the <a href=\"http:\/\/developer.valvesoftware.com\/wiki\/Latency_Compensating_Methods_in_Client\/Server_In-game_Protocol_Design_and_Optimization\">VDC Wiki<\/a>.<\/li>\n<\/ul>\n<\/div>\n<h2>How hulls and stabs come together<\/h2>\n<p>Map directions make a difference in melee attacks. Attacks will appear to &#8220;go farther&#8221; if you and your opponent are standing along certain directions. This top-down diagram shows why:<\/p>\n<div id=\"attachment_290\" style=\"width: 310px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/technofovea.com\/blog\/wp-content\/uploads\/2010\/03\/aligned.png\"><img aria-describedby=\"caption-attachment-290\" loading=\"lazy\" class=\"size-medium wp-image-290\" title=\"Axis-aligned collision hulls\" src=\"http:\/\/technofovea.com\/blog\/wp-content\/uploads\/2010\/03\/aligned-300x190.png\" alt=\"\" width=\"300\" height=\"190\" srcset=\"http:\/\/technofovea.com\/blog\/wp-content\/uploads\/2010\/03\/aligned-300x190.png 300w, http:\/\/technofovea.com\/blog\/wp-content\/uploads\/2010\/03\/aligned.png 671w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-290\" class=\"wp-caption-text\">Melee attacks appear to go farther on diagonals<\/p><\/div>\n<p>In both cases, the attacker and victim are the <strong>same<\/strong> straight-line distance from each other, but on a diagonal their melee attacks will appear to go farther because parts of their collision hulls are closer. Also, in the second example, they are actually bumping into each other.  This is presented only to illustrate how things work: The overall effect is slight enough that I wouldn&#8217;t bother worrying about it while playing the game.<\/p>\n<h2>The 180\u00c2\u00b0 angle with example stab<\/h2>\n<p>Now that you understand how melee attacks work, let&#8217;s revisit the backstab&#8217;s 180\u00c2\u00b0 angle limitation. This angle is calculated based on:<\/p>\n<ol>\n<li>Where the victim is looking<\/li>\n<li>Where the victim is standing<\/li>\n<li>Where the spy is standing<\/li>\n<\/ol>\n<p>What&#8217;s missing is this: It doesn&#8217;t matter where the Spy is aiming&#8230; as long as his melee-bullet hits the enemy hull.<\/p>\n<div id=\"attachment_292\" style=\"width: 310px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/technofovea.com\/blog\/wp-content\/uploads\/2010\/03\/weirdstab.png\"><img aria-describedby=\"caption-attachment-292\" loading=\"lazy\" class=\"size-medium wp-image-292\" title=\"A weird but successful backstab\" src=\"http:\/\/technofovea.com\/blog\/wp-content\/uploads\/2010\/03\/weirdstab-300x161.png\" alt=\"\" width=\"300\" height=\"161\" srcset=\"http:\/\/technofovea.com\/blog\/wp-content\/uploads\/2010\/03\/weirdstab-300x161.png 300w, http:\/\/technofovea.com\/blog\/wp-content\/uploads\/2010\/03\/weirdstab.png 460w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-292\" class=\"wp-caption-text\">In this successful backstab, the Spy is actually looking a little bit &quot;away&quot; from his victim.<\/p><\/div>\n<p>In this example, the Spy is &#8220;behind&#8221; is victim (as shown by the orange arrows) but his stab (purple arrow) still hits the victim&#8217;s collision hull and counts as a hit. In fact, no matter which way the spy turns, as long as that purple arrow touches the orange hull he&#8217;ll succeed.<\/p>\n<div class=\"editbox\">\n<p><strong>EDIT:<\/strong> .<\/p>\n<ul>\n<li>The same applies to stabbing from above or below an opponent. Vertical distance doesn&#8217;t matter, as long as your melee strike hits them. So standing on their head can work as long as you are also are ever-so-slightly-behind them.<\/li>\n<li>All bullet weapons in TF2 fire from the eyeballs of the attacker. Along the crosshair&#8217;s path. So if the enemy is below you, crouching can sometimes help if it brings your head downwards. (Insert obligatory joke about the Demoman shooting only a single fireball from his eye, while cursing the superiority of William Wallace.)<\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been writing in certain forums for a while about the workings of TF2&#8217;s &#8220;backstab&#8221; attack. Since there seems to be a lot of confusion and rage over this instant-kill-from-behind gameplay mechanic, I&#8217;ve decided to collect some of my findings here so I don&#8217;t need to re-type them often. \u00c2\u00a0First I&#8217;ll explain some basic concepts, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[15,16,11],"_links":{"self":[{"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/posts\/278"}],"collection":[{"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/comments?post=278"}],"version-history":[{"count":19,"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/posts\/278\/revisions"}],"predecessor-version":[{"id":318,"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/posts\/278\/revisions\/318"}],"wp:attachment":[{"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/media?parent=278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/categories?post=278"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/tags?post=278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}