Game Development Reference
In-Depth Information
Chapter 21
by David “Rez” Graham
A Game of Teapot Wars!
You
ve seen a lot of source code in this topic, including everything from resource
management to rendering to network code. All of this code has come directly from,
or has been adapted from, a computer game that actually saw real players and some
time in the sun. The one thing you haven
'
'
t seen yet is how to put it all together into
a cohesive engine and how to actually build a game. Seeing how everything fits
together is extremely important to understanding the motives behind all these sys-
tems and abstractions we
'
ve been drilling into your head for this entire book.
The game we
ve created is called Teapot Wars, which you can see in Figure 21.1.
Teapot Wars is a game where teapots battle each other to the death utilizing their
fearsome spout cannon. This game features the use of advanced physics, networked
multiplayer, AI, and everything else you
'
ve learned. This is a simple game, but in this
simplicity is hidden nearly all of the code you ' ve seen in this topic. It ties together the
architecture we
'
ve been pushing; it uses the application layer, the game logic, and
game views as a basis for the game and ties them together with the event system. It
uses Lua for most of the gameplay code and AI and XML for data-driven actors. The
game even works as a multiplayer game over the Internet.
The teapot has an interesting history. You might wonder why you see it virtually
everywhere in computer graphics. DirectX even has a built-in function to create
one. I did a little research on the Internet and found this explanation:
'
s
instantly recognizable, it has complex topology, it self-shadows, there are hidden
Aside from that, people have pointed out that it is a useful object to test with. It
'
719
 
 
 
Search WWH ::




Custom Search