Authoritative Servers, Relays & Peer-To-Peer - Understanding Networking Types and their Benefits for each Game Types
Key Takeway
Gain insights into the contrasting aspects of authoritative and peer-to-peer (P2P) networking, including the role of relays. Discover how these networking models differ in terms of control, distribution, and their ideal use of key considerations such as speed, scalability, security and costs.
Section 1 – Breaking Down each Networking Type
Authoritative Servers
Authoritative networking refers to a network model where a central server or authority retains control over the network. This centralized approach ensures the server has the final say in decision-making processes. It validates and distributes information to connected clients, maintaining strict control over network operations.
Key Game Genres: Time-based matches, namely First-Person-Shooter (FPS), MOBA, Sports, Fighting Games, Battle Royale, etc. Or a persistent world that requires fleet managers, such as MMO, Metaverse, etc.
Examples of Games that use Authoritative Servers: Fortnite, Roblox, Valorant, Overwatch, League of Legends, Apex Legends, PUBG, Rust
Key Benefits
Centralized control and decision-making
Easier implementation of security measures
Direct client-server interactions
Main Drawbacks
Higher chance of lag due to increased network traffic due to a centralized server
Single point of failure Limited scalability
Extremely Expensive (idle costs, ongoing server costs, regions)
Peer-To-Peer Networking
Peer-to-peer (P2P) networking takes a decentralized approach, allowing participants (peers) to communicate directly with each other. In a P2P network, there is no central authority governing the interactions. Participants collaborate and share information instantly, without relying on a central server for decision-making.
Key Game Genres: Can work for any game genre; either for certain gameplay mode or entire multiplayer experience
Examples of Games that use Peer-To-Peer Networking: Super Smash Bros, Call of Duty, Grand Theft Auto V (GTA V), Red Dead Redemption 2 (RDR 2), Destiny
Key Benefits
Easy to set up by game developers, and free to maintain
Scalability and distribution of workload
No dependency on a single server
Main Drawbacks
Lack of centralized authority for security, making games highly susceptible to DDoS attacks and unusable for games with in-game economies or GaaS games
Dependent on the quality of the “host” connection quality (e.g., high lag)
Difficulty in coordinating and synchronizing peers
Players commonly blocked by network address issues (NAT) or blocked ports; so common they require entire Support pages!
Network of Relays
Relays elevate and solve the common issues of Peer-To-Peer as “intermediary” servers that facilitate communication between players. Relays act as bridges, relaying messages between peers that cannot establish direct connections. By relaying data between players, they play a crucial role in establishing connections between players who may encounter obstacles such as firewalls or network address translation (NAT) issues.
Key Game Genres: Can work for any game genre; either for certain gameplay mode or entire multiplayer experience
Examples of Games that use Relays: Minecraft, Rocket League, Among Us, Sea of Thieves
Key Benefits
Greatly reduces the possibility of cheating
Facilitates communication in P2P networks
Enables connection establishment behind firewalls/NAT
Enhanced network resilience and redundancy
Main Drawbacks
Dependence on the availability of Relays
Complexity in setting up relays and operating them
Limited reach of free resources (e.g., Unity, Photon, EOS)
Section 2 - Comparing Features by Key Benefit Type
Latency
10+ Players/Lobbies
Winner: Authoritative Servers
Due to their capacity to reduce latency, authoritative servers are the best option for multiplayer games with a large player base. They serve as a central node, minimizing the number of network hops and the distance data must travel. Authoritative servers can be placed strategically in areas with high player density to lower overall latency for all participants. They also can use advanced latency compensation strategies to improve responsiveness, including client prediction and server reconciliation.
In peer-to-peer networking, one player must be the host (i.e., the server). This implies that the host’s internet connection quality affects how well the game is played. Everyone will have a bad experience if they have a bad internet connection.
A network of relays is not ideal for large multiplayer games due to scalability limitations. Increased player numbers can lead to higher latency and network congestion. Relays introduce additional hops, resulting in delays and decreased responsiveness. Managing a network of relays for a large player base becomes complex. Dedicated servers or multi-cloud server-based approaches are preferred for optimal performance and scalability.
2-10 Players/Lobbies
Winner: Authoritative Servers
Even with a smaller player count, the centralized nature of authoritative servers ensures low latency, as data only needs to travel to a single server. Automation would ensure its deployment at the ideal location, ensuring the lowest latency possible, as proven by a AAA Studio's case study with Edgegap.
2 Players/Lobbies
Winner: Relays
With only two players, the additional hop introduced by the relay does not significantly impact latency. As proven by Edgegap’s 1v1 case study with a major publisher.
Scalability & Complexity
Here, the team size will likely impact the type of solution needed, as how many developers are available will affect how much control and complexity you can genuinely take on.
The ease of use of peer-to-peer networking is one of its main appeals. For projects and games with an expected low concurrent player base or smaller studios, the default winner as P2P games has the major benefit of allowing you to create your entire game using a single codebase and never leaving your game engine. You don’t have to run any servers – your players do them for you.
However, peer-to-peer has limitations – security, player experience related to hosting and latency. Additionally, you need a Netcode and Matchmaker anyway and to prevent IP leakage or your game from being blocked by firewalls, you should run a relay.
Thus, while direct P2P may seem like the most accessible and most scalable option, building your multiplayer with relays is a must and likely preferable for projects seeking commercial viability. Automated “backend-as-a-service” will help all developers solve the challenges of building and maintaining relay networks.
For large projects, authoritative servers provide the ability to scale and the level of control required for major studios and publishers. However, some solutions allow game studios of any size to get AAA quality with zero backend developers. Learn here how Soliton Interactive externalized its game server orchestration and backend entirely to focus its resources on game development.
Reliability & Security
Authoritative servers are, by far, the best solution for multiplayer game hosting, particularly regarding security.
With authoritative servers, the central authority maintains control, ensuring a secure environment for gameplay. Unlike peer-to-peer (P2P) networks, where individual players have direct access to one another, authoritative servers act as intermediaries, mitigating the risk of DDoS attacks targeting players' IP addresses.
Additionally, authoritative servers overcome NAT issues, allowing players behind restrictive network configurations to connect seamlessly.
This centralized approach enhances privacy by reducing the exposure of players' IP addresses to other participants, providing a layer of anonymity.
However, authoritative servers can be expensive to set up and operate, thus not being the ideal solution for smaller projects. Relays act as intermediaries, helping to mitigate DDoS attacks by shielding players' IP addresses, as the attack targets are the relay servers rather than individual players. They also serve as practical tools for overcoming NAT issues, enabling players behind firewalls or restrictive network configurations to establish connections without complications.
In other words, they provide all the benefits of authoritative servers regarding security and reliability, minus the said “authoring” of gameplay.
Disclaimer: If you game as in-game economy, it is mandatory it uses authoritative servers or relay network.
Costs
10+ Players/Lobbies
Winner: Authoritative Servers
Rather than investing in and maintaining dedicated infrastructure, game developers can leverage authoritative servers on a usage-based payment structure, aligning costs with actual demand.
This allows for better cost management, particularly multiplayer games with fluctuating player counts. By only paying for the server resources consumed during gameplay sessions, developers can optimize their budget and allocate funds more effectively.
Additionally, the pay-per-use model eliminates the need for upfront capital investments, making it a more financially viable option for game developers.
Currently, this “pay-per-use” model is only available through backend-as-a-service providers, such as Edgegap, as major cloud providers such as AWS, Azure, or Google Cloud will ask players to pay per region and pay for a minimum number of servers every month.
2-10 Players/Lobbies
Winner: It depends
The particular needs of the game, such as synchronization requirements, real-time responsiveness, and gaming mechanics, are vital in identifying the best networking solution.
A system with low latency and accurate synchronization, like authoritative servers, may be desirable for quick-paced action games.
On the other hand, a peer-to-peer strategy might be sufficient for more casual or turn-based games, offering simplicity and cheaper costs.
Ultimately, the choice of networking solution should align with the game's objectives, ensuring a seamless and enjoyable multiplayer experience tailored to the specific player count and gameplay dynamics.
2 Players/Lobbies
Winner: Relays
While peer-to-peer is free, saving money may sacrifice a game’s experience when optimizing for cost. As such, relays with pay-per-use model such as Edgegap’s provide the ultimate level of quality and payment scales with the level of success.
Legacy Games
Due to the high operating costs, games with small player bases may need help to afford to run authoritative servers across various locations. A pay-per-use model for authoritative servers offers the best alternative, even though a move to peer-to-peer networking appears as the most likely solution.
With a pay-per-use model, game developers can leverage authoritative servers when needed, eliminating the complexities and costs of maintaining and managing peer-to-peer infrastructure. The scalability of this architecture is made possible by the demand-based resource allocation, which guarantees peak performance even with a small player base. Pay-per-use servers also retain superior security and dependability compared to peer-to-peer connections, reducing the likelihood of fraud and disruptions.
Legacy multiplayer games may continue to provide smooth and secure gameplay experiences while optimizing resource allocation and lowering operational costs by switching to a pay-per-use model.
Section 3 – The importance of Netcode
When creating a multiplayer game, a robust netcode is essential because it directly affects the overall player experience. The networking framework and code known as "netcode" allows players to communicate easily and quickly. It involves important factors like fairness, synchronization, and latency.
In other words, a well-designed netcode assures less lag and delays, allowing for seamless real-time player interaction. It also ensures that game states are accurately synced across all clients, avoiding inconsistencies or undue advantages.
Mirror Networking, a free and open-source technology, comes in handy in this area. It offers features like authoritative server support, network prediction, and adjustable synchronization options, giving developers a solid basis for creating multiplayer games. Mirror Networking makes it easier to construct solid netcode thanks to its accessibility and adaptability, enabling developers to produce captivating and immersive multiplayer experiences.
Section 4 – Choosing the Right Model for Your Needs
When deciding between authoritative and P2P networking models, consider the nature of your application or system. If centralized control, secure communication, and direct client-server interactions are crucial, authoritative networking might be the better choice. Conversely, if decentralization, scalability, redundancy, and the ability to work around firewalls or NAT issues are priorities, a Relay Network or direct P2P network could be more suitable.
Written by
the Edgegap Team