Search Unity

Completing Simple Server reconciliation

Discussion in 'Multiplayer' started by WirealTalha, Jan 20, 2020.

  1. WirealTalha

    WirealTalha

    Joined:
    Jul 19, 2018
    Posts:
    142
    Scenario:
    Unity 2d Game.

    I just want to understand this concept
    e.g "the user taps on a Box and the Box Starts to move up and down"

    How does one go around implementing server reconciliation on this simple thing? So that We can track the Coordinates of the box and check whether the values are right or someone cheated and changed the coordinated of the box.
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    The box probably has a maximum speed it should be able to move. You'd simply have the server calculate the box's speed periodically based on the position updates it is receiving, and if that speed is significantly higher than it should be then you've got a suspected cheater.

    Variability in network packet transmission speeds can add a bit of noise to the speed calculation, but if you find that to be a problem you could consider including timestamps in the position updates to help you smooth that out. Or you could calculate speed over longer time spans, such as checking between two points 20 seconds apart instead of between each position update.

    The most important thing is to avoid false positives, because someone not cheating who is accused of doing so is far worse than missing an actual cheater. So don't get overzealous in your enforcement. My opinion at least. (For example, I used to play a game where they were very aggressive in their speed enforcement, but didn't account for how fast your character moves when you fall off a cliff. So when you fell off a cliff not only would you die but you'd get auto-banned for speed hacking. It certainly pissed off a large percentage of the player base to say the least.)

    Alternatively, you could just use server authoritative movement for everything, then you don't have to worry about this issue much.
     
    Last edited: Jan 21, 2020