Welcome to the Darkfall: Rise of Agon Community

Create an account today to engage in discussions and community events on the Rise of Agon forums.

Latency, knock-up lag and hangtime

Discussion in 'Game Design Discussion' started by MikeJT, Aug 12, 2017 at 9:06 AM.

  1. MikeJT

    MikeJT Celestial
    Supporter

    Joined:
    Aug 28, 2016
    Messages:
    616
    Likes Received:
    368
    So if you've played this game with high latency, you will notice that when you hit someone with a knock-up spell, they lag before actually being knocked up, tend to hover in the air for a few hundred milliseconds before coming back down.

    There's not point in this. It's why I'm suggesting client-side prediction of knocked up opponents.

    Simply put, if you hit someone, or you see someone hit someone, they will be knocked up instantly on your screen.

    The way knocked-up players react on high latency clients makes the game a lot harder to play, makes it much harder to land aerial spells, and makes it much more difficult to know whether you've knocked them up or not.

    But we already know a few things:

    • The force of gravity
    • The force with which the player has been knocked up
    [​IMG]

    If we have a player sprinting in a particular direction, given by the green arrow, and they are hit with a knock-up spell, we can predict with a high level of certainty where they're going to land.

    In fact, at any time t, we can calculate their velocity (z) and their acceleration (Az) based on G.

    If at time t, the player sprinting in the direction of the green arrow was hit with a spell (lets say magma storm), then because we know the force of the magma storm, and the force of gravity, we now know this players Z position, velocity and acceleration at every given t unless another force acts upon them.

    So simply put, take latency out of the equation completely for the players z position and acceleration and let the client predict those. The client can still receive updates for the characters x and y positions (because the small amount of air control the player has will still alter their position slight), and the client can smooth between the clients view and the recieved server view.

    So what happens if the client thinks it hit when it actually didn't?

    Well... simply put, in the next received state, the players position will be put back down on the ground where it should be. A minor inconvenience compared to the current state.

    Alternatively, if the velocity of a player that is knocked up was given, then yet again the client can predict their z position accurately and avoid ridiculous hang times and sudden velocity changes in the air.
     
    Collapse Signature Expand Signature
  2. Down Syndrome

    Down Syndrome Earth Elemental
    Legend

    Joined:
    Nov 9, 2015
    Messages:
    421
    Likes Received:
    222
    I don't think that would work the way you think it would. Your client can't accurately predict the direction they're moving because of the latency delay and the lack of momentum when moving on the ground. I think you'd just end up with a rubberbanding model which is worse than it already is imo.
     
  3. leflexzone

    leflexzone Goblin Scout

    Joined:
    May 6, 2017
    Messages:
    13
    Likes Received:
    10
    just make the game client side solve all your problems.
     
  4. hirve

    hirve Goblin Shaman

    Joined:
    Apr 9, 2016
    Messages:
    62
    Likes Received:
    36
    nobody does this because small changes to player position have a big effect on the knockback they receive. at high ping you're replacing delay with mispredictions, which generally look worse

    sounds like the game doesn't predict gravity though? that should be fixed
     
    Collapse Signature Expand Signature
  5. AbyssWalker

    AbyssWalker Akathar
    Supporter

    Joined:
    May 3, 2016
    Messages:
    266
    Likes Received:
    64
    dont touch gravity pls or they will make UW
    --- Post updated ---
    yes let make more cheats with client side
     
    NonFactor likes this.
  6. MikeJT

    MikeJT Celestial
    Supporter

    Joined:
    Aug 28, 2016
    Messages:
    616
    Likes Received:
    368
    No it goes on the players position updated from that player.

    I think you might have misunderstood.

    Gravity doesn't change, we just use it to predict a players Z position more accurately.
     
    Collapse Signature Expand Signature
  7. Scrubby Bear

    Scrubby Bear Obsidian Golem
    Hero

    Joined:
    Apr 10, 2016
    Messages:
    1,777
    Likes Received:
    4,386
    I would consider it worth it to client side more stuff in the game for sure, just not right now. If we could get Planetside 2's ability to make 140 ping play like 40 ping that would only open up the doors for more people to enjoy the game without feeling gimped. The problem is that it would require a lot of resources and time to do this. Time BPG doesn't have right now. They need to be working on content ASAP and they keep getting side tracked on dumb shit. They literally just made major design changes that likely shit canned a bunch of their already limited spent resources. Client siding is something they do down the road when the future of the game is more secure and stable. Its not something they should be doing now.
     
    Fengor and Rimamok like this.
  8. MikeJT

    MikeJT Celestial
    Supporter

    Joined:
    Aug 28, 2016
    Messages:
    616
    Likes Received:
    368
    Clientside prediction with server side validation for hit detection is enough for most things:

    This is what happens right now with 240 ping:
    • I hit someone with a knock-up spell
    • They act like nothing happens for about 240 ms
    • Suddenly they fly up into the air
    • They hover around the peak of the knock up
    • The suddenly fly down to the ground
    • They frequently go through the ground and disappear half under the ground for about 1/5 a second
    What should happen:

    • I hit someone with a knock-up spells
    • Clientside prediction kicks in and takes into account their current movement speed and heading to predict their movement path
    • In the next frame, if I didn't actually them when my client things they did, they are placed back on the ground
    • They fly up to the peak of their jump smoothly, then start falling down, smoothly.
    • They hit the ground and don't go through it.
    At their end, nothing changes, on the server end, nothing changes. The only thing that is changing is the clientside prediction of their position, which makes it an assload easier for anyone with high ping to play the game.

    So long as:
    • Clientside prediction of projectile positions is correct (which is just a matter of estimating the position of a projectile by changing its position to compensate for the ping)
    • Clientside prediction of player models is correct
    Then the prediction of the characters knock-up should be accurate enough.

    Things that could be handled clientside could be:
    • Weapon switching (although this would mean that you could be hit by a spell by someone who has their sword out, etc)
     
    Collapse Signature Expand Signature
  9. Animal

    Animal Varangian Warthane
    Hero

    Joined:
    Mar 19, 2016
    Messages:
    819
    Likes Received:
    946
    If we're talking about a server tick rate of 60(making an assumption here. I don't think BPG has released that info), then that would mean we have about 16 ms per frame to handle everything that was polled from the client and sent over the network. We need to consider what bounds we're willing to set when coming up with a method for handling extrapolation. Problem is.... the problem definition may stay the same, but the cases vary quite a bit. How far ahead are we willing to "predict" when we have someone with 240 ms and a 15 frame disparity between what's actually happening? Now, realistically, it's taking 120 ms to send the packet to the server, 16 ms to handle the logic and update the game state, another 120 ms for the client to receive the packet, then the final (however fast your cpu is handling each frame in ms) client update and render.

    It may seem as simple as handling all collision on the client, then doing an interpolation between player and client reported positions over that frame, but it's a bit more in depth than that when trying to reconcile 7-8 frames in the past(considerably more in-depth because this is an FPS, actually).
     
  10. RootedOak

    RootedOak Cairn Giant
    Legend

    Joined:
    Oct 29, 2015
    Messages:
    2,594
    Likes Received:
    3,207
    I've heard that the server tick rate is 16. Only a rumor as far as I know though.
     
    Collapse Signature Expand Signature
  11. hirve

    hirve Goblin Shaman

    Joined:
    Apr 9, 2016
    Messages:
    62
    Likes Received:
    36
    if you have 240ms ping it's not going to be corrected next frame, it's going to be 120ms later (ping is usually based on RTT and done properly we only care about the server->client update here) (also add some more ms to account for the server tick rate)

    and like i said minor mispredictions to player position can give you very different trajectories. imagine landing a fireball to the left of someone's feet, when on the server it really landed to the right. your client is going to mispredict them flying away at pretty high speed, and when the server sends you the correct result they're going to teleport and suddenly change direction
     
    Collapse Signature Expand Signature
  12. MikeJT

    MikeJT Celestial
    Supporter

    Joined:
    Aug 28, 2016
    Messages:
    616
    Likes Received:
    368
    How's that worse than what's happening now?

    It is going to be corrected in the next frame your client receives.

    Lets say the servers 16 frames a second like @RootedOak suggested.

    That's 62.5 ms between frames.

    So my ping is 240.

    Frame:
    1. I see a knock-up spell hit the other client. Based on his position and where the spell connected, and his speed, he should move on a specific heading, so my game starts doing that.
    2. Nothing interesting
    3. My client receives a correct position based on the servers calculations. Assuming the player getting knocked up has the same ping I do, he gets moved to his correct position based on the servers reckoning.

    Compared to how it works now:

    Frame
    1. A knock up spell hits the other client.
    2. Nothing interesting.
    3. That player receives the information that he's been hit and he launches into the air on his screen.
    4. Nothing interesting.
    6. Server receives packets from knocked up player.
    7. Nothing interesting.
    8. The other client receives new position data from the player who then suddenly jumps up into the air.

    Really failing to see how the current state is beneficial to anyone?
     
    Collapse Signature Expand Signature
  13. hirve

    hirve Goblin Shaman

    Joined:
    Apr 9, 2016
    Messages:
    62
    Likes Received:
    36
    because going from nothing to moving at x speed is less bad than going from moving at -x speed to x speed

    we tried it in a much faster fps than darkfall (so being responsive is more important) and what you're suggesting looks awful
     
    Collapse Signature Expand Signature
  14. MikeJT

    MikeJT Celestial
    Supporter

    Joined:
    Aug 28, 2016
    Messages:
    616
    Likes Received:
    368
    What FPS?

    Did you ever consider that it looked bad because you did it badly? Did you consider that it looked bad because your clientside prediction of a) the character model, and b) the force knocking them up, was bad?

    I don't really care if it "looked awful".

    The game as it is LOOKS AWFUL.

    You're talking about something looking awful in the occasions where the clientside prediction is false, verse looking awful all the time because there isn't any clientside prediction.

    I'm trying to figure out why you think occasionally looking awful is worse than constantly looking awful?

    EDIT:

    I should also add, that Darkfall isn't the average FPS game.

    How many FPS games have a single server, for the entire world? None. Most people playing FPS games are playing on local servers with sub-50 ms pings.

    240 ping isn't something I'd normally tolerate in a game, even one with great clientside prediction and various methods to make the game easier to play at higher pings. I can play Counterstrike:CSGO on 200 ping servers in the states and it's an easier game to play than Darkfall. I've also played on 320 ms ping Planetside 2 servers, and it's still easier to play than Darkfall.

    Darkfall's netcode is horrible. It's not up to date. It needs to be changed and updated.

    I'm offering solutions. No one is going to put up with the crap that occurs in Darkfall because it's "an old game". No one cares it's old.

    Most players aren't going to 'learn to compensate for ping', they're just going to go play another game, because unlike Darkfall, most other games actually have decent measures in place to compensate for latency.

    Clientside prediction and latency compensation, interpolation of movement, rewind-time hit detection systems, and putting some functions clientside.

    Darkfall can't even accurately predict the hitbox location of someone moving in a perfectly straight line. It literally follows BEHIND THEM.

    This is horrible and really not up to a 2017 standard.

    There's plenty of other things "wrong" with Darkfall, but the inability to have anything even closely resembling a good experience with anything greater than 80 ms ping is a major issue.

    The lowest ping I played Darkfall with was 180 ms back in 2009-2012. Even that was laggy and difficult to play to at, but manageable.
     
    Collapse Signature Expand Signature
    #14 MikeJT, Aug 16, 2017 at 9:58 AM
    Last edited: Aug 16, 2017 at 10:14 AM
  15. NonFactor

    NonFactor Oak Lord
    Legend

    Joined:
    Jan 23, 2016
    Messages:
    3,013
    Likes Received:
    1,734
    lol dfuw physics

    awful
     
    Collapse Signature Expand Signature
    MikeJT and Fengor like this.