Lag Compensation

Spektor56Spektor56 Join Date: 2010-11-10 Member: 74858Members
edited January 2013 in NS2 General Discussion
This game appears to allow either very high levels of interpolation or uses a very large buffer on the server for computing lag compensation. I was wondering what methods of latency compensation are used (interpolation, extrapolation, etc) and if there are client commands I can use to adjust these settings (updaterate, interpolation setting) etc. I see most servers I'm playing on at around 30 ticks, so about 50% of my frames should be interpolated frames.

But yea, my point is that the default lag compensation appears to compensate for very high latencies which is very annoying. Clearly behing behind corners on my screen and still losing health, or being hit by players that aren't even looking at me yet.

Also, the console doesn't give much feedback as to possible commands and/or invalid commands that are entered

Comments

  • statikgstatikg Join Date: 2012-09-19 Member: 159978Members
    What? I don't think I have ever heard of this happening in natural selection two.
  • thefonzthefonz Join Date: 2011-06-22 Member: 105847Members
    NS2 lag compensation is flawless. Hacks bro.

    /sarcasm.

    AFAIK compensation is set for about 150ms? Don't take anything I say as fact. Maybe someone who knows will post if you require a technical answer.
  • GuspazGuspaz Join Date: 2002-11-01 Member: 2862Members, Constellation
    I think you're confusing packetloss correction and latency compensation...

    Every modern game suffers from the shot-behind-corner issue, because they all feature latency compensation. The alternative is a return to the Quake 3 era where you have to lead all your shots by a variable amount determined by your ping at that exact second. Nobody wants to go back to that.
  • DavilDavil Florida, USA Join Date: 2012-08-14 Member: 155602Members, Constellation
    edited January 2013
    "It's mostly the interpolation settings" would be the general consensus. That may change in the future so that server ops can set their own interp settings, but not 100% on when.
  • BanditaBandita Join Date: 2013-01-18 Member: 180393Members
    Situation 1 -->
    Ping: Me 76, Enemy player 86
    avatars: Me (marine), Enemy player (Onos)

    Onos is in front of me and I'm shooting at it, but it turns away and runs around the corner. This took him about 2.5 seconds.
    Suddenly I'm down on the ground with no Onos around.

    Situation 2 -->
    Ping: Me 64, Enemy player 54
    avatars: Me (camo skulk), Enemy player (jetpack+ flamethrower marine)

    I'm walking on the wall and suddenly there is a manual radar ping. I see flames for about 0.3 seconds and die.

    Based on pings these shouldn't happen. But they do.
  • TSADroneTSADrone Join Date: 2012-12-01 Member: 173807Members
    They claim it's set to 100ms or something but it plays like it's much higher for me, at least .5 seconds (at a minimum) out of sync. This is with ~45ms latency and a great computer. I'd say at least 90% of my deaths as an alien feel like I am either out of LOS of the person who killed me, the person wasn't facing me, or I can see their shots missing but yet I still take damage and die.

    The worst part is marines with shotguns. As an alien, the only "skill" based dodging in NS2 consists of jumping madly around at random and praying.
  • 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
    The difference between your view and the view of the guy attacking you is :
    100ms interp + your lag + their lag + 50ms server->client rate + 1 fps worth of ms + 30-50ms graphics card/display delay

    Assuming 75ms lag for both you and your enemy, the time difference between your worlds is about 350-400ms.

    However, do notice that that there is nothing special with the NS2 netcode here - it's pretty much the same as for any lag-compensated game (it's pretty much a copy of the Source netcode). The REAL difference is that NS2 players move faster and closer than most standard shooters, making the lag compensation more noticeable.

    After a while, you learn how it works and how to use it.
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    edited January 2013
    I would say that source (atleast like CS:S) is better because of a couple key differences - Interp is calculated directly from client update rate (interp_ratio/ur) - makes for approx 30ms at default settings (interp ratio 2 IIRC). Having the higher tickrate also reduces the delay on updates from the server - NS2 Server would take atleast 33ms, 66 ticks drops that to 15ms - So that same situation for CS:S would be ~250ms or even a little lower.

    That said I think that as NS2 (and Spark) mature, we will hopefully be able to increase the server tickrate, and also the client update rate. The current client update rate of 20 makes any interpolation value <50 introduce warping. I would like to see server side settings to change these values (client update rate and tickrate), even if just for the smaller 6v6 games, as higher performance would benefit everyone, and there may be enough overhead in a 6v6 to support it. Also I would like to see these settings propogated to the clients on connect (currently I dont think the interpolation setting is, meaning it needs to be set again on every client connect).
  • turtsmcgurtturtsmcgurt Join Date: 2012-11-01 Member: 165456Members, Reinforced - Supporter
    edited January 2013
    <!--quoteo(post=2062853:date=Jan 18 2013, 01:52 PM:name=matso)--><div class='quotetop'>QUOTE (matso @ Jan 18 2013, 01:52 PM) <a href="index.php?act=findpost&pid=2062853"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->The difference between your view and the view of the guy attacking you is :
    100ms interp + your lag + their lag + 50ms server->client rate + 1 fps worth of ms + 30-50ms graphics card/display delay

    Assuming 75ms lag for both you and your enemy, the time difference between your worlds is about 350-400ms.

    However, do notice that that there is nothing special with the NS2 netcode here - it's pretty much the same as for any lag-compensated game (it's pretty much a copy of the Source netcode). The REAL difference is that NS2 players move faster and closer than most standard shooters, making the lag compensation more noticeable.

    After a while, you learn how it works and how to use it.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Something else people don't really think of is how long the alien models are relative to the player's camera. Both skulk and lerk are fairly long, giving marines slightly more time to hit you as you turn around a corner.
  • CommunistWithAGunCommunistWithAGun Local Propaganda Guy Join Date: 2003-04-30 Member: 15953Members
    <!--quoteo(post=2062853:date=Jan 18 2013, 03:52 PM:name=matso)--><div class='quotetop'>QUOTE (matso @ Jan 18 2013, 03:52 PM) <a href="index.php?act=findpost&pid=2062853"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->The difference between your view and the view of the guy attacking you is :
    100ms interp + your lag + their lag + 50ms server->client rate + 1 fps worth of ms + 30-50ms graphics card/display delay

    Assuming 75ms lag for both you and your enemy, the time difference between your worlds is about 350-400ms.

    However, do notice that that there is nothing special with the NS2 netcode here - it's pretty much the same as for any lag-compensated game (it's pretty much a copy of the Source netcode). The REAL difference is that NS2 players move faster and closer than most standard shooters, making the lag compensation more noticeable.

    After a while, you learn how it works and how to use it.<!--QuoteEnd--></div><!--QuoteEEnd-->

    When will configuration changes on the client side be made available?

    IE: the spark variants of cl_cmdrate, rate, etc. I'd like to be able to optimize my settings for my personal setup.
  • AxehiltAxehilt Join Date: 2003-09-12 Member: 20796Members
    The sheer frequency that I hit stationary aliens who think they're hiding behind cover (because they can't see me) when they're not (because their model's foot sticks out) leads me to assume the OP complaining about the same situation.

    To some degree it's a problem deserving of a solution -- players expect that if they can't see you, you can't see them. But it's also a sort of unavoidable trait of long player models with a 1st person camera (a dog can't swivel its head and know with certainty that it can't be seen around a corner, but we humans are used to this being the case in both real-life and the overwhelming majority of FPSes on the market.)
  • NeoRussiaNeoRussia Join Date: 2012-08-04 Member: 154743Members
    <!--quoteo(post=2062929:date=Jan 18 2013, 07:55 PM:name=turtsmcgurt)--><div class='quotetop'>QUOTE (turtsmcgurt @ Jan 18 2013, 07:55 PM) <a href="index.php?act=findpost&pid=2062929"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Something else people don't really think of is how long the alien models are relative to the player's camera. Both skulk and lerk are fairly long, giving marines slightly more time to hit you as you turn around a corner.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Actually, the player view comes from the start of the alien's neck, not the head. This is why if you can see a marine, you are usually sticking out and obvious if he is looking straight at you.
  • Spektor56Spektor56 Join Date: 2010-11-10 Member: 74858Members
    <!--quoteo(post=2062853:date=Jan 18 2013, 09:52 PM:name=matso)--><div class='quotetop'>QUOTE (matso @ Jan 18 2013, 09:52 PM) <a href="index.php?act=findpost&pid=2062853"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->The difference between your view and the view of the guy attacking you is :
    100ms interp + your lag + their lag + 50ms server->client rate + 1 fps worth of ms + 30-50ms graphics card/display delay

    Assuming 75ms lag for both you and your enemy, the time difference between your worlds is about 350-400ms.

    However, do notice that that there is nothing special with the NS2 netcode here - it's pretty much the same as for any lag-compensated game (it's pretty much a copy of the Source netcode). The REAL difference is that NS2 players move faster and closer than most standard shooters, making the lag compensation more noticeable.

    After a while, you learn how it works and how to use it.<!--QuoteEnd--></div><!--QuoteEEnd-->

    So the game engine uses extrapolation as a fall-back mechanism like the source engine as well? Is there any information recorded regarding how many frames have been extrapolated? Also, it should be half of the latency (not round-trip delay) because the client does not request state updates from the server, the server should just send them at the clients set updaterate. If there's currently no way to set your updaterate I would assume you receive state updates at the tick rate of the server. I used to play cal-i level in counter-strike and other games, the netcode just seems a bit off to me for this one. Tribes Ascend is a very fast paced game as well, much faster than NS2, and the hit reg works wonderful. I'm getting 60fps pretty consistently with every graphic setting maxed.
  • DavilDavil Florida, USA Join Date: 2012-08-14 Member: 155602Members, Constellation
    <!--quoteo(post=2063012:date=Jan 18 2013, 07:23 PM:name=Spektor56)--><div class='quotetop'>QUOTE (Spektor56 @ Jan 18 2013, 07:23 PM) <a href="index.php?act=findpost&pid=2063012"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->So the game engine uses extrapolation as a fall-back mechanism like the source engine as well? Is there any information recorded regarding how many frames have been extrapolated? Also, it should be half of the latency (not round-trip delay) because the client does not request state updates from the server, the server should just send them at the clients set updaterate. If there's currently no way to set your updaterate I would assume you receive state updates at the tick rate of the server. I used to play cal-i level in counter-strike and other games, the netcode just seems a bit off to me for this one. Tribes Ascend is a very fast paced game as well, much faster than NS2, and the hit reg works wonderful. I'm getting 60fps pretty consistently with every graphic setting maxed.<!--QuoteEnd--></div><!--QuoteEEnd-->
    From what I've read I believe both the client and the server are doing the extrapolation. Seems a bit off I suppose since the server makes the final call anyway.
  • FrustrationFrustration Join Date: 2013-01-19 Member: 180628Members
    I'm so glad someone else besides me is having this issue.

    I can't believe how people can be so calm about it though.

    How are people suppose to judge the situation if they are not safe when they should be.

    I'm not talking about running behind corners and still dying - which is not too good either, but I can live with that.

    Crap like dying in 0,001 sec after they've barely seen you.But if you were that Marine, you'd have to shoot 1 full clip into a skulk to take it down.

    How is one suppose to adapt to this if you get killed before you even see the threat ?
  • CommunistWithAGunCommunistWithAGun Local Propaganda Guy Join Date: 2003-04-30 Member: 15953Members
    The delay is god awful, much worse than anyone is complaining about. I was testing with a friend, his ping was 78 minewas 45, and he just jumped across a doorway into and out of my vision, we were the only two people present, and I could stop shooting about a half second after I "thought" I killed him and he continued taking damage and died.

    This needs to be resolved.
  • DamDSxDamDSx Join Date: 2004-08-10 Member: 30506Members
    interp and I think it is 100ms
  • Spektor56Spektor56 Join Date: 2010-11-10 Member: 74858Members
    edited January 2013
    100ms interp in this day and age is insanely high... 100ms interp compensate for latencies up to 200ms, and if you have 200ms you're either playing in the wrong region, or live in an amish community
  • AWhiteAWhite Join Date: 2007-07-26 Member: 61685Members
    Pretty sure stomp is a special case (of broke) and shouldn't be considered in the interp conundrum.
  • VitdomVitdom Join Date: 2012-04-30 Member: 151345Members, Reinforced - Supporter, Reinforced - Silver, Reinforced - Gold, Reinforced - Diamond, Reinforced - Shadow, WC 2013 - Shadow
    edited January 2013
    I don't think there is a console command to configure your net settings.

    <!--quoteo(post=2062885:date=Jan 18 2013, 11:38 PM:name=xDragon)--><div class='quotetop'>QUOTE (xDragon @ Jan 18 2013, 11:38 PM) <a href="index.php?act=findpost&pid=2062885"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->That said I think that as NS2 (and Spark) mature, we will hopefully be able to increase the server tickrate, and also the client update rate. The current client update rate of 20 makes any interpolation value <50 introduce warping. I would like to see server side settings to change these values (client update rate and tickrate), even if just for the smaller 6v6 games, as higher performance would benefit everyone, and there may be enough overhead in a 6v6 to support it. Also I would like to see these settings propogated to the clients on connect (currently I dont think the interpolation setting is, meaning it needs to be set again on every client connect).<!--QuoteEnd--></div><!--QuoteEEnd-->
    Why do you want to increase the server tickrate? And are there really any network command settings for the interpolation?

    <!--quoteo(post=2063012:date=Jan 19 2013, 04:23 AM:name=Spektor56)--><div class='quotetop'>QUOTE (Spektor56 @ Jan 19 2013, 04:23 AM) <a href="index.php?act=findpost&pid=2063012"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->So the game engine uses extrapolation as a fall-back mechanism like the source engine as well? Is there any information recorded regarding how many frames have been extrapolated? Also, it should be half of the latency (not round-trip delay) because the client does not request state updates from the server, the server should just send them at the clients set updaterate. If there's currently no way to set your updaterate I would assume you receive state updates at the tick rate of the server. I used to play cal-i level in counter-strike and other games, the netcode just seems a bit off to me for this one. Tribes Ascend is a very fast paced game as well, much faster than NS2, and the hit reg works wonderful. I'm getting 60fps pretty consistently with every graphic setting maxed.<!--QuoteEnd--></div><!--QuoteEEnd-->
    The current update rate is 20 Hz. It needs to increase in order to lower the interpolation buffer delay.

    <!--quoteo(post=2063016:date=Jan 19 2013, 04:27 AM:name=Davil)--><div class='quotetop'>QUOTE (Davil @ Jan 19 2013, 04:27 AM) <a href="index.php?act=findpost&pid=2063016"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->From what I've read I believe both the client and the server are doing the extrapolation. Seems a bit off I suppose since the server makes the final call anyway.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Only the client does the extrapolation, it wouldn't make any sense if the server would because it's the server who's the master and decides everything. If it'd extrapolate then the whole design is very bad, because the server is by-design sending inaccurate state data to the clients.

    If you're thinking of prediction though; if there wouldn't have been any prediction you would've noticed a long delay when you are sending move commands to the server and once you receive the move states back from the server you would actually start to move, where the delay is decided by your latency to the server. High prediction durations(hence high ping/latency) in general is bad for your own experience, because since the server is the master, you have a higher chance of receiving an overriding state in case something <i>unpredictable</i> happens, which warps you into the correct postition etc.

    <!--quoteo(post=2063345:date=Jan 19 2013, 10:03 PM:name=Spektor56)--><div class='quotetop'>QUOTE (Spektor56 @ Jan 19 2013, 10:03 PM) <a href="index.php?act=findpost&pid=2063345"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->100ms interp in this day and age is insanely high... 100ms interp compensate for latencies up to 200ms, and if you have 200ms you're either playing in the wrong region, or live in an amish community<!--QuoteEnd--></div><!--QuoteEEnd-->
    Interpolation and lag compensation are different things. They are not interchangeable terms.

    --

    <b><!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->While we are discussing interpolation / lag compensation! Since UWE is adding first person spectating to the game, I am just wondering if the first person spectating mode will be lag compensated to match the remote player's actual world state, and actual view, so that you are truly watching the world from the remotely spectated player's eyes. CS, CSS, + LOADS of other games, do NOT utilize lag compensation for FPSpeccing. Please enable full lag compensation for FPSpeccing in NS2 UWE!!! It would look and feel soo ugly if you wouldn't. :(<!--colorc--></span><!--/colorc--></b>
  • 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
    <!--quoteo(post=2063006:date=Jan 19 2013, 04:05 AM:name=NeoRussia)--><div class='quotetop'>QUOTE (NeoRussia @ Jan 19 2013, 04:05 AM) <a href="index.php?act=findpost&pid=2063006"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Actually, the player view comes from the start of the alien's neck, not the head. This is why if you can see a marine, you are usually sticking out and obvious if he is looking straight at you.<!--QuoteEnd--></div><!--QuoteEEnd-->

    No, player view is on the vertical (y) axis of the model. So if a skulk can see a marine player, the marine can see half the skulks model. This does screw up attempting to sneak any kind of peek as an alien, as if you want to look down a corridor, you need to expose half your body.

    Hard to do anything about it - sticking the viewpoint at the eye position would make turning around without moving look really weird (you would rotate around your head, flicking your behind around), alternatively your eye position would move in space when you turn around, something that would feel weird and possibly cause quite a bit of motion sickness.
  • Spektor56Spektor56 Join Date: 2010-11-10 Member: 74858Members
    edited January 2013
    <!--quoteo(post=2063473:date=Jan 20 2013, 01:35 AM:name=Vitdom)--><div class='quotetop'>QUOTE (Vitdom @ Jan 20 2013, 01:35 AM) <a href="index.php?act=findpost&pid=2063473"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Interpolation and lag compensation are different things. They do not affect each other.<!--QuoteEnd--></div><!--QuoteEEnd-->

    They do actually, interpolation adds a buffer to every game state received by the game client, adding additional latency based on the interpolation setting. When the server computes the latency compensation it must know the interpolation setting of the client (additional latency added by the client)

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

    Server is at the top, and client is at the bottom obviously. Assuming a 150ms buffer as stated by another user, 60ms latency and a 33ms interp setting should result in approximately 62% usage of the buffer. Of course, this is assuming an ideal system where there is no graphics delay, packet loss, or choke.
  • soccerguy243soccerguy243 Join Date: 2012-12-22 Member: 175920Members, WC 2013 - Supporter
    I think better damage indicators for aliens would help. There have been times where I take 100% of the damage to kill me before i can even hit the spacebar and jump off the extractor.

    Even as lerk if i'm perched somewhere I take nearly 100% damage before i can get even one flap of my wings...
Sign In or Register to comment.