Game Development Reference
In-Depth Information
'
some version of Windows can
t be supported without sweeping modifications. Others
make you wonder how the game ever worked in the first place.
If this ever happens to you, and I
'
m sure it will, I feel your pain. Grab some caffeine
and your sleeping bag; it
'
s going to be a long week.
Reproducing the Bug
A prerequisite of observing the behavior of a broken game is reproducing the bug.
I
'
ve seen bug reports that say things like,
I was doing so-and-so, and the game
crashed. I couldn
In light of an overwhelming number of
reports of this kind, you might be able to figure out what
'
t get it to happen again.
'
s going on. Alone, these
reports are nearly useless. You cannot fix what you cannot observe. After all, if you
can
t observe the broken system with certainty, how can you be sure you fixed the
problem? You can
'
t.
Most bugs can be reproduced easily by following a specific set of steps, usually
observed and recorded by a tester. It
'
s important that each step, however minor, is
recorded from the moment the game is initialized. Anything missing might be
important. Also, the state of the machine, including installed hardware and software,
might be crucial to reproducing the bug
'
'
s behavior.
Reduce Complexity to Increase Predictability
Bugs are sometimes tough to nail down. They can be intermittent or disappear
altogether as you attempt to create a specific series of steps that will always
result in a manifestation of the problem. This can be explained in two ways:
Either an important step or initial state has been left out, or the bug cannot
be reproduced because the system being tested is too complex to be
deterministic. Even if the bug can be reproduced exactly, it might be difficult
to create an explanation of the problem. In both of these cases, you must
find a way to reduce the complexity of the system; only then can the problem
domain become small enough to understand.
Eliminating Complexity
A bug can only manifest itself if the code that contains it is executed. Eliminate the
buggy code, and the bug will disappear. By the process of elimination, you can nar-
row your search over a series of steps to the exact line of code that is causing the
problem. You can disable subsystems in your game, one by one. One of the first
things to try is to disable the entire main loop and have your game initialize and
exit without doing anything else. This is a good trick if the bug you
'
re hunting is a
 
 
 
Search WWH ::




Custom Search