Game Development Reference
In-Depth Information
because even if your game doesn
t have a rigorous separation between game logic and game view, you
can still create a command interpreter that provides a very low-level way to tweak your game while it is
running.
'
Game View for the Human Player
A game view is a collection of systems that communicates with the game logic to
present the game to a particular kind of observer. This observer can be a human
being with a controller of some kind, like a keyboard or a plastic drum set, but it
can also be an AI agent, whose view of the game state will determine the AI process
'
s
next course of action.
The game view for a human being has a lot of work to do (see Figure 2.4). It must
respond to game events and figure out how to draw the scene, send output to the
speakers, translate controller input into game commands, and more. Let
'
s look at
the main areas.
Graphics Display
The display renders the objects that make up a game scene, the user interface layer
on top of the scene, and perhaps even streaming video. The renderer should draw the
screen as fast as it possibly can. The display can be one of the biggest suckers of CPU
budget in a game and should therefore scale well with the capabilities of a wide range
of CPUs and GPUs (graphic processing units). For PC or handheld games, it should
also perform well under different hardware configurations and operating system
releases. Generally, the game engine will disable expensive but nonessential features,
such as full screen effects, in order to run at the best frame rate they can.
Video cards will draw all the polygons you stuff into the GPU, even if it takes them
forever. Forever, by the way, is defined as anything more than 50ms, giving you a
frame rate of 20fps, even if that ' s all your game does. The real problem a 3D engine
has is choosing which polygons to draw to make the most compelling scene.
Figure 2.4
Subsystems that create a game view for a human player.
 
 
 
Search WWH ::




Custom Search