Chapter 18. Multiplayer Games
In earlier sections of this book, we discussed the difficulty of creating true artificial intelligence. Although we dabbled in some light artificial intelligence earlier, the really complex algorithms used in the latest games are well beyond the scope of this book. You’ve probably realized by now how complicated it would be to really mimic a human player. It’s so complicated that in many cases, depending on the game, it’s downright impossible.
Chances are you’ve played a Real-Time Strategy (RTS) game where the computer player leaves his base too unguarded, or a football simulation game where there’s one defensive play that stops the offense every single time, no matter what offensive play was called. This is one reason why multiplayer gaming is such an enjoyable experience; there really is nothing like playing against a real, live human opponent. Throw in the fun of trash talking and stat crunching and the general pride that typically results from winning these games, and multiplayer gaming can really become addicting.
In this chapter, we discuss different means of implementing multiplayer functionality in your games. First, we look at adding split-screen functionality to your game, and then we walk through building a new game using the XNA Framework networking API.
Split-Screen Functionality
One way to add multiplayer functionality to your games is to implement a split screen on a single monitor (for the PC) or television set (for the Xbox 360). Split ...
Get Learning XNA 4.0 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.