Game Development Reference
In-Depth Information
Video on the Timeline
Though an externally loaded file works great for noninteractive
videos, it
s not the best option for the video that is used in the
gameplay or when you need clips with alpha transparency.
Image sequences such as short character animations, particle
effects, tend to require a transparent background in order to inte-
grate seamlessly with the background. Conventional thinking in
Flash would dictate using a series of PNG images that simply
played back in order. Much of the time, however, the best option
is actually to import the sequence as a video file directly into your
libraryanduseitonthetimelinelikeaMovieClip.Ifallyouhave
are image sequences to work with (not all animation programs pro-
duce video formats directly compatible with Flash), fear not! In the
section Setting Up an Internal Video, I
'
ll show you how to use
Flash as a video editing tool. There are a few reasons to consider
using video instead of a sequence of PNG files.
'
File Size
Most of the time, an FLV encoded with an alpha channel will be
smaller than the equivalent PNG sequence, even with relatively high
JPEG compression turned on in Flash, because the On2 codec is
designed for handling motion and applies its compression more effi-
ciently than JPEG. When an encoder compresses a video, it makes
decisions about what data will change from one frame to the next,
stripping out anything it doesn
t need to duplicate. Single images
only have their image data to work with and cannot benefit from the
other images in a sequence. Video can also be encoded in variable
bit rate (VBR). Instead of using the same compression across the
board for every frame, the encoder determines which frames can
benefit from extra compression and which ones need to stay higher
quality. For example, if several frames of a video are all one color or
have very little details, the encoder will compress them heavily,
whereas frames with a lot of motion and color data will receive a
lighter compression. While you could manually apply the same
principle to all the images in a sequence, it would be much more
time-consuming and certainly tedious.
'
Ease of Use and Library Clutter
Say you have 10 different one-second character animations for a
player in a game. At 30 fps, this would equal 300 images. Using a
video in place of each of these sequences would result in only 10
library items
much more manageable and easy to update if changes
are made. Simply replace one video instead of 30 images. This effi-
ciency also translates to timeline management. Because a video is
Search Nedrilad ::




Custom Search