Game Development Reference
In-Depth Information
Chapter 12. Networked Games
Networked games allow multiple players to connect over the Internet
and play together. Some of the most popular games in recent
years—whether Halo , Call of Duty , or World of Warcraft —either sup-
port networking or are exclusively networked games. Playing with or
against another human provides an experience that even today cannot
be matched by an AI.
Implementing networked games is a complex topic, and there are entire
topics on the subject. This chapter covers the basics of how data is
transmitted over a network and how games must be architected differ-
ently in order to support networking.
Protocols
Imagine you are mailing a physical letter via the postal service. At a minimum,
there is an envelope that has the addresses that define both where the letter is from
and where it is going. Usually there also is some sort of stamp affixed to the letter,
as well. Inside the envelope is the actual data you wanted to transmit—the letter
itself. A packet can be thought of a digital envelope that is sent over a network.
A packet has addresses and other relevant information in its header , and then the
actual data payload it's sending out.
For envelopes, there is a fairly standardized method of addressing. The from ad-
dress goes in the top-left corner, the destination address is in the middle right, and
the stamp goes in the top-right corner. This seems to be the norm in most coun-
tries. But for networked data transmission, there are several different protocols , or
rules that define how the packet must be laid out and what must happen in order to
send it. Networked games today typically use one of two protocols for gameplay:
TCP or UDP. Some games also might use a third protocol, ICMP, for some limited
non-gameplay features. This section discusses these different protocols and when
they might see use.
Search WWH ::




Custom Search