Rapid fire hit registration
Skie
Skulk Progenitor Join Date: 2003-10-18 Member: 21766Members, NS2 Playtester, Reinforced - Shadow
<div class="IPBDescription">I feel like it's not working right</div>The topic title says most of everything.
I feel like that some rifle shots just disappear into a network void because I can't ever, ever remember killing a skulk with under 20 rounds from the rifle, even if the damned thing is running straight at me. Even with weapons 0 it should only take 10 bullets to kill a skulk. That means you should be able to kill 5 skulks with one clip. Impossible. Same thing with fades and gorges, can you ever remember killing either with just 30 rifle rounds? That's how many it takes with a level 0 rifle.
Also since the pistol's faster firing more has unlimited firing speed while you're jumping (possibly a bug, reported already in case it is), you can fire even faster than with the rifle with a script or if you bind firing to mousewheel (which is doable if you have any recent mouse with binding software). So I did that and tried to kill things with it. Skulks die 'sometimes' when I pump them with 10 pistol shots' worth lead, but not always. So this makes me extra suspicious.
I tried to modify the GUICrosshair.lua to give me a running count of how many bullets I've hit with the rifle to an enemy target, but the way deltaTimes, server lag and the function calls work, it's a very poor base for an exact system that reports one hit per one shot. I got it working 'somewhat', so that for every 50 rounds fired, on a relatively non-laggy server it reports about 40 hits. But that's still way kinda bad. Maybe the devs should do some testing of this kind?
The most annoying thing is that if you run a server on your own, you can see all the rifle shots register neatly against buildings and aliens that have been spawned with the "give <alien>" cheat. But maybe this is the reason that such a thing has gone unnoticed. If you spawn a heap of bots, the server starts getting choppy, but still everything registers nicely.
So there's some arguments already there against my claim, but also some for it. I feel like with 15 years of FPS experience I should be able to hit a skulk with 10 rifle rounds even occassionally, when it's running in a straight line, or towards me.
Thoughts?
I feel like that some rifle shots just disappear into a network void because I can't ever, ever remember killing a skulk with under 20 rounds from the rifle, even if the damned thing is running straight at me. Even with weapons 0 it should only take 10 bullets to kill a skulk. That means you should be able to kill 5 skulks with one clip. Impossible. Same thing with fades and gorges, can you ever remember killing either with just 30 rifle rounds? That's how many it takes with a level 0 rifle.
Also since the pistol's faster firing more has unlimited firing speed while you're jumping (possibly a bug, reported already in case it is), you can fire even faster than with the rifle with a script or if you bind firing to mousewheel (which is doable if you have any recent mouse with binding software). So I did that and tried to kill things with it. Skulks die 'sometimes' when I pump them with 10 pistol shots' worth lead, but not always. So this makes me extra suspicious.
I tried to modify the GUICrosshair.lua to give me a running count of how many bullets I've hit with the rifle to an enemy target, but the way deltaTimes, server lag and the function calls work, it's a very poor base for an exact system that reports one hit per one shot. I got it working 'somewhat', so that for every 50 rounds fired, on a relatively non-laggy server it reports about 40 hits. But that's still way kinda bad. Maybe the devs should do some testing of this kind?
The most annoying thing is that if you run a server on your own, you can see all the rifle shots register neatly against buildings and aliens that have been spawned with the "give <alien>" cheat. But maybe this is the reason that such a thing has gone unnoticed. If you spawn a heap of bots, the server starts getting choppy, but still everything registers nicely.
So there's some arguments already there against my claim, but also some for it. I feel like with 15 years of FPS experience I should be able to hit a skulk with 10 rifle rounds even occassionally, when it's running in a straight line, or towards me.
Thoughts?
Comments
Are you sure GUICrosshair is the right place to set up a counter? If I'm not mistaken, it only checks once per client tick (frame) whether the damage indicator should be displayed. It does not, however, count the number of hits that occur in each frame.
Could you show your modified code?
Could you show your modified code?<!--QuoteEnd--></div><!--QuoteEEnd-->
I already did away with the code. I tried several different implementations and none of them worked well enough. It WAS a bad place for the code though, since indeed it was quite very random when it would give the 'true' when hitting a target. And it would trigger true several times per shot and you had to filter out only one 'hit' from all those deltaTime ticks. It was difficult because the second hit from the next rifle shot came very quickly as well.
I've never written a single line of lua before yesterday so I'm sure it was bad in all kinds of ways, but I didn't know any other way to get the information about hitting a target from the client-side files. Just a quick dirty hack attempt.
By that i mean, get 2 people then try shooting a non moving skulk, then a moving one etc.
By that i mean, get 2 people then try shooting a non moving skulk, then a moving one etc.<!--QuoteEnd--></div><!--QuoteEEnd-->
It might be just an interpolation issue. Too much of interpolation is bad if the ping is low. On higher ping servers it should be increased. That's what I learned from Source engine anyways.
If someone would make a lua snippet that counts hits on enemies, that would help a lot I think. I tried but I'm not good at languages I've never written, and the NS2 codebase is a bit overwhelming.
I've had problems with the shotgun as well, sometimes the pellets landing to an invisible body where the skulk was some time ago and killing him. And shooting a fade close-up is a constant nuisance, when all the pellets DEFINITELY should hit, only one or two hits. Crosshair exactly on the fade quite close up, four shots and it doesn't down him.
If someone would make a lua snippet that counts hits on enemies, that would help a lot I think. I tried but I'm not good at languages I've never written, and the NS2 codebase is a bit overwhelming.
I've had problems with the shotgun as well, sometimes the pellets landing to an invisible body where the skulk was some time ago and killing him. And shooting a fade close-up is a constant nuisance, when all the pellets DEFINITELY should hit, only one or two hits. Crosshair exactly on the fade quite close up, four shots and it doesn't down him.<!--QuoteEnd--></div><!--QuoteEEnd-->
I have had it a few times where I would be completely around a corner and half way down the hall and somehow the last bullet would kill me like 1.5 secs after it should have
seems weird sometimes
If that is the case I also guess that the problem lies in the "lag compensation" and not the interpolation. Check it out here <a href="https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking#Lag_compensation" target="_blank">https://developer.valvesoftware.com/wiki/So...ag_compensation</a>
I don't think that's correct. I see a lot of people spreading false information about interp and different source net settings.
AFAIK, the interp smooths out the time between each packet. If you had 0 interp then it could sometimes appear as if the other players were jerking/skipping as it would only be updating 30 times a second. Interp basically delays what you see on screen by a set amount of time but then smooths out the changes between each packet. The problem is that then you aren't seeing exactly what the state of the server is, you are seeing back in time effectively. To compensate for this the game has lag compensation which is supposed to take your interp time and then rewind the server to check if you hit a target or not. The problem is that lag compensation isn't 100% accurate, so the higher the interp the more chance of errors and poor registration.
The default setting for interp in source games is: 1000/tickrate x 2. As there is 1000 milliseconds in a second, it's the time that it takes between updates x 2. They times it by 2 to make sure if one packet is dropped the client still has an available packet to use to smooth between. That would mean that for 30 tickrate the interp would be 66.6ms
My experience with it is actually the less interp the better hitreg. Even if you sometimes see other players warping, it's better to have that and be able to hit them than to have what appears to be nice smooth movement but shots not registering. For me 33.3ms or 0ms would be preferred but I'd really need to play with them to see. Hopefully they will allow users to change this setting manually once 1.0 is released.
It doesn't matter if your ping is 10 or 150. You are still getting 30 packets a second, so your interpolation should be the same.
Also, unless they have changed it since, the current setting in NS2 is 150ms. I think they increased it so much because the server performance was poor and constantly dropping to 20 and lower tickrates.
I added a simple counter after self:ApplyBulletGameplayEffects(player, trace.entity, trace.endPoint, direction)
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> numberOfHit = numberOfHit + 1
Print(ToString(numberOfHit))<!--c2--></div><!--ec2-->
NumberOfHit was declared at the beginning of the file: local numberOfHit = 0
Firing a single bullet at a powernode :
<img src="http://i.imgur.com/W2oXD.png" border="0" class="linked-image" />
The server count the hit correctly but for some reason the client execute the code many times, anybody knows why ?
Locally it seems to work fine, If I empty my rifle the server counter goes up by 50. Should be tested online, but I have to work also :(
I can't speak for the Source engine, but this is not true for Spark. The exact same interpolation that occurs on your client will happen on the server during lag compensation (based on exactly the same data that was sent to the client). It's always possible there are bugs, but there's nothing in design of the network system that should allow for hit registration errors.
I don't understand why Source works this way, but the situation depicted in this image shouldn't happen in Spark.
<img src="http://developer.valvesoftware.com/w/images/c/ca/Lag_compensation.jpg" border="0" class="linked-image" />
Those lines that say Client* happened during client side prediction. You don't want to count those. Do something like this:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->if not Shared.GetIsRunningPrediction()
count= count + 1
end<!--c2--></div><!--ec2-->
I don't understand why Source works this way, but the situation depicted in this image shouldn't happen in Spark.<!--QuoteEnd--></div><!--QuoteEEnd-->
I'm just speaking from experience of playing source games. I know that when you have high interpolation values then there is a tendency for hits not to register. I assume that's because lag compensation isn't 100% perfect, but it could be for some other reason.
Perhaps the rifle needs a little more spread to make it more effective at killing skulks. It should be pretty easy to kill 3 skulks with 1 clip and yet it's a very rare occurrence at the moment.
Nah, that would make it awful against things that lurk in the clorfs.
On another note I notice a lot of choke in NS2 when a lot is going on, not sure if that may also be causing issues.
What about loss and choke? If packets were lost while being sent to the client then would the lag compensation come "out of sync" with the server, causing hits not to register?
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->if not Shared.GetIsRunningPrediction()
count= count + 1
end<!--c2--></div><!--ec2--><!--QuoteEnd--></div><!--QuoteEEnd-->
Thanks for the answer. Probably I'm not understanding prediction but why would you predict that I shoot 8 times when I shoot only once, I mean the client knows I released the mouse button, and should stop to do all theses collision traces, no ?
For the lag compensation, can someone give me a clear answer, where do I need to shoot in order to hit ? In front, exactly on the target, or behind, above ? I'm confused.
His ping was constantly 999 and his hits would occur such that if you rounded a corner, saw him, and instantly ran back around the corner, a few seconds later you would receive a stream of hits over a prolonged period as if you had just stood there for 2-3 seconds instead of running away.
I understand that the interpolation is the same on the client but doesnt this mean the laggier you are, the less your targets are able to react to your 'moves'? Or have i confused something..
I'm generally not 'that' bad.. I do suffer from a lack of skill .. but down a long corridor.. I'd love to think I could hit something running straight at me :/
(miss a previous-weapon key too :P but that's for another thread :P )
Really? So it should be easy for all marines to go 3:1 with a single magazine and the aliens actually have a fighting chance? That sir is farfetched.
Back on topic:
In 195, skulk bites don't seem to be registering like they were in 194. Maybe it's just me or maybe I'm attacking some really slippery marines.
I disabled the all function during prediction and played a game, it seems to work fine and it's like ten times less code to run. Maybe there is some problem when ping get's high, I don't know.
On a local server, open the console, type
cheats 1
trace b
Close console
Fire.
Invite a friend for target practice. Green lines miss, red lines hit.
Have fun.
Oh, and trace m turns on melee tracing.
On a local server, open the console, type
cheats 1
trace b
Close console<!--QuoteEnd--></div><!--QuoteEEnd-->
Seems weird that the bullets origin is directly inside the marines head. Shouldn't it be a bit lower, like at shoulder level in line with the weapon?
Except there is in a way. If you shoot a fade that blinks away right after your hit, you see the splash of green blood (client side I'm presuming), but the hit doesn't register because he blinks immediately after (happens before server-side). Same thing when you shoot at something right before you die. You see blood, but nothing happens damage-wise.
I also find that seeing creatures move so much behind on the server is really annoying. Like if you are a skulk and biting down an extractor, it's pretty much impossible to run around the extractor and avoid hits from the marine's gun because on the marine's screen, he's already around the building and shooting at you when you still see him exactly on the other side. This definitely needs improvement.
I also find that seeing creatures move so much behind on the server is really annoying. Like if you are a skulk and biting down an extractor, it's pretty much impossible to run around the extractor and avoid hits from the marine's gun because on the marine's screen, he's already around the building and shooting at you when you still see him exactly on the other side. This definitely needs improvement.<!--QuoteEnd--></div><!--QuoteEEnd-->
+1