Game Development Reference
In-Depth Information
image such as the shadowed side of a tree with the sun shining through from
the other side. It was initially thought that humans saw animation when the
afterimage from one still shot merged with the next. Although persistence of
vision is a term still used to explain our ability to see movement when there is
none in film and cinema, the theory was discredited as the main explanation
by German Gestalt psychologist Max Wertheimer in 1912. Rather he proposed
that the perception of motion was a psychological phenomenon called phi .
Phi, in short, is the way in which the human brain automatically fills in the
gaps between the images we see and therefore creates a perception
of seamless motion.
The traditional technique for producing animation was to hand draw each
image, known as a frame , and display them one after the other. Early Disney
cartoons were produced in this manner. In order to provide smooth motion,
the frames need to be shown at 24 frames per second. These frames are shot
in twos such that each still image is displayed on two frames of film. This
means that 12 drawings are required for 1 second of film.
For modern computer games, frame rates between 30 and 100 are acceptable.
Of course, if there were no motion on the screen, a frame rate of 1 would be
adequate. The frame rate in a computer game will differ depending on the
background processing that is occurring during any given game loop. Ironically,
fast action-paced games with lots of moving objects need to run at a higher
frame rate in order for the player to take all the action in, although all the extra
processing would be taxing on the processor and could lead to low frame rates.
Animation in the very first computer games was the result of using vector
graphics to draw an object on the screen, clearing the screen, and redrawing
the object at a slightly different location and rotation. Essentially, each frame
was being drawn on the fly by an algorithm—the reason being that the
computers of this time did not have memory available for storing art assets
created by others; not to mention the absence of digital paint programs to
produce them. For very simplistic graphics this worked effectively. The use
of real-time drawing in one of the first computer games, Spacewar!
(produced in 1962), is shown in Figure 3.1 .
When read-only memory was introduced to arcade games in 1974, it allowed
for the storage of predrawn graphics along with the game's program. The
game could then load the various graphical assets and integrate them into
the animation on the screen. These two-dimensional bitmaps were first
referred to as sprites .
3.2 Sprites
Loading a 2D image onto the screen and redrawing it along a path will
create a simple animation. This very principle is illustrated in the rocket ship
workshop from Chapter Two in which the static rocket ship image is moved
around the screen. The rocket ship and planet are sprites. In these examples,
Search Nedrilad ::




Custom Search