I am developing a 2D platform and shooting video game in Unity 2D with authoritative logic / physics on the server (The physics server is also developed in Unity to be able to use the box2D library on both the client and the server).
Currently I am working on the basic communication functionality between the client and the server using socket to send the client's inputs to the server and executing the physics on it. And this is where I find myself with a question that I can't solve after searching a lot on google and forums. When should you send the client's inputs to the server? Setting a delivery tickrate or each time the user clicks on the controls?
As I have analyzed on my own, what seems more efficient at first is to send the inputs to the server each time the client presses one of the game controls. And on the other hand that the server sends the clients the status of the game (player movements, changes in physics, etc.) using a tick rate. This is a diagram of the communication and behavior that I am developing:
As you see this operation. Should I also set a tickrate on the client?
Thank you very much.