Game Development Reference
In-Depth Information
The server in this case is a generic server implementation that provides the basic
interaction among player clients. For simple games such as chess, tic-tac-toe,
multiplayer jigsaw, and even racing games, the generic server works well. The
downside of it is security, because there is no special logic specific to the game to
detect cheats by a modified or a hacked client, making it harder but not impossible.
Network programming paradigm
The most basic implementation to communicate between two computers is sending
messages between the computers. The networking standard was set in place in
the late 70s by the International Organization for Standardization ( ISO ). Things
have not changed significantly since then in terms of the low-level communication
protocol. However, the speeds of the hardware that enable such communication
have risen significantly, and it has been adopted across the globe.
There are several ways a programmer can tap into these lower-level software layers,
the most basic one being sockets. They are the portal through which a computer sends
and receives data from another. A distributed memory is an alternative architecture,
but is typically suited for computing nodes that are physically close to each other, such
as within one computer system. The distributed memory architecture best suited for
solving one single problem by massively parallelizing the solution is not suited for
long-distance communication to implement a multiplayer gaming.
Remote Procedure Call ( RPC ) is another programming model that may be adopted
to implement multiple client interaction; in fact, Adobe's Media server solutions
provides this model. Underneath it, however, the actual data communication happens
via the socket implementation. RPC provides an easy-to-use programming model for
programmers, but lacks the speed of using direct sockets.
The socket communication itself has two distinct protocols: one is called the TCP and
the other is the UDP. The main difference between the two is the reliability. The TCP
protocol offers the best reliability against the hardware and software failures in the
way that it connects the two end points of communicating computers. UDP on the
other hand does not; the application layer must add additional programming logic
to overcome the packet loss or packets arriving out of order at the receiving end. For
the sake of reliability, TCP protocol sacrifices performance, meaning two computers
communicating in TCP are generally slower compared to UDP.
UDP protocol is great if the underlying network hardware is highly reliable. In cases
where speed is highly desirable and quality may be compromised, UDP makes for
a better choice. Numerous well-known games are in fact implemented on top of this
protocol, with the reliability built in the game client layers. Another important fact to
consider is that UDP may work well in some countries but not in all.
 
Search WWH ::




Custom Search