One of the big problems in TF2 right now is “facestabbing” where a spy will seemingly be in front of you, or even running right at you, but miraculously land a backstab one hit kill on you.
A thread posted in the Steam forums has a brief explanation as to why this can happen:
The backstab problem is due to the time delay between when you fire and when the hit lands, and the discrepancy between whether it should be a backstab at the start and/or the end. If we make the start case authoritive, players get facestabbed if they turn around before the hit lands. If we make the end case authoritive, Spies claim they got screwed when they got a backstab animation and no instant kill. Right now we have a system somewhere in the middle, where we allow the Spy to keep the backstab as long as the receiver doesn’t turn to look almost directly at the Spy. This is something we’re still hoping to improve.
Latency and multiple client synchronization is an ever-present problem in online gaming. The server has to decide how to synchronize the data coming in with all the clients it is hosting. A soldier with 200 ping may see a spy in front of him when the spy is actually beside him, resulting in an apparent facestab due to the server accepting the spy’s data instead of the soldier’s.
Melee in general in TF2 is problematic. I’m sure most people have had an experience with being meleed seemingly from 10 feet away due to lag. On your opponent’s screen, they’re right next to you, but on yours they’re 10 feet away. The server accepts their data and says you are being hit, and you’re busy trying to figure out what is going on while avoiding death.
There’s no real good solution here with the spy since everyone is going to have latency when playing over the internet. Even if you’re lucky enough to have very low ping, your enemies may have somewhat higher ping. And while 50ms doesn’t sound like much, in terms of melee movement and directional-facing detection, it can mean the difference between a facestab and a harmless melee attack.
Personally I feel right now the facestab detection is horrible. Backstabs land in a 180 degree arc behind the player on level ground and from the bottom and top of the player. To avoid a backstab you essentially have to face where you think the spy is going to be when the stab actually lands, which is practically impossible. Plus adding luck into a skill based game is sort of annoying, although for whatever reason a certain level of randomness is included in most games in terms of damage ranges, but when a weapon is an instant kill, the stakes are somewhat higher.