Why your bites miss and other collision weirdness
philogl
Join Date: 2012-10-24 Member: 163529Members, Squad Five Blue, Reinforced - Silver, WC 2013 - Silver
Putting game balance and everything else aside, at its most basic level, NS2 is a game where dogs bite guys. When the dog has to struggle to bite the guy it can make for some pretty frustrating game play. There are many elements that make this simple game play element frustrating, but I believe at the heart of it all is a fundamentally broken collision system. I've been meaning to make a thread on this for a while and what you see in this video is by no means an exhaustive list of everything wrong with collision, merely a collection of a few of the more weird and irritating ones that will occur in a regular game.
Also this is still possible.
Also this is still possible.
Comments
Getting a free 10 foot skulk bite after landing an initial blow or touching a marine is about as bad though since now the opposite happens
(Marine has no prayer of getting out of bite range)
It doesn't happen too often, but when it does happen it's immediately gamebreaking even if it's just for one death during a match
Edits: I haven't seen skybox jumping since the original Counter Strike. . . that's pretty amusing though that it's still in modern games
Holding ctrl makes skulk drop from walls/marines if you really have to spam jump+attack on em.
It would be nice that they explained the mechanics so that people wouldn't think that they are bugs.
That sticky collision is indeed suspect.
Gj and thanks!
Player-player collision in general is unfortunately impossible to solve perfectly; if you want perfect collisions you will have to drop instant response to your input.
Imagine the following situation:
Two players, each with 75ms lag to the server. Both are standing still facing each other at a range of 10m Player A moves at 10m/sec when he moves, while player B will move at 5m/sec.
Player C is standing still and watching (also with 75ms lag).
At time zero in the "real world", player A starts moving at 10m/s. However, it will take 250ms (2x75ms + 100ms interp buffer) before player A starts moving on B or C screens.
Assuming that B has about 250ms reaction time, and assume that he starts running forward as soon as he can react to A moving, this means that at time 0.5 sec, he starts moving forward.
Lets have a look at the situation at time 0.75.
- Player C sees player A as having started to move at t=0.25 sec, and so has moved 5m. Player B has not moved yet (as the movement that B started at 0.5 sec has not yet reached him).
- A has moved at 10m/sec the whole time, and so has moved 7.5m and is 2.5m from B, which has not moved - to A, at least.
- B has moved at 5m/sec for 0.25 sec or 1.25m, while to B, A has moved at 10m/sec for 0.5 sec. Distance between them is 10 - 5 - 1.25 = 3.75m
The only thing everyone agrees on is that C hasn't moved.
For player A, the collision against player B will happen at t=0.9666 sec (2.5m left at t=0.75 when B starts moving at 5m/s, so closing speed 15m/s gives 0.16 sec more), at position 9.6m (from A's starting position)
For player B, the collision will happen at t=1.0 (3.75m left at t=0.75, 15m/sec closing speed gives 0.25sec more), and at position 7.5m.
For player C, the collision will happen at t=1.08 (5m left at t=0.75, 15m/sec closing -> 0.333 sec) and will happen at 8.3m .
So we have three players, none of which agrees with anyone else WHEN or even WHERE player A and B collided.
Oh, and the server has a fourth idea about what happened (ct=0.83 at 8.3m from A starting pos - notice, the same position as C, but 0.25sec earlier).
Reconciling this isn't really possible in NS2... theoretically, if the maximum discrepancy is smaller than half a collision body radius, you will not have GLARING discrepancies such as entities moving through each other, but that would limit you to about 0.25m in discrepancy (assuming standing marines have a body 0.5m in diameter), which at 250ms delay would mean a max speed of about 1m/sec.
Marines sprint at 6m/sec and skulks hit 12-14m/sec ...
TL;DR - it's the latency. Blame Einstein.
Enough silly excuses already. Get back to work and make it happen.
It will take more than just one mere man to raise the average IQ around here! Especially with plebs like myself! *Evil laughter and hand wringing*
@Matso
My brain exploded. Thanks-a-lot.
However, excuse me if i'm being ignorant, but what it doesn't seem to explain are the problems you see in the first video. The very first example where it's a 'one way' collision interaction, as the skulk is not causing any collision consequence for the marine running away (because it is approaching from behind). You'll notice the skulk actually micro jittering back and forth off the marine as if it's being corrected, and then totally bouncing off/slowing down. Doesn't this suggest that collision prediction is actually not working smoothly or reliably enough?
Good point, I was actually just talking about the general collision issue.
That PARTICULAR issue ... is just a consequence of the simple algorithms used for the movement code.
So, when the client moves your avatar in the game world, it first places all other entities at the correct position for the time when you START your move. When it comes to other players, it interpolates between the network updates wrapping the time.
But once they are placed there, the player navigates for about 30ms (one moves duration, about) in a world that are fixed and solid. So everything else is fixed, and only the player collision body is moved.
So if you are running behind someone that are moving just slightly slower than you, you will sooner or later collide with him. Player collision bodies are cylinders (or spheres for skulks) and there is a bit of sliding allowed... but if you are running right up into his but, you will pretty much stop dead, loose all speed and all momentum, and will have to accelerate again from pretty much a stand still.
While it _could_ be fixed (basically, if you collide with a player, you could check the speed of the collided-with player and possibly soften the collision a bit) the resulting code could get a bit hairy. But there is a lot of hairy people at UWE, so they might do something about it.
I'll log it in mantis as a bona fide bug.
First, fantastic thread by philogl! Rather then just a complaint, there is a detailed video, just true awesomeness.
As to the above quote from Matso, yeah, I would think that the colliding player from behind (Player would have their speed reduced to the speed of the player running away (player A). Perhaps a slight penalty, but going to 0 is a bit silly.
Also the ability to climb marines is a bit odd. Couldn't it be limited to the same lifeforms, therefore an alien could "sky climb" an alien, but not a marine?
But climbing marines is useful i think if you're dropping on his head to bite him and not sliding off but maybe the climbing is the cause of the speed becoming 0 as some sort of wallfriction.
I don't think players are cylinders. The feel like capsules or prolate spheroids. If they were cylinders, jumping ontop of objects would be more consistent and standing on a fence without sliding off would be trival.
This is a known issue that occurs in many games. It even occurs with non-player objects, like elevators and trains.
Soft collisions is a tried and true solution.Obviously higher tick rates, lower interp, lower latency in general help, but that's hard to achieve.
You might be able to store the speed of objects (assuming constant speed during the player movement) and resolve collisions a little more intelligently so that you're not slowed down to a stand still running into the butt of a slightly slower player, but I think soft collisions seem easier to make robust and free of nasty corner cases.