Game Development Reference
In-Depth Information
'
Don
t get too excited yet; the animation data is the least of your problems. Just wait
until you see how much storage your digital audio is going to take.
Map/Level Data
Most game object data is stored in a proprietary format, which is often determined
by the type of data and the whim of the programmer. There is no standard format
for storing game object data, AI scripts, dialogue, and other components. This data is
usually packed in a binary format for the game, but during development it is usually
stored in a format that is easy to work with, such as XML. There
s a good public
domain XML parser called TinyXML, and it is included as a part of the third-party
SDKs with the companion source code.
Either way, this data is usually the least of your problems as far as storage is concerned.
Your textures, audio, and animation data will overshadow this stuff by a long, long way.
'
Texture Data
Left to their own devices, artists would hand you every texture they create in a TIF or
TGA file. The uncompressed 32-bit art would look exactly like the artist envisioned.
When you consider that a raw 32-bit 1024 × 768 bitmap tips the scales at just over
3MB, you
'
ll quickly decide to use a more efficient format when your artists are
demanding a few thousand of these.
As always, you
ll generally need to trade quality for size. Load time will also need to
be considered. The best games choose the right format and size for each asset. You
'
ll
be better at doing this if you understand how bitmaps, textures, and audio files are
stored and processed and what happens to them under different compression
scenarios.
'
Bitmap Color Depth
Different bitmap formats allocate a certain number of bits for red, green, blue, and
alpha channels. Some formats are indexed, meaning that the pixel data is actually
an index into a color table that stores the actual RGBA values. Here
'
s a list of the
most common formats:
n 32-bit (8888 RGBA): The least compact way to store bitmaps, but retains the
most information.
n 24-bit (888 RGB): This format is common for storing backgrounds that have
too much color data to be represented in either 8-bit indexed or 16-bit formats
and have no need for an alpha channel.
 
 
 
 
Search WWH ::




Custom Search