Game Development Reference
In-Depth Information
Do You Have a Dirtbag on Your Hands?
If you are lucky (or probably unlucky) enough to be working on a mass-market title,
or even a title that will be distributed worldwide, you should support computers and
devices that have a wide range of capabilities. Everyone wants a game to look really
good, but when you have to support devices that don
'
t support the right graphics
system, something has to give. Choose a benchmark for your game that makes
sense to determine what makes a computer a dirtbag and what doesn
t. Whatever
you use, it is important to set your standards and determine if the computer the
player is using is at the shallow end of the hardware pool.
'
What to Do with Your Dirtbag
Once you figure out that the computer is at the bottom end, you should set your
game defaults for new players accordingly. A good start would be to turn off
any CPU-intensive activities like decompressing MP3 streams, scaling back
skeletal detail, animations, and physics, or reducing the cycles you spend on
AI. If the player decides to bring up the options screen and turn some of these
features back on, my suggestion is to let him do it if it
'
s possible. Maybe he
'
ll
be inclined to retire his old machine.
Initialize Your Resource Cache
You read about general memory management in Chapter 3 and resource caching is
covered in Chapter 8. Initializing the resource cache will be a gateway to getting your
game data from the media into memory. The size of your resource cache is totally up
to your game design and the bottom-end hardware you intend to support. It
'
s a good
idea to figure out if your player
s computer is a dirtbag or flamethrower and set your
resource cache memory accordingly.
'
No Room Even for the Basics?
You can
t impress a player with fantastic graphics until you reserve a nice spot
in system and video memory for your textures, models, and animations. If your
resource cache allocation fails, you can
'
t even bring up a nice dialog box telling
a loser player he is low on memory. The game should fail as elegantly as
possible and maybe print out a coupon for some memory sticks.
'
In this topic, we ' ll use Zip files to store game resources. It ' s reasonably speedy, especially if
no decompression is necessary. Here
'
s the code to initialize the resource cache:
new ResCache(50, new ResourceZipFile(_T(
Assets.zip
)));
if (!m_ResCache->Init())
{
 
 
 
Search WWH ::




Custom Search