In this chapter, you’ll learn how to send and receive data over a network. The projects built in previous chapters represented a variety of game genres, but all have been isolated to the player’s machine. Connecting to the internet and exchanging data is increasingly important for games in all genres.
Many games exist almost entirely over the internet, with constant connection to a community of other players; games of this sort are referred to as massively multiplayer online (MMO) and are most widely known through MMO role-playing games (MMORPGs). Even when a game doesn’t require such constant connectivity, modern video games usually incorporate features like reporting scores to a global list of high scores, or they record analytics to help improve the game. Unity provides support for such networking, so we’ll be going over those features.