Page 1 of 16 1 2 3 11 ... LastLast
Results 1 to 10 of 159

Thread: Anti-latency (server-side hit detection / correction)

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    16

    Anti-latency (server-side hit detection / correction)

    I recently made a tool for Halo CE that draws other players slightly ahead of where they are, using their velocity and your ping. That is, it draws them such that you can often shoot without leading. It works for vehicles too. It is not perfect; obviously, there is no way of predicting that a player will change direction. "Draw" is also the wrong word, as it does actually affect the physics in a weird way (but only briefly, unlike one of the prototype versions, which constantly had players falling through the floor).

    What would be better is if the server could correct the actions of players based on their ping. For example, the server could store the positions of players for the last second. I am not sure how many positions that is (how many updates there are per second) but I am guessing it might be 30 positions for each player. Then, when player X fires a shot (and the server is doing the collision test for the shot), all other players would have their position (temporarily) set to one of the earlier stored positions (depending on the ping of player X). Hence, player X would not need to lead his shots, although the actual hit would still be delayed.

    This is a slightly simplified example. Ideally, all objects could have their positions and various other important state information stored from the previous 1 second (or the maximum allowed latency that is desired). I am also not certain how easy it is to relate events (such as the collision test of a vehicle that has been pushed by a player) to the player that caused it and how easy it would be to hook into the code for these different types of collision tests. I guess it would also be challenging to identify which bits of state need saving, especially if other objects are referred to.

    I thought this idea seemed like a rather naive form latency correction and that it may not really work well enough in practice. However, I recently saw that Valve's Source engine uses this type of hit detection. Therefore, I guess it can work well.

    This does allow the situation where player X appears to be in cover on his screen, but is killed by player Y, because the latency of player Y caused player X to be moved back out of cover when the server performs the hit testing. However, this is usually the case with any kind of hit detection that does not require players to lead their shots and I think it is probably a reasonable sacrifice. A limit could also be set on how much latency correction is applied.

    I have thought about implementing this, but I fear that my knowledge of Halo's engine is probably too limited. I am also just about to start some other work that I should probably give priority to. I don't know much about Halo's object list and how objects are deleted/added etc. I don't know where the different collision tests are performed and what parameters are accessible. I thought that, to start with, it might be worth just trying a proof of concept, where only player positions are stored and only immediate hit tests (e.g. pistol?) are considered. I remember in the Halo 2 engine you could figure out who had caused the damage (or who owned the bullet), but I can't remember the details. Thus, I think it would be possible to intercept the hit detection function and adjust player positions as explained above.

    I know that "idea" posts are not appreciated, but I hope those with a good knowledge of the Halo engine can see that this is perhaps reasonably plausible. Of course, I have probably missed many issues that would arise and maybe this is just not feasible. I may attempt this one day, but it would be even better if those more knowledgeable are interested in trying it.

    (On a somewhat related note, does anyone know the units of velocity that is found in Halo's memory for players? How many updates are there to player positions per second? The overall related question: What is the formula for working out where a player should be drawn given the velocity and current position (of others) and ping (of the client)?)
    Reply With Quote

  2. #2

    Re: Anti-latency (server-side hit detection / correction)

    The latency and leading are what keeps bringing me back to this stupid, terrible game lol
    Reply With Quote

  3. #3
    +rep to cure coronavirus n00b1n8R's Avatar
    Join Date
    Oct 2006
    Location
    Australia
    Posts
    13,214

    Re: Anti-latency (server-side hit detection / correction)

    The latency and the leading is what keeps me leaving this stupid, terrible game lol
    Reply With Quote

  4. #4
    +rep to cure coronavirus n00b1n8R's Avatar
    Join Date
    Oct 2006
    Location
    Australia
    Posts
    13,214

    Re: Anti-latency (server-side hit detection / correction)

    Can you post a video of this in action? I could see it being useful for ranged engagements but it sounds like it would make pistol strafing and close quarters stuff really confusing.
    Reply With Quote

  5. #5
    El Durado :/
    Join Date
    Oct 2006
    Posts
    2,417

    Re: Anti-latency (server-side hit detection / correction)

    i'm intrigued
    Reply With Quote

  6. #6
    Senior Member sanni's Avatar
    Join Date
    May 2010
    Location
    SPARTAN
    Posts
    117

    Re: Anti-latency (server-side hit detection / correction)

    I rather would be interested in Halo CE with Halo PC netcode.
    Reply With Quote

  7. #7
    Junior Member
    Join Date
    Sep 2011
    Posts
    16

    Re: Anti-latency (server-side hit detection / correction)

    Quote Originally Posted by TPBlinD View Post
    The latency and leading are what keeps bringing me back to this stupid, terrible game lol
    I know what you mean. But, this is not how the game was meant to be played. It also means the leading depends on your connection, which means it is inconsistent (across servers, players, etc.). Introducing people to Halo PC (the upcoming release of Halo Anniversary means people are more likely to get back into Halo 1) is difficult due to the inconsistent and confusing leading. I believe more recent versions of Halo require leading, but this is not caused by network latency - the bullets are just slow. Thus, when you are in close range combat, no leading is required. Otherwise, the amount of leading depends on how far away your target is, which means even more skill is needed (adjust lead based on feedback and by judging the distance). This could presumably be added to Halo PC quite easily server-side, if desired. Weapons like the sniper rifle could have no leading, as you might expect.

    Quote Originally Posted by n00b1n8R View Post
    Can you post a video of this in action? I could see it being useful for ranged engagements but it sounds like it would make pistol strafing and close quarters stuff really confusing.
    I am not sure why you would think this (hopefully that doesn't sound too patronising!). I find it particularly effective for close quarters stuff, as judging the player's velocity (without the tool) is much harder when you are right next to them!..spinning round etc.

    This video is unable to be displayed because the YouTube video tags were used incorrectly. Please review proper use of the tags here.

    I would have liked to have provided better footage, but even this took a long time to capture and upload. I have amazing ping for the first and third segments, but the middle segment I have about 100 I think. Sorry for the poor gameplay/skill. As hinted before, I have not got the prediction amount/formula correct so I manually adjust it during gameplay. For example, when shooting the guy in the warthog, I would be getting an instant kill if I had the prediction amount correct (from experience).

    As I said before, the prediction can be incorrect if players change direction. This would NOT be the case if this correction was done server-side (as it would not be a prediction) - this is what I am proposing. (EDIT: The server would remember the history of positions of player hitboxes and they would "lag" behind at the server. Players could then shoot at players on their screen and when the message reaches the server, the lagged hitboxes should be in the position so that the shot hits. This is a simplified explanation, as the lagged position of the hitboxes differs depending on who made the shot - it is their ping that decides how much to lag the hitboxes. Here is an explanation for Vale's Source engine games - e.g Counter Strike - http://developer.valvesoftware.com/w...g_compensation . Note that player positions are moved back only to do a calculation. The clients never see this.) The main source of error would be inconsistent latency or not being able to get an accurate enough measurement of latency (from client to server).

    Quote Originally Posted by sanni View Post
    I rather would be interested in Halo CE with Halo PC netcode.
    Why wouldn't you just play Halo PC? (I can't remember the disadvantages - can't most Halo CE features be added to Halo PC?). What are the main noticeable differences (problems) in the netcode? I did happen to notice (in Halo CE) the variables "use_new_vehicle_update_scheme" and "use_super_remote_players_action_update", which are set to true. These can be set to false by patching your server to enable devmode. I have no idea if this would make it more Halo PC-like.
    Last edited by PaulusT; September 30th, 2011 at 04:31 AM.
    Reply With Quote

  8. #8
    Kid in the Hall Kornman00's Avatar
    Join Date
    Sep 2006
    Location
    ◕‿◕, ┌( ಠ_ಠ)┘
    Posts
    3,130

    Re: Anti-latency (server-side hit detection / correction)

    Quote Originally Posted by sanni View Post
    I rather would be interested in Halo CE with Halo PC netcode.
    Custom Edition uses the same networking code as PC.
    Reply With Quote

  9. #9

    Re: Anti-latency (server-side hit detection / correction)

    This sounds like quite an interesting idea. I think you'd need to modify the collision system that Halo uses based on which objects are owned by which player. I've never actually looked at Halo's collision detection, but I assume it's quite complex. Pretty cool idea, might be fun to have a look into.
    Reply With Quote

  10. #10
    Senior Member
    Join Date
    Mar 2009
    Posts
    119

    Re: Anti-latency (server-side hit detection / correction)

    I'm a little confused about what this does exactly. Does it change where players are drawn or does it change their actual positions based on ping?
    Reply With Quote

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •