To improve the responsiveness of weapons...

SkieSkie Skulk Progenitor Join Date: 2003-10-18 Member: 21766Members, NS2 Playtester, Reinforced - Shadow
I did a small study on the responsiveness of weapons as to when the target actually takes damage. Or appears to take damage.

In this situation, I shot a cheats-spawned lerk close up with the rifle on a listen server (low ping).

The picture speaks for itself, it takes quite a long time for there to be any response, and even for the client-side hit calculation it takes 150ms. I've modded the hit tick to be instant.

<img src="http://i.imgur.com/SHOYB.jpg" border="0" class="linked-image" />

In another similar situation (which I don't have a picture of), I shot a CC with a shotgun with cheats on, and it took 175ms for its health to drop from 85% to 83%, the starting point being the first frame of the shotgun's muzzle flash.

I feel like this is a really 'big deal' and should be looked into when the devs have time. Or is it just because of the server's low tickrate which causes it so long to update?
«1

Comments

  • DghelneshiDghelneshi Aims to surpass Fana in post edits. Join Date: 2011-11-01 Member: 130634Members, Squad Five Blue, Reinforced - Shadow
    They should pay you to test engine bugs. Or at least make you a playtester.
    Seriously, you've been reporting a lot of issues most people seem to notice to some degree ("it feels strange sometimes") and tested all of them <b>very</b> thoroughly with all steps to reproduce and everything you could find about both the issue and the cause.

    On topic: The game might have some built-in lag to make games more fair, but I don't know. A tickrate of 30 should induce a maximum of 33ms of additional lag, although I don't know about client updaterate, which might also come into play.
  • TechercizerTechercizer 7th Player Join Date: 2011-06-11 Member: 103832Members
    edited March 2012
    I'm not sure I understand what the issue is. As long as the server properly compensates for effects of the time delay on the object's position, does it really matter if it takes 200ms to report to the client that the target has taken damage? Either I shoot the skulk first or he bites me; a 200ms delay for both of us won't change which one gets to live.
  • SkieSkie Skulk Progenitor Join Date: 2003-10-18 Member: 21766Members, NS2 Playtester, Reinforced - Shadow
    <!--quoteo(post=1910763:date=Mar 7 2012, 03:12 AM:name=Techercizer)--><div class='quotetop'>QUOTE (Techercizer @ Mar 7 2012, 03:12 AM) <a href="index.php?act=findpost&pid=1910763"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I'm not sure I understand what the issue is. As long as the server properly compensates for effects of the time delay on the object's position, does it really matter if it takes 200ms to report to the client that the target has taken damage? Either I shoot the skulk first or he bites me; a 200ms delay for both of us won't change which one gets to live.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Where's the line for acceptable delay for you? What if it took 600ms for it to update to clients? Or 3 seconds? "Sure, it's acceptable if it takes 3 seconds for both players!" It shouldn't take 150ms.

    I was going to launch Quake3 to do the same thing for comparison with a bot, to see how NS2 measures up, but then I realized I had deleted it. :(

    Dghelneshi, I just want NS2 to be a great game. But sometimes I come on a bit strong with my opinions. :)
  • TechercizerTechercizer 7th Player Join Date: 2011-06-11 Member: 103832Members
    Acceptable line is probably around 500ms for me. Beyond that, you have the potential to make wrong long-term decisions like sprinting away from a fight or jumping off an edge to dodge a corpse.
  • GORGEousGORGEous Join Date: 2012-02-19 Member: 146762Members, NS2 Map Tester
    Half a second is far too long. What about reloading, continuing to shoot, etc. Should I really have to keep pump another 20 rounds into a skulk to see if I've actually killed it half a second ago?
  • SkieSkie Skulk Progenitor Join Date: 2003-10-18 Member: 21766Members, NS2 Playtester, Reinforced - Shadow
    You already shoot 10-15 rifle bullets too many before the skulk dies. Every time a skulk dies I have about 25 ammo left, unless I stop shooting earlier intentionally. I do this quite often, but sometimes I feel like shots go missing so I shoot about 15-20 bullets instead of the necessary 10.
  • TechercizerTechercizer 7th Player Join Date: 2011-06-11 Member: 103832Members
    Good point. This does need to be improved for rifle ammo management.
  • GORGEousGORGEous Join Date: 2012-02-19 Member: 146762Members, NS2 Map Tester
    edited March 2012
    Yeah. It only takes 10 bullets to kill a skulk. Do you ever have 40 bullets remaining when you kill skulks? I usually end up dumping 25-50 per skulk.

    When in doubt, empty the magazine.
  • RisingSunRisingSun Rising California Join Date: 2004-04-19 Member: 28015Members, Constellation, Reinforced - Shadow, WC 2013 - Shadow
    Not to mention when they hunt in packs. Hard as hell to kill both unless you spread the love before the death animation.
  • WheeeeWheeee Join Date: 2003-02-18 Member: 13713Members, Reinforced - Shadow
    yeah. waiting 20 frames/260ms for a hit response is not good at all, especially on a ping 0/LAN game. i don't even think it'd be acceptable if it were half that.
  • McGlaspieMcGlaspie www.team156.com Join Date: 2010-07-26 Member: 73044Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Onos, WC 2013 - Gold, Subnautica Playtester
    If you're performing this on a listen server, that will add some client-side lag. I would start a dedicated server (LAN only) and repeat the test. Interesting results though.
  • SkieSkie Skulk Progenitor Join Date: 2003-10-18 Member: 21766Members, NS2 Playtester, Reinforced - Shadow
    On a dedicated LAN server with 5 ping, 163 ms for the hit tick to appear versus a CC, and 200 ms for the health percentage to change.
    Against a lerk, 162 ms for the hit tick to appear, 230 ms for it to flinch.

    So very similar results.
  • Shrike3OShrike3O Join Date: 2002-11-03 Member: 6678Members, Constellation
    And with an AR running a cyclic rate around 1100 rounds per minute, that's a lot of wasted ammo. I'm starting to get to the point where I can put a long burst into one skulk, transfer to his friend, and put a long burst into the second, but having a little sharper in-game feedback that I'd actually killed the first one would be nice (as sometimes, I haven't quite managed it :) )
  • OrzOrz Join Date: 2010-03-24 Member: 71069Members
    Yeah, I definitely notice lag when killing skulks. I've sort of grown a habit of stopping shooting before they actually die on my screen, cause I know they've had enough bullets and technically should already be dead, if not immediately then within microseconds. This isn't how it should be though :(
  • flyjumflyjum Join Date: 2012-01-07 Member: 139849Members
    This is even a problem when playing as a skulk
    You can charge in kill 1 player and run out and be halfway down the next hallway and die to a random shot from .4 seconds before
  • MuYeahMuYeah Join Date: 2006-12-26 Member: 59261Members
    I have found that over time I've naturally adapted to this by stopping shooting the MG a few hundred milliseconds before the skulk appears dead. Sometimes it works, sometimes it doesn't. There is definitely a larger delay response than other FPS games.
  • FloodinatorFloodinator [HBZ] Member Join Date: 2005-02-22 Member: 42087Members, Reinforced - Shadow
    edited March 2012
    Just a question. Max said some time ago that there is a 150ms delay ( like ex_interp 0.15 in CS), so maybe it is still in and thas why there is a 150ms delay?

    Ty Yuuki it was matso then.
  • YuukiYuuki Join Date: 2010-11-20 Member: 75079Members
    edited March 2012
    I think it's also linked to this, here you can see the client side hit effect and the server side one lagging behind, I don't remember how it behaves locally with very low ping though :

    <center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/mjbCil1lF1w"></param><embed src="http://www.youtube.com/v/mjbCil1lF1w" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center>

    Also matso tried to explain this in another thread, I'm still a bit confused, but it seems that the server add 100ms of lag or something...

    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->A fully functioning server sends you a new snapshot 20 times per second. The server adds a 100ms buffer to your input, and then lag is added on top of that. Assuming 100ms ping, the snapshots from the server will be about 200ms out of date, and you will get them at 50ms intervals, so that means that you will have rougly 200-250ms worth of input queue to predict each frame.<!--QuoteEnd--></div><!--QuoteEEnd-->
  • Raza.Raza. Join Date: 2004-01-24 Member: 25663Members, Constellation
    I noticed that too. The delay can reach ridiculous levels with higer ping times, but it is noticable on all servers. Though I wonder if that is really a netcode problem or if the game updates (animations, health, etc) just start too late.
  • matsomatso Master of Patches Join Date: 2002-11-05 Member: 7000Members, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Shadow, NS2 Community Developer
    Anything generated on the server in response to your actions will appear late to you, because you are basically running in the future compared to the server. Its has to be this way in order to give you complete control of your avatar, while keeping complexity down to manageable levels.

    So if you cause something to happen on the server, there will be a lag before you see it on the client.

    Try typing net_lag 500 in the console, then try the following:
    - riflebut a wall while strafing - look at where and when the hit effect occurs
    - pistol shot a wall (second ricochet)
    - hurt something (late flinching)
    - fire a grenade while strafing
    - gorge spit

    Increase the lag basically moves you further into the future compared to the server, meaning that anything you cause to happen on the server will show up late on your client.

    For an extra bonus, have someone else do it while you look at it and compare notes.

    Some things are avoidable - your client should not show server-generated hit effects from your weapon, as they are already client-side predicted (will probably get fixed when the effects system is overhauled).

    However, the flinching effect (and the effect on health/armor) that your damage causes reflects a state change in an entity you don't "own". It would be a nightmare to predict on the client, and for normal lag-ranges and most effects, the lateness is acceptable (200 ms lateness in seeing a skulk die is 3-4 extra rifle bullets).

    Projectiles are tricky - if they are to appear ok to everyone else BUT the shooter, then the projectile will be created late to the shooter, and it will be a bloody pain to use projectiles for a lagged attacker (the current situation). It is possible to let the shooter have priority when it comes to projectiles, but then the projectiles will appear "out of thin air" a certain distance away from the shooter to everyone else.

    The fix to all this is of course to increase the speed of light.
  • SkieSkie Skulk Progenitor Join Date: 2003-10-18 Member: 21766Members, NS2 Playtester, Reinforced - Shadow
    edited March 2012
    Comparison with Quake Live, on a 0-ping server against a bot, which matches the situation of a 0-ping server against a stationary spawned lerk.

    30 ms until hit tick registration, another 10 ms and the target is dead.

    <img src="http://i.imgur.com/jiIPY.jpg" border="0" class="linked-image" />

    I'm not doing this to give NS2 bad rep, but have to face the fact that if we want NS2 to cater for the competetive players, it needs to be sub 100ms. Currently it's 250ms. :)

    40ms feels really "instant" and that's why I find Quake Live very, very fun to play. It's so responsive.
  • IronHorseIronHorse Developer, QA Manager, Technical Support & contributor Join Date: 2010-05-08 Member: 71669Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Subnautica Playtester, Subnautica PT Lead, Pistachionauts
    really nice find. i think you found "it"
  • PricePrice Join Date: 2003-09-27 Member: 21247Members
    edited March 2012
    nice job!
    Finaly a explanation why it feels so weird to shoot aliens/marines.
    but the alien bleed at the first frame?
    If you need a tester, i would help you.
    We could use fraps, it has 30 seconds free recording and this would be enough i guess.
  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
    edited March 2012
    Quake and Spark engine are Extremely different.

    For example on Quake you can play with a 300ms+ ping and still get hit registration, in fact you can run at over 500ms and still compete, Why? because all the prediction and bullet code is done on each machine, there is no server control over firing. Quake doesn't have a true Server/client relationship it has more a of peer-peer relationship.

    This relationship creates 2 situation, very fast and quick hit reg/detection, regardless of ping, and the most important one, makes it very easy to cheat :) Yes, quake is a great game on hit prediction, but it is so easy to cheat and impossible to get caught, because there is no server correcting firing rates etc. Sure, you get great registration, but you only get such a high speed game by foregoing any chance of preventing cheaters in the game.

    Seeing as there are already people cheating in NS2, even with the server/client principle, I would much rather have poorer hit reg, and less cheaters, than great hit-reg and a game where all the top players cheat as it is the only way to get to the top.

    --Edit---

    For a fair comparison, why don't you test CS:S, this is more likely to yield a comparable result/target to aim for. Getting Quake like performance is totally unrealistic.
  • SkieSkie Skulk Progenitor Join Date: 2003-10-18 Member: 21766Members, NS2 Playtester, Reinforced - Shadow
    <!--quoteo(post=1911821:date=Mar 10 2012, 01:22 PM:name=Soul_Rider)--><div class='quotetop'>QUOTE (Soul_Rider @ Mar 10 2012, 01:22 PM) <a href="index.php?act=findpost&pid=1911821"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->For a fair comparison, why don't you test CS:S, this is more likely to yield a comparable result/target to aim for. Getting Quake like performance is totally unrealistic.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Never really liked CS myself, I was more of a Quake guy.

    But yeah, it's probably very hard (or impossible) to get to Quake-like performance with .lua. All the hitreg code probably would have to be moved to to the C++ side. If I understand anything, that is. :)

    Price: Thanks for the offer, but the alien bleeding on the first frame is intentional to make it <i>seem</i> responsive. I've been using registered version of Fraps myself.
  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
    I'm Q3 and UT, that is my original gaming background. That is also why I know trying to compare a client/server system to a non-client/server system cannot realisticly be done.

    The Lua/C++ debate isn't even part of this issue. Quake works out all the code on the clients, and passes it around to each other, with a little bit of co-ordination on the server. In CS:S/NS2 the clients update some information to the server, then the server calculates everything. This causes multiple issues, and basically means that in a battle, the feeling of responsiveness in the game is often affected by the slowest updating player in that battle.

    Client prediction was invented to try and 2nd guess what was happening, and that is why you see blood on contact etc, even though no hit is actually registered on the server. This method, while creating a seemingly constant instant world, iis actually behind the real world.

    The quake system is much closer to real world reactions, but there is next to no security and protection against cheaters.

    It is purely a trade off decision that has to be made in the development process - Fairness and slower responses with client/server or anything goes hacks and very accurate responses in a peer-peer system.
  • matsomatso Master of Patches Join Date: 2002-11-05 Member: 7000Members, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Shadow, NS2 Community Developer
    If the hitreg code works correctly (and most of the heavy lifting is actually done inside the Spark (C++) level), then the client side hit prediction should be identical to what the server "sees" when it executes your input.

    Most of the time, it works, but sometimes ... it doesn't. It seems to stop working mostly when you have high-speed, variable movement (like, high speed skulks corkscrewing through the air).

    There is a "hitreg" command that's available. You don't need cheats to turn it on - it will show the shot and the position and animation details of the probable target. For every shot. Not a very good idea to turn on in actual combat - your screen will quickly fill with lines and frozen models - but for testing, it works pretty well.

    Unfortunately, I don't know if the discrepancies shown is due to bugs in the tool or in the code ... but at least there are discrepancies to explain.
  • SkieSkie Skulk Progenitor Join Date: 2003-10-18 Member: 21766Members, NS2 Playtester, Reinforced - Shadow
    Yeah I got fed up with Source's hitreg system when playing Dystopia because its second-guessing was ... at very high skill level, poor at best. On 150-ping servers there was so much prediction that hitting with hitscan weapons was ridiculously easy. On low ping servers, hits would still go missing even on stationary targets. One miss is enough to ruin an entire match, and even an entire tournament. :)

    I also played Action Quake2 on the Finnish national team, I think that game still handled regging a bit differently. There was more delay before the bullets left the weapons, depending on your ping. ie. no prediction at all. Everything done on server.
  • krakadictkrakadict Join Date: 2012-03-10 Member: 148539Members
    i've noticed this aswell, i've always put it down to the huge crosshair blocking the target and me having a bad aim, it also explain why people are dying round corners sometimes, which is very annoying playing as Kharaa or Marines.
  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
    <!--quoteo(post=1911830:date=Mar 10 2012, 01:23 PM:name=matso)--><div class='quotetop'>QUOTE (matso @ Mar 10 2012, 01:23 PM) <a href="index.php?act=findpost&pid=1911830"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Good Points<!--QuoteEnd--></div><!--QuoteEEnd-->

    In my mind the whole failure of Client/Server systems is the fact the client has to predict what every human player involved in the battle is going to do. As it is impossible to do that, 'prediction' is just really saying, this player is going to keep on doing this. Of course, players don't carry on doing whatever they did, and this is when the issues start coming in.

    This includes shooting someone, you may shoot them before they shoot you because prediction says they are going to carry on doing what they are doing, not firing, then you die, because they actually fired before you did. Or you get around the corner, and you die, because you were actually shot while still turning, not after you were around the corner.

    Prediction is a mis-nomer :)

    The problem is the only way to go for a high speed, accurate fighting system is peer-peer. Unfortunately, there is no way of making a peer-peer system cheat free. Games using server/client rely on high bandwitdh and good connections for all the players to have an accurate game, currently not possible with the worlds internet connections. Games using peer-peer can run very accurately with massive pings, because communication is done direct with the person you are shooting, rather than a 3rd party intermediary (server).

    When every gamer has access to 1gb internet, current client/server games should run as well as peer-peer to games. Unfortunately that far in the future network traffic will be much higher in those modern games, thus negating the benefit, but NS2 and CS:S will play really well. Servers should be able to handle NS2 by then as well :)
Sign In or Register to comment.