Chapter 6: Network


Download CD Content

Overview

Although little emphasis was given to the subject in recent chapters, a key feature of working with Torque is the fact that it was built around a client/server networking architecture.

Torque creates a GameConnection object, which is the primary mechanism that links the client (and the player) to the server. The GameConnection object is built from a NetworkConnection object. When the server needs to update clients, or when it receives updates from clients, the work is done through the good auspices of the NetworkConnection, and it is normally quite transparent at the game level.

What this means in practical terms is that the engine automatically handles things like movement and state changes or property changes of objects that populate a game world. Game programmers (like you and me) can then poke their grubby little fingers into this system to make it do their bidding without needing to worry about all the rest of the stuff, which Torque will manage—unless we decide to mess around with that too!

I know this seems a bit vague, so in this chapter we will attack the nitty-gritty so that you can really see how to use Torque's built-in networking to the best advantage.

First we will discuss the features, and look at examples of how they can be implemented, and then later in the chapter, after you update your Emaga sample program, you can try them out.




3D Game Programming All in One
3D Game Programming All in One (Course Technology PTR Game Development Series)
ISBN: 159200136X
EAN: 2147483647
Year: 2006
Pages: 197

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net