O'Reilly logo

Learning XNA 3.0 by Aaron Reed

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 17. Multiplayer Games

In earlier sections of this book, we discussed the difficulty of creating true artificial intelligence. While 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 an RTS (Real-Time Strategy) 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 section, we'll discuss different means of implementing multiplayer functionality in your games. First, we'll look at adding split-screen functionality to your game, and then we'll 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required