I understand how client side prediction works. I have some questions which I need to clarify:
- What exactly do we send in the userCmd? In my case, what are the information I should be sending for a fps shooter?
- When do we send it? In the main animation loop of the client?
- If the server runs the game at 60 fps and the client runs the game at 30 fps, the client will always snap back even after server replaying the stored commands. To fix this we will need to update the game based on deltaTime right?
- If the server runs the game at 60fps does that mean it should send the updates at that rate too?
- In a first person shooter, should I correct the yaw and pitch of the player after receiving the update from the server too?
- In the history (on the client) what should be good to store? delta positions or user commands? The player will have multiple forces acting on it. Should the server update also send current velocity in this case too? I don't think it needs to do that. I can go about with the current velocity even after I have received an update from the server. Is that correct?
Lag compensation: This is something I don't fully understand. If the player shoots another player, the player's yaw and pitch are obviously different on the server. How should I register a hit in here?