I'm starting to create a multiplayer online game, with an authoritative server. As it is, the clients send inputs to the server which do the simulation and then send back to clients the updated state. The game is a top-down shooter, so it's fast-paced and input lags are not allowed here, so to avoid this I'm doing the simulation on the client too, and when the server update come back I compare the local simulation with the server response. If they are compatible everything is fine, otherwise, the client version is corrected.
I was expecting that the client simulation desync at some point, because of all of the variables on physics, floating points, network etc... But this happens much more than I thought.
Just by sending the inputs and simulating on the server, the results are very different, even on simple movements, like forwards and backwards on a clear space.
Green is local, red is server response
I need help on this step, a way of keeping, at least this kind of simple movement, consistent on the server and the clients.