Sponsored By

Peer to Peer Connections for Online Infrastructures

In this first of two parts exploring online infrastructure options for game developers, we're examining the pros and cons between Peer to Peer connections.

Ulyana Chernyak, Blogger

September 19, 2014

8 Min Read

In this first of two parts, we're going to examine two forms of connectivity used when developing an online infrastructure for a multiplayer game. This is very important as without having a well developed infrastructure can ruin the online portion of your title.

PeertoPeer

For part one, we're going to examine Peer to Peer connections and the pros and cons that go into it. 

We're not going to go deep into the details of online infrastructures as that would be a bit too detailed for this post. But we can talk briefly about the basics.

Whenever you play a video game, go on a website or do anything internet related, you are sending and receiving data or uploading and downloading. Accessing data this way is done by using servers -- which is a running instance of an application that the user or "client" accesses. Normally servers are stored physically on computers, but the recent innovation of having "cloud servers" or servers not linked to a physical address but a virtual machine have been growing in popularity.

Steambox Valve was one of the first digital platforms to implement cloud server technology, allowing people to have their information available anywhere.

A major functionality of servers is that they require a specific client or program in order to access them. For video games, the client is running the actual game program on your computer when it comes to online titles like World of WarcraftLeague of Legends and so on. While you are playing the game on your computer, you are really accessing the server and sending and receiving data to it.

With that said, let's talk about our subject for today's post: Peer to Peer.

Peer to Peer:

Peer to Peer is where instead of connecting to a network, the different players or "peers" connect directly to each other and download and upload data. There is no central server for the players to connect to, which means that you are relying on the people that you are connecting to as opposed to the developer or server.

RiskofRain (3) Games that make use of direct IP online play is another example of Peer to Peer connections.

It's important to mention that besides storing the assets of a game (art, music, graphics engine, etc) the players also store progress, digital items and anything else that is related to their online account on their end. This is because there is no central server that holds the data.  Because of not having to deal with servers, Peer to Peer connections offer several advantages.

Advantages:

The obvious advantage is cost as it is less time consuming and expensive to rely on Peer To Peer as opposed to buying, maintaining and supporting servers. Because the players are connecting to each other, this allows a group of friends who may not have the best Internet access to play with each other if they are reasonably close to each other geographically.

Another great part of Peer to Peer is that it guarantees that a game's online functionality will remain even if the developer has to abandon it. Even without servers, players can still connect to each other to enjoy a game for years to come.

With that said, Peer to Peer has some major issues that can get in the way of a developer creating a long term online infrastructure.

Disadvantages:

While Peer to Peer is great for games built around a small number of players, it falls apart when we start talking about major online games. Because the players or peers take the responsibility of sending and receiving data, you are relying on your player base to all have stable and fast internet connections. The more users who are connected to each other mean more demand on the connections of everyone.

Major online games like BattlefieldCall of Duty etc can't work on a peer to peer connection as the chance of a player having an internet connection capable of handling all those players at once is slim.

Payday2(1) Games like Payday2 store player data on the users side, which makes them very vulnerable to being modded.

Another problem is security. Because all the data is stored on the player's machines, it makes it easier for someone with the right background to modify their game files to give them an unfair advantage. Since there is no central server to connect to, it makes it very hard to catch people with modded files. And trying to add some kind of security after developing a Peer to Peer connection can be very difficult.

Case in point would be Overkill Software's Payday 2. The developers use a Peer to Peer system where the player hosting the game becomes the server in a manner of speaking. If the host has spotty internet then that will affect all the players who are connected to them. And even with the host, players still have to connect to each other and can experience disconnects if they can't do it.

Not only that, but the game has had issues of people hacking their game to give them a lot of advantages which they can use to help or hinder other player's experiences. But even with these issues, there are times where a peer to peer network will work for you.

When to use Peer to Peer:

The first one goes back to cost, if you are a new studio and don't have the resources to support multiple servers, Peer to Peer is an attractive option to save money.

Another is the scope of your multiplayer; a 2 player co-op of the campaign is far less demanding compared to a 12 on 12 team deathmatch. Not every game needs to have extensive multiplayer and in many cases, Peer to Peer can work. If your game doesn't have Meta-game content or having progression that remains across your entire multiplayer career, peer to peer can be viable.

Next time we'll talk about why most developers prefer the client/server system when it comes to developing larger online games.

(Reprinted from the Xsolla.com Blog)

Read more about:

Blogs
Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like