We are making a multiplayer co-op game, where players will shoot not each other but AI enemies (creeps), controlled by the game. The chosen implementation is client-server with an authoritative server. Edit: we use client-side prediction for both creeps and avatats to give the illusion of immediate responses. So far we managed to make creeps movement syncronized on the client and the server, that is at the same point in time each and every creep are located in the very same place on the client and on the server.
However, the player avatars cannot be syncronized in this way - it is simply impossible. Player avatar will always lag on the server. Now the problem arises when we try to shoot and hit the creeps. The two avatars (client and server ones) will fire bullets in different places (because one lags from another), but the creeps positions are equal. Bullets hit almost instantly, which means that quite often the bullets will not hit the creeps on one of the machines and, as the server is authoritative, it will have the final say in what actually happened. Ofcourse such behaviour is unacceptable.
One solution would be to force creeps to lag on the server, but that is a poor solution as the lag (ping) may vary dynamically and, more importantly, the game is designed to allow for up to 4 player multiplayer mode and I cannot even start to think, how to fit this solution to other players' bullets.
The only thing I could find so far on the internet is the fact that in FPS multiplayer shooters you see your opponent in the past and the server "rewinds" each of you before hit-scanning. But how do you exacly implement this? Do you keep the list of recent positions/actions on the server? But what if hit-scanning involves taking skeletal animation into account? Do you store recently played animations aswell? Any advice would be appreciated.