I'm currently working on an online game and basing my networking architecture around this Source Multiplayer Networking article. However, I'm a little stuck on how the user input works. The article describes that a snapshot of the keyboard/mouse state is sent from the client at the same tick rate the server is running. I am doing this in my game, which seems to me working pretty good, but the simulation on the server is slightly different then the client prediction resulting in the clients player eventually becoming out of sync with the server. I believe this discrepancy is a result of ping jitter.
For example, if the client is sending input every 25ms, theoretically if the server is receiving input every 25ms it will have an identical simulation. However, with any jitter, the server might not receive any input for 30ms for example. This means it will not be able to process the input until the next tick because it didn't arrive on time, and the entity on the server will become out of sync with the client eventually.
What are some methods for solving this issue? Maybe I'm missing something in the Source Multiplayer networking example. If anyone could explain better or provide any advice it would be much appreciated.