Announcement

Collapse
No announcement yet.

Hit Registration in FPS games

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Hit Registration in FPS games

    Hey everyone! I am very interested in the topic of hit registry in games specifically FPS. I had a few questions for ya and know there are some veterans in this field on the forums

    First off what exactly causes good or bad registration between players? Is a players ping or server location critical in this department and if so would the individual in a 1v1 fight with higher ping for example be at any sort of advantage or a complete disadvantage considering they are a few ms behind? Next what is involved in I would assume to be the coding aspect for this feature of a game? Why do*some FPS games feel so clean and polished when it comes to shooting an opponent and others feel like you are hitting a ghost? The last thing I can think of right now and I may add more soon is are there any recording programs or in-game programs that can be run that show shots that hit/miss for testing purposes in various games?*

    guys for any input and explanation I really appreciate it!

    Recon

    #2
    I only have three & a half cents worth of info.

    Lat time I checked, the major games were using client state hitbox registration. This means you hit what you aim at on you PC, regardless of where other players might "actually" be. This sharply reduces the effect of lag.

    However, a player with better ping will experience server status faster and thus shoot earlier. For example, face-to-face, you might empty your mag into the enemy, and then instantly die as he walks away. Why? The server decided his kill shot was made before yours. This never happens to Apache.

    Another plus for this solution is that an individual player with a slow connection doesn't degrade server performance for the other players.

    Comment


      #3

      Apache

      Where do you put the Bayonet?
      Chesty Puller (upon seeing a flamethrower for the first time)
      I am all in favor of keeping dangerous weapons out of the hands of fools. Lets start with typewriters.
      Frank Lloyd Wright

      Comment


        #4
        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
        Last edited by Sirex; 21 Mar 2018, 12:50 PM.




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

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

        Comment


          #5
          This is the best explanation I have ever read describing what actually happens in game. Thank you Sirex.
          Apache

          Where do you put the Bayonet?
          Chesty Puller (upon seeing a flamethrower for the first time)
          I am all in favor of keeping dangerous weapons out of the hands of fools. Lets start with typewriters.
          Frank Lloyd Wright

          Comment


            #6
            Welcome, I never realised how long it was until I hit post....

            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 33 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; 21 Mar 2018, 12:33 PM.




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

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

            Comment


              #7
              Nice post and explanation Sirex
              [url=http://www.enjin.com/bf3-signature-generator][img]http://sigs.enjin.com/sig-bf3/1fad512dc784c11c.png[/img][/url]

              Comment


                #8
                Originally posted by Sirex View Post
                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
                Sirex, please do us all a favor.

                Copy and paste this into a new post and sticky it at the top please.

                Thank you!

                Comment


                  #9
                  done.

                  Named it a decent title too.




                  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,187   Posts: 269,850   Members: 6,183   Active Members: 7
                  Welcome to our newest member, Fermin13Q.

                  Today's Birthdays

                  Collapse

                  There are no members with birthdays today.

                  Top Active Users

                  Collapse

                  There are no top active users.

                  More Posts

                  Collapse

                  • Reply to Hi guys!
                    by Evil_T0NY {CLR}
                    I've been Alpha and will be Beta testing the Delta Force game. It's been really getting good reviews! Definitely a good Battlefield feel to it like the...
                    14 Nov 2024, 08:50 PM
                  • Reply to Hope your all OK over there
                    by Apache Warrior
                    We had 17 inches of rain from the storm on November 7, 2024.
                    Apache
                    11 Nov 2024, 07:55 AM
                  • Reply to Hope your all OK over there
                    by Sirex
                    Aye, I'm inclined to agree with that lmao
                    Gone are the days of warm summers and snow filled winters here, nothing but rain and wind for 8mths of...
                    10 Nov 2024, 08:53 PM
                  • Reply to Hope your all OK over there
                    by Apache Warrior
                    Now we have had a lot of flooding in this area and there are still a lot of houses that have not been repaired. Must be the apocalypse.
                    ...
                    8 Nov 2024, 09:23 AM
                  Working...
                  X