Game Development Reference
In-Depth Information
way to research this type of game is to take each element on its own and create a
simple test program to make sure that everything is working as you expect. Once
you have all of the technology down, you can bring all the elements together to
make a more complicated game.
Strategy Games
Strategy games come in two general types: turn-based games that have a close
relationship with traditional tabletop war games, and real-time games, which
have a far more distant relationship to tabletop games. Turn-based games are
easier to program. The player has a number of possible actions he can carry out
each turn, and once no more actions can be done, the turn can end. Real-time
games allow the player to perform as many actions as fast as he can, but each
action takes a certain amount of time before it completes. Turn-based games
tend to favor 2D representational graphics, sticking close to their board game
roots, whereas real-time games usually use 3D graphics.
Strategy games tend to favor a top-down view, allowing the player to view as
much of the game world as possible. If the graphics are 2D, then tiles and sprites
are often used to represent the different types of land, unit, and characters. 3D
games usually use a 3D height map. In the Engine class, a sprite was a 2D quad;
imagine if that quad was subdivided many times so its surface was more like a
grid. An example height map can be seen in Figure 11.5. Each of the vertices can
be moved up or down on the Y axis to give the impression of terrain, as can
be seen in Figure 11.5. Height maps are often specified by grayscale images.
Each pixel of the image corresponds to each vertex in the grid-mesh, the
height depending on the intensity of the pixel. A gray pixel value halfway be-
tween black and white might represent no movement of the vertex; a black pixel
would move the vertex negative one, and a white pixel would move the vertex
positive one.
The advantage of using a bitmap to represent the height is that it allows the
height map to be painted in a paint package. Height maps get a lot of use in
computer games, and after reading this description, they will probably be very
easy to spot! Real-time strategy games often use height maps for the terrain and
3D models for each of the units in the game.
The difficulty with strategy games, especially strategy games that are war-based,
is the artificial intelligence. There are two different AI systems: the first is the AI
 
Search WWH ::




Custom Search