Announcement

Collapse
No announcement yet.

Hit Registration, Lag Compensation, High Pingers and You

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Hit Registration, Lag Compensation, High Pingers and You

    Well first, lets clarify...
    Hit registration vs (ugh i cant mind the fancy name for it) hit events...
    If you want to get gritty with the names that is...

    Every client will "register" a hit with the server, regardless of if it thinks it died or not.
    This does not get negated or affected by lag or higher pings, just packet loss.
    You shot something, your client will go "I shot this!"

    Now onto the other half of it... events...
    Your client goes "I hit something!", the server goes ok, I will check that out for you and let you know ok?

    From here on you need to know that servers dont work on real time, they work on "frames" as well as you do, and they keep a snapshot of about 1 second of these.
    So for 1 second in time it knows where EVERYTHING has been (and I think this is what caused the Titan lag on 2142, as the titan movement was recorded too finely, I digress).
    You also have to remember that the ping is also how much time the player is behind the server.
    So you have 50ms ping and another 150ms, and you are standing exactly on the same spot looking the same way everything.
    The 150ms player will see what you see 100ms later than you will, this is not 'foresight' he cant see anything that happens in that 100ms that you do.
    Due to how the server works he will have the same time to react to a, i dunno a grenade dropping as you do....

    Anyway, on each "I hit something on my frame!" the server gets it will "wind back time" and check if you are telling the truth, in relation to the server frame.
    Why? because each client does not show a true view of the server status, for a moment in time before it gets a server frame it will predict movement.
    Plus servers dont trust the client (this can only be cheated with a proxy that will wind back the stamp on your packet)

    A lot of games specifically I know source engine does it, encode 'server frames' into the packet you send and recieve.
    So someone who has a 150 ping might be a few server frames behind you (about 3), so you fire and he does not on your screen, but you die.
    The reason for this is because they actually seen you and fired the frame before according to the server.

    Now this is where people hate players with big pings, this bit to come!
    The claim is because they have a delayed view of the server they get a fraction more time to see you, or that because their shots take longer to get there it makes them win.
    Untrue.
    A decent server will tally the frame the players are seeing and the frame on the server, it will trust its own wind back vs any player input.
    So for me as a good example.
    You maybe on frame 4000
    but i'm currently on 3997

    You walk round the corner and see me, you fire although you think I never shot, you die and see me fire at the same time.
    But when I walked round the corner on 3999 and fired, i had hit you, it takes a 120ms for my data to get to the server, and then 60 to update you, with the "well actually" and your client (trying to be nice) shows you this in one motion.

    So for 200ms your client is predicting my movements, but when you get the update from the server at about 4002 you are killed and see my shots, as it essentually mass updates the entity.
    And being the horrible "i want to see it real time" creatures we are, your client had shown you firing "before" i did...
    Because when it sends that "i shot something" it shows you the "you shot something".
    (This was painfully obvious in COD4/MW netcode, you would see the 'hit' crosshair but nothing came of it)

    This is where the laggy players get their "immunity" from... or supposed to be.
    In reality I seen you first, shot first.
    You need to remember my screen is 120ms behind you, i see all you seen 120ms after you do, with no advantage...
    Why?
    Server frames!

    From your view you see
    Client Frame You Me
    3997 Walked Walked
    3998 Walked Walked
    3999 Walked Walked
    4000 Shooting Walked
    4001 Shooting Walked
    4002 Died Shooting
    From my view I seen
    Client Frame You Me
    3997 Walked Walked
    3998 Walked Walked
    3999 Walked Shooting
    4000 Shooting Shooting
    4001 Died Shooting
    4002 Died Shooting
    The server how ever will see something like this in real time
    # You # Me
    3999 Walked 3996 Walked
    4000 Fired 3997 Walked
    4001 Fired 3998 Walked
    4002 Dead 3999 Fired
    4003 Dead 4000 Fired
    HOWEVER the server really sees
    # You Me
    3998 Walked Walked
    3999 Walked Fired
    4000 Fired Fired
    So as you can see even if we where in the same room, with a ping difference of 1 frame on the server, and we fired at exactly the same time.
    According to the servers "frame tracking", I fired first.

    Now you could say, ok lets fix this, lets do real time tracking.
    But then the person with the lowest ping would have the advantage, as every other player could be drawing behind their screen.
    50ms is all it takes for 1 standard source server frame.

    The only argument for high pingers is my movement is more predicted by the server and your client.
    As I'm 120ms behind you, the server needs to guess where I am going to be, or your client will.
    Thats why you see REALLY high players rubberbanding.
    Its not packet loss, or anything else its just they moved left or turned 180 and the server never predicted that and so your client never either.
    BUT it has a down side for me, as my movement is predicted by your client, you can shot me in a predicted place at your 3998, and even though i was not there on my screen, i will die there.
    This happens to me, esp on corners, thats why you never seen me running up to corners near opponents.
    My player will on your screen keep running to go round the corner, even though I have not made that move yet, and according to the server it will be a legal kill, even if at 3998 I was behind a wall.

    I think Orange Box tried to counter this by players playing in the frame ahead or something.
    Essentually the view that lower players had was 'delayed' by a server frame or two.
    Dont quote me on that, but I remember some revision to the server framing involving timing of the players view.
    Thats why TF2 originally had that weird "no you where actually here" thing for lower ping players.

    Phew thats a bit long winded.

    In short, any player thats high ping will not have an advantage, they are only seeing the status of the server later than you are.
    A high ping over 200 will maybe taint other players experience with the player.
    Over 300 definetly will as a lot can happen to a players movement in 5-6 frames.
    Its also why in games like UT and such that jump dodging is effective as the server and clients have a harder time predicting your movements, allowing for that 2-4 frame delay to have less effect.

    As for how to reduce the effect on either end...
    There is no real solution, you could (as orangebox did) feed data into an "ahead frame" and feed players the middle ground frame.
    It hurts your lower players as they will be told, you wanted this but i did this instead for you.

    You could feed your lower players the last frame everyone got.
    but if you ahve a 120ms ping player on and your 50, that 120ms behind all your inputs will respond.
    You press forward, wait 170ms and move... (need to mind your data travel to make the move here)

    Server frames are not ideal either, but they do allow each client to play at the "time" they are seeing.

    MMORPG's use a half baked method.
    They will update clients based on the frame the server sees, but during things like battles it will delay things on its side and sync up clients in the method above by holding back that initial data from the faster clients.

    You could do that, initall delay the 50ms player by 70ms to allow the 120 to catch up.
    but what happens when a new player joins?
    do you stutter the game to allow everyone else to match that new player?

    Bonus:
    As for hits on the same frame.
    NOTHING on a computer happens at the same time.
    Packets arrive one after another, so its down to the internet gods on who gets same frame kills.

    The only ideal way to counter it (and most matchmaking will do this) is to play with people on the server who ping at the same or similar rate as you do.
    Ideally if you know the servers frame rate, you can use this to work out if you would be in the same frame as the other players all the time.
    So for a non edited source server at 50 tick (20ms frames) you want to play with people in the same ping range of 20's
    0-19
    20-39
    40-59
    and so on, these people will be seeing the same server frame you do, so you will see who actually fired first (kind of, there is no way to see real shots real time).
    (you can't cancel out client prediction though)

    Hope this was helpful in someway...
    I did try explain best I can, but a lot of this knowlege is "internalised" now.
    Its all stored in my head in a way thats pretty hard to type out

    Its obviously a little more than just that, but the basic method is the same but if it helps clear things up for someone, they are welcome.

    But as why different games feel different in the you hit deparement, it all depends on the frame rate and also how they coded the engine to handle the "seeing things later" issue.

    If its client based show the hit, it will appear shitty as the client will show the hit even though it never.
    Generally the server will guess if you hit something and send a "yeah i think you hit something" back to the client.
    This would then show the hit crosshair, but it can lie still.
    Once all players involved have updated the frame you claimed to hit on it will let you know if thats true.

    A higher 'tick' will allow for less time per frame for something to change.
    So 66 tick is about 15ms frames, so there is more chance shots fired at the same moment will land on different frames.
    It allows for players reaction times to become a factor more.
    Last edited by Sirex; 7 Jun 2018, 07:14 PM.




    I'm not insane. I'm just overwhelming!

    ·····••••• Support Cainslair. Donate here!•••••·····
    ·····••••• and get extra options! •••••·····

    #2
    Well done, you.
    --Slaughter

    Comment


      #3
      I keep reading it and thinking to myself "where to I keep all this in my head"...

      Ah the things I have learnt from here over the years, definetly would not know all that if it was not for here.




      I'm not insane. I'm just overwhelming!

      ·····••••• Support Cainslair. Donate here!•••••·····
      ·····••••• and get extra options! •••••·····

      Comment


        #4
        Post of the year!! Thank you!

        Comment


          #5
          Welcome, I would not know all of that if it was not for years of yourself feeding my thurst for knowlege and letting me rummage about and looking at stuff.
          So thank you for that

          So can say your servers had a big influence on how I see a lot of things.
          Not just in games but in my work aswell its had an impact as I can generally understand how things are working under the hood just by watching them for a few minutes.

          I dare not talk about client hit detection though... thats a totally different ball game, and every engine handles it so differently, but the basics of it are an intresting read.
          I dont remember where I seen the article though, and I cant seem to find it again, was a while ago... a long while... back in UT 2004 days when I started taking an intrest in the engine itself.




          I'm not insane. I'm just overwhelming!

          ·····••••• Support Cainslair. Donate here!•••••·····
          ·····••••• and get extra options! •••••·····

          Comment


            #6
            Thank you for the kind words, I consider you one of my dearest friends, even though we've only met in person once! You've been the backbone of our server community and I will always be grateful. THANK YOU!

            In fact, I've made several lifelong friends thanks to "Cain's Lair", and I hope we can find a new game to play and get many of our friends back together again.

            Comment


              #7
              Oh I do miss the games with everyone, its just harder these days to get a community round a game I think as studios start to 'inhouse' everything and quickplay becomes the norm.




              I'm not insane. I'm just overwhelming!

              ·····••••• Support Cainslair. Donate here!•••••·····
              ·····••••• and get extra options! •••••·····

              Comment

              Cain's Lair Forums Statistics

              Collapse

              Topics: 26,182   Posts: 269,814   Members: 6,177   Active Members: 4
              Welcome to our newest member, EzraGilchr.

              Today's Birthdays

              Collapse

              There are no members with birthdays today.

              Top Active Users

              Collapse

              There are no top active users.
              widgetinstance 184 (More Posts) skipped due to lack of content & hide_module_if_empty option.
              Working...
              X