title: Client-side prediction & server reconciliation
body: <p>I’ve read some articles about client-side prediction and server reconciliation but I'm missing some parts, I take the part of client side prediction but I don’t  understand how exactly is reconciliation done. I’ll take these two pieces of well-known articles as reference:</p>
  
  <p><a href="http://www.gabrielgambetta.com/fpm2.html" rel="nofollow">http://www.gabrielgambetta.com/fpm2.html</a></p>
  
  <blockquote>
    <p>#2. So applying client-side prediction again, the client can calculate the “present” state of the game based on the last authoritative state sent by the server, plus the inputs the server hasn’t processed yet</p>
  </blockquote>
  
  <p><a href="http://gafferongames.com/networking-for-game-programmers/what-every-programmer-needs-to-know-about-game-networking/" rel="nofollow">http://gafferongames.com/networking-for-game-programmers/what-every-programmer-needs-to-know-about-game-networking/</a></p>
  
  <blockquote>
    <p>In effect the client invisibly “rewinds and replays” the last n frames of local player character movement while holding the rest of the world fixed</p>
  </blockquote>
  
  <p>Ok, I take that the client receives an acknowledgement from the server, but how exactly are the inputs re-applied? I can interpret this in two ways.</p>
  
  <p>From the client point of view, where the game loop is executed ‘x’ times per second (frames per second)</p>
  
  <p><strong>First:</strong> The non-processed inputs are re-applied in the same frame, so  here the expression “invisibly rewind and replay “ fits perfect because in the end what you see in the screen is the result for the last input re-applied.</p>
  
  <p>I don’t see the benefit of doing this because I see no difference between re-applying the last n inputs  from the server update to the present time and keeping the client state as it was before the update, we know in advance that the result will be the same.</p>
  
  <p><strong>Second:</strong> The  inputs are re-applied  one by one in the consecutive frames . A human being couldn’t notice a few frames being replayed but I cannot help thinking that if the client were experiencing significant latency he could notice himself going back to the past and replaying the last ‘n’ frames.</p>
  
  <p>Can anyone point me in the right direction , please?  Thanks</p>