Authoritative Server FAQ
An Authoritative server is a setup where the client sends instructions/information to the server.
Server verifies validates this, and updates the proxies and/or the client accordingly.
For instance, a client tries to move 1000 m/s; however, the server knows the maximum velocity for the client is only 10 m/s.
While the client, for a moment, may appear to move very far, they will be forced back into the correct position by the server.
Authority over clients.
Even if a player uses a hacked client to not allow the server to move them back to the correct position, the server's location will not reflect this.
The hacked client will be out of sync and fairly ineffectual to use in this manner.
How authoritative your server is depends on how you set everything up.
It does not occur naturally unless you make it as such.
This model is well suited for competitive games where client play against other players, it may not be necessary for games with a co-op story mode, “horde” mode, etc.
Pros
- Client-side hacking is much harder (near impossible in most scenarios)
- It's clear who has the authority and that there is one 'state' of the world that is used for all clients.
Cons
- To avoid input delay you would need client-side prediction. This might be hard to implement in some scenarios and with certain game mechanics.
- The Server will need to do more calculation (it will need to process all data to get the output and confirm to the client); this could make Server hardware pricier.
By using an Authoritative Server you can prevent the most egregious hacks, such as flyhacks, noclip, invulnerability, etc which ruin the experience for everyone.
For all the games on the list at the end of the page, if you search for cheats you will probably see “aimhacks” for FPS games, “scripts” for MOBAs, and “ESP” for all of the above.
Although MOBAs usually don’t send data for what clients cannot see (ie you cannot hack the fog of war) there are all kinds of alerts and info that can be presented that are not usually apparent.
As always you can use anticheat to make it hard to cheat, but it will always be possible to cheat no matter what.
Though encryption is pretty reliable.
What you can do is narrow down what kind of cheats are possible, and this is done by making everything relevant to gameplay server-side.
If your game does not have competitive multiplayer you can then make it nonauthoritative.
Each client instantiates their own player, replicates the values other players should see such as mecanim, health, using weapons/abilities, etc.
You do not need to care about Bolt hitboxes/physics, commands, or assigning control.
Building an authoritative game is not simple, for this reason, we've compiled some notes to keep in mind when building one:
- Photon Bolt comes with a fully authoritative game sample for a shooting game (Advanced Tutorial). This includes client side prediction and lag compensation;
- Make sure clients are not able to instantiate entities using Bolt settings;
- Everything relevant to gameplay besides players should be server side, such as inventory, score, NPCs, player created objects in the world, etc.
- Nothing should be owned by the client, commands should not be able to dictate anything besides input, events that impact gameplay should not be sendable from client.
You read more about server auth:
Example of games that uses a Server Authoritative
Most games are partially authoritative or not at all.
Here is a short list with some of the games that use this technique:
Games | |
---|---|
Fully Authoritative |
|
Mostly Non-Authoritative |
|
Deterministic Networking |
|
PS: Deterministic is not supported by Photon Bolt, use Photon Quantum instead.
Dedicated Servers
Photon Bolt supports a variety of models when hosting a game server (described below) and you do not have to pick only one:
Pros | Cons | |
---|---|---|
Official Servers That You Host |
|
|
Player Hosted Dedicated Servers |
|
|
P2P (Listen Server) |
|
|
If you want to use a relay server, Bolt comes with the Photon Cloud support, which integrates Bolt with Photon services.
This does matchmaking and LoadBalancing. You can also use Gamelift, Playfab, or another service.
Example of games that apply these models:
Games | |
---|---|
Official Dedicated Servers |
|
Player Hosted Dedicated Servers |
|
P2P (Listen Server) |
|