-What is server tick rate?Why servers have those?(Because at least in my project, the server answers as soon as it can, but many games have servers answring, at best, once every 16ms[tick rate of 60hz])
Broadly, this is the rate at which the server updates the game-state and attempts to inform clients about it.
There are two reasons why this is capped. Firstly, it's because a game server might handle connections to
many players (remember that a "server", i.e. the physical computer hosting a game, might run dedicated servers for multiple instances of a game, or even multiple games) and because due to internet latency, games do a lot of "dead reckoning" to try and smooth over the interruptions/un-even-ness of the server's info.
A lot of multiplayer gaming is smoke-and-mirrors. If you were to watch a video of two clients side-by-side in many games, you'd be surprised at what is (and isn't) synchronised.
Usually the tick rate is set as high as it can be (to give the best experience), while also being as low as it can be (to avoid being wasteful). This is interesting in Battle Royale games like
Fortnite, because I believe that game's "effective" tick rate actually increases as players die (some aspects of the game "tighten up" as there are few players for the server to deal with).
-What should be handled on the server side, and what should not? What are the pros and cons of a system that handles most things on client side over another that handles on server?
This is an age-old question in multiplayer gaming with no firm answer. What should be handled in what area must (1) prevent cheating and (2) try to conceal the realities of networking from the player/to facilitate the game.
An example you might find interesting is how the original
Planetside worked.
Planetside had a very strong bias towards "client-side" hit detection, where the client would inform the server about more than, for example, would be the case in
Counterstrike 1.6 (a game which existed around the same time). This led to problems, though.
In
Planetside 1, say I had a good connection. I would run into an area, see another player, take a pot-shot and dart behind a wall. Then, suddenly, I die. Why? The reason is because the other player has a
bad connection. When I take cover on my screen, they still see me on theirs, running a hiccup-y second or so behind my view. They shoot me, and hit me, and inform the server they've hit me... So I die.
Now, this felt bad. Even at the time, there was no question this felt terrible. However,
Planetside was running ~200 player battles in 2003, so we just kinda accepted it, because those battles were so epic.
-Do communication between server and client need to use safe protocols?(In my case, WSS, or "websocket secure", but lets discuss a general case)Or a standard protocol is enough as long as there's no information about login and/or accounts being sent?
Sadly I don't know this; I'm not an expert on network security.
-How strong machines need to be to handle servers?(As long as the server isn't running within the game itself, but in a separate, much lighter, software)What about connection speed? Is it more important to have better ping or higher speed?
Servers can be quite primitive machines to run a single dedicated instance. I remember back-in-the-day (like in the days of
Unreal Tournament 2004) it was the norm to use an older computer. Dedicated server clients are pretty light.
In terms of internet connection, bandwidth is
less important because multiplayer games generally consume very little, even for a server (especially by the internet standards of today). The main things are latency/ping, and
consistency of your connection. If your connection is highly variable, this creates a bad experience for users. As for latency, you can't really control that, as it's based on distance (also the number of "hops" your packets make to get between the client and the server; generally more hops = more latency though that's a bit of a simplification).
The last thing I'll say is that I know I'm talking about
Planetside and
Counterstrike 1.6, but bear in mind that while many aspects of gaming have moved on since the 2000s, the aspects of networking for gaming for broadband users haven't, really. Fibre might get you slightly lower latency but ultimately it's quite similar now to how it was in 2005, as long as you're on broadband.
The analogy here is that while my internet connection here has tons more bandwidth than it did in 2005, it's like a road filled with cars. Bandwidth might give you a wider road, with more lanes, allowing more cars to travel - but an individual car still only gets to its destination in the same time (same speed, same distance).
Anyway, I hope this is helpful.