Game Development Reference
In-Depth Information
Chapter 7. Playing Games with Friends
One of the biggest features in modern games is multiplayer, either over the internet or
on a local network. Xbox Live, for example, is one of the largest multiplayer networks,
and games such as Halo and Battlefield have incredible communities that sometimes
never even play the single player component of the game. For this reason, multiplay-
er is a valid and powerful concept that should be considered for your games, although
it may not always be appropriate for what you are creating. If your game doesn't fit a
competitive mode of multiplayer, consider a cooperative mode. If multiplayer doesn't
feel like it matches the experience that you want to provide, leave it out. The important
thing is to ensure you focus on ensuring quality and fun, rather than adding in features
that might not work.
One thing that I've omitted so far is a user interface system. This is crucial to multi-
player gaming as you need a way for the user to choose the multiplayer option and
then receive information about who they are connecting to and even the status of the
connection. For this reason, I'm going to explain a simple user interface system and
how to go about implementing it so that you'll be able to if you want to add polish to
your game, and even add a multiplayer mode.
After that small diversion, we'll look at what goes into multiplayer in modern games
and your options for implementing that on Windows 8. You'll get an idea of how
to make a connection to another machine and how to communicate data using the
newly-styled Socket APIs and DataReader / DataWriter .
Later in this chapter you will have:
• Learned about the Proximity API and game discovery
• Looked at the topology of networked games
• Learned about sockets and how to use them
• Learned how to implement a user interface
• Learned how to communicate between different machines
A better menu system
In this section we will look at the changes that need to be made to move from basic
text support to a slightly more advanced user interface system that we will need for
Search WWH ::




Custom Search