Search Tips Advanced Search |
| Delphi Graphics and Game Programming Exposed with DirectX 7.0 by John Ayres Wordware Publishing, Inc. ISBN: 1556226373 Pub Date: 12/01/99
Search this book:
Previous | Table of Contents | Next
## CHAPTER 2 The Anatomy of a Game This chapter covers the following topics: • The three vital elements of a game • Basic game architecture • Game loops • Game states Application design is an art unto itself. Several books have been written on the topic of effectively designing an application. Indeed, in the computer industry one can even specialize in such a discipline (if you’re a programmer, you probably know someone with the title of “Chief Architect” who only designs applications and no longer writes any code). Application design can be childishly simple or diabolically complex, depending on the task the final application must perform. However, from a purely academic perspective, all computer applications pretty much do the same thing: receive input, process it, and create output. In typical business applications, the input comes from either a device (commonly a mouse or keyboard) or a database connection, the processing typically involves mathematical calculations, and the output generally results in either a spreadsheet style of data display or (more excitingly) a colorful graph. By contrast, game applications must accept input from several different devices, processing the input by moving onscreen objects around, performing collision detection, playing sound and music as the situation demands, and deciding if missiles are fired or something has died. A game application’s output involves drawing the results of these frantic calculations to the screen. Game application architecture can vary as wildly as business application architecture. However, all games must perform similar actions, usually in a common order. In this chapter, we examine the various components that make up a typical game application. We will study an arbitrary application architecture that can be used for games, and we will discuss the individual subsystems of this architecture, focusing on the functionality they provide to the overall game application. The focus on this chapter is on the theory of game application construction, and as such presents very little actual code examples. However, several pseudo-code listings will be illustrated that encapsulate the techniques discussed in this chapter. Additionally, a simplistic game example is included on the CD for this chapter that demonstrates this architectural theory in a more real-world implementation. ### Game Dissection: The Vital Organs Games can be incredibly complex, with several different subsystems performing any number of functions that control the overall application. Many developers may feel a little overwhelmed by all the details that go into creating a game. However, like most things in life, game programming is not nearly as complex as one might at first imagine. It’s certainly not an easy discipline; one must be very skilled in their talents and have the ability to apply them in creative ways in order to produce new and exciting effects and gaming environments. Fortunately, dozens of books have been written that discuss various game programming techniques in many genres, from 2-D turn-based board games to 3-D fast action, first-person shooters. Anything that one person can learn, another person can learn as well; game programming is a constant quest for new knowledge and new techniques, which gives the field one of its many enticements. The many game programming books on the market (this one included) typically deal with very specific game programming techniques that demonstrate how some particular game environment or effect can be produced. This allows one to learn specific talents in specific areas, possibly specializing if so desired. While game programming is as varied and diversified as business applications programming, when viewed from a high-level standpoint all games can be reduced to three necessary parts: graphics, sound, and input. #### Graphics With the exception of user interactivity, graphics are probably the most important part of a game in today’s market. Game developers are now using software that was once only used by movie and television production houses to develop graphics for games, and the results are nothing short of amazing. Tools such as TrueSpace, LightWave, and SoftImage, which have all been used to create outstanding special effects for both movies and television, are a necessity for serious game graphics production. Almost any major game includes several animated sequences (usually produced by one of these tools), some of which are on par with action sequences seen in a major motion picture. Game element graphics have also seen amazing improvement over the last several years, with many interactive elements starting their lives as high-resolution 3-D models. However, as important as good graphics are to today’s games, it is equally important to realize that just because a game has good graphics, it does not mean it is fun to play. Too many games are made with the theory that if you put in good graphics, users will buy it. Graphics are important for that first impression when a potential consumer picks up the box to have a look, and indeed for the continued enjoyment of the game, but graphics should functionally act as only a complement to the overall game design and playability. Game graphics can further be broken down into two elements: background graphics and interactive images, or sprites. Background Graphics Background graphics set the mood for a game. Usually, they define the environment in which the game world is set, and they provide a reference point for the user. Typically, background graphics are static, and represent objects that the user either cannot or rarely interacts with. For example, background graphics include the vehicle fuselage of a cockpit in a flight simulator, the radar control console casing in a real-time strategy game, or the surface over which puzzle pieces slide in a pattern matching game. Sometimes, background images may animate in some way, providing more realism to the environment and enhancing the overall gameplay experience (for example, moving the heads of spectators in a tennis game). Interactive Images The most important graphical element of any game are those graphics with which the user interacts. Either by directly controlling the movement and actions of a specific graphical element, or by indirectly affecting the movement and actions of graphical elements through the direct manipulation of other graphical elements, it is these interactive images that represent the actual game play. Typically called sprites, these images generally move about the screen, animating as they change position from place to place.
| sprite: An image that animates and moves around the screen in some fashion. Typically associated with images that the user can interact with, either directly or through interaction with other sprites.
Previous | Table of Contents | Next

Products | Contact Us | About Us | Privacy | Ad Info | Home Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.