FUNDAMENTALS OF GAME DESIGN, SECOND EDITION
Disadvantages of Online Games
Playing games over a network, especially the Internet, presents the designer with certain disadvantages, as well. This section discusses some of these technical challenges, as well as the ongoing responsibilities of providing new content and customer service. You should also be aware that strangers playing your game anonymously over a network can cause social friction and that this can range from minor misbehavior to serious criminal offenses.
Although this is a book about game design rather than programming, you need to be aware of certain technical issues for online games that local games don't have to address. This section doesn't go into them in great detail, but aims to make you familiar with these technical considerations. If you design an online game you will need to discuss them with your programming team.
Your programming team will need to choose a communication model from the two currently in use in networked gaming. In the first, client/server, each player runs a program, called the client, on his computer, that communicates with a central program, the server, on a computer owned by a company providing the game service. In the client/server model, the server runs the game engine, sending packets of information to the various clients, and the clients merely present that information to the players.
The other model, peer-to-peer, involves direct communication between the players' computers. Implementation of peer-to-peer (sometimes abbreviated P2P) communication is quite straightforward for two-player games but becomes more complicated as more players are involved. The players' systems must decide which machine to designate as the host—that is, which will control the game while the others become guests. If the host logs out of the network, one of the guests' computers must take over and become the new host—preferably automatically and without anyone's noticing (this is known as automated host migration, a feature already supplied by Microsoft's DirectPlay facilities). Some companies also operate matchmaking services in which the company's server functions only to allow players to find one another and connect together in peer-to-peer networks. All of this is programming work that offline games don't have to bother with.
The Internet is designed for redundancy rather than speed, so it doesn't make any guarantees about how long a given packet of data will take to get from one point to another. This phenomenon is called latency. In many games, a faster connection translates into a gaming advantage, making players with high-speed connections more likely to win the game. You can design around this by making your game
turn-based or trying to match up opponents on the basis of their connection speeds. At the moment, there is no one satisfactory answer.
What happens to your game if it doesn't get some of the information it needs because of a glitch in the network? Your system will require a mechanism for detecting a missing packet or one containing bad data, and requesting that the packet be resent from the server or host. Packets can also arrive out of order, which can cause confusion if your client receives information that a race car is about to cross the finish line, but the next packet indicates that the car is 100 yards back on the track instead. Every packet must have a unique serial number, in sequence, so that you can tell if one is missing or if packets are arriving in the wrong order. Fortunately, middleware companies are starting to offer software packages to help manage this problem.