Authorative Server Questions. (Am I overthinking it?)

Curious as to how things would be done from an authoritative servers perspective, lets say that for now I’m using Unity3D’s built in networking, here’s how I have it mapped out in my head.

  • Client ~ Pressed Key “W”
  • Client ~ Sends RPC To Server stating PlayerID pressed “W”
  • Server ~ Recieves RPC and calculates what to do
  • Server ~ Updates Clients position (If possible) and sends RPC to the Player(s) Buffered.
  • Client ~ Processes the Movement RPC and Moves accordingly.

Would this be a good way to write out an Authoritative server?

Am I missing some concepts? Am I over-thinking it?
Let me know.

If you want the game to feel smooth in the presence of lag you need to start moving the player locally already when he pressed W key; then use the server to correct the player’s position. Obviously, some form of interpolation on this correction is required or the player will be warping.

Client presses W to go forward and sends it as an RPC to the server. The server receives the RPC, knows which client has sent it. Moves the object. The client gets updated through serialization of the position.

How this is solved depends quite a lot on the game in question, but assuming a fast paced action or first person game, there are quite a few details you are missing.

First of all, never send user input as reliable RPCs. Input data should always be sent in a redundant (say always send the last 3 inputs recorded) but unreliable way.

Secondly, if you only allow the server to move clients around your players will notice considerable input-lag. What you need to have it a way for the client to use the local input right away, and then allow the clients to correct their own input simulation depending on the servers actual result. This is called Input Prediction and all modern action games use it.