Chapter 10. Network Programming
Playing against human opponents is more rewarding than playing against a machine or, even worse, playing alone. Games such as football, chess, and hundreds of others teach us how competing against an opponent creates addiction— a desire to play repeatedly, well beyond the shorter entertainment value of automatic opponents.
Ever since the first multiplayer games appeared, their popularity has been steadily increasing. Although today it seems clear that both single-player and multiplayer games will exist in the future, it is in the multiplayer arena where some of the most interesting innovations are taking place.
In this chapter, we will explore the techniques required to create multiplayer games. From the foundations of Internet protocols to game-specific optimization techniques, we will try to cover lots of ground that will allow you to create compelling online gameplay experiences. The first few pages of this chapter will provide a thorough overview of the fundamentals of network programming. Once we are able to create reliable client-server systems, we will deal with networked game issues.