Game Development Reference
In-Depth Information
hardware or driver can do something that it cannot. Your first clue that an issue is
driver related is that it only occurs on specific hardware, such as a particular brand of
video card. Video cards are sources of constant headaches in Windows games
because each manufacturer wants to have some feature stand out from the pack and
do so in a manner that keeps costs down. More often than not, this will result in
some odd limitations and behavior.
Weird bugs can also crop up in specific operating system versions, for exactly the
same reasons. Windows 9x
-
based operating systems are very different than Windows
2000 and Windows XP, which in turn are very different than Windows Vista
and Windows 7. These different operating systems make different assumptions
about parameters, return values, and even logic for the same API calls. If you don
t
believe me, just look at the bottom of the help files for any Windows API like
GetPrivateProfileSection() . That one royally screwed me.
Again, you diagnose the problem by attempting to reproduce the bug on a different
operating system. Save yourself some time and try a system that is vastly different. If
the bug appears in Windows 7, try it again in Windows XP. If the bug appears in
both operating systems, it
'
s extremely unlikely that your bug is OS specific.
A much rarer form of the weird bug is a specific hardware bug, one that seems to
manifest as a result of a combination of hardware and operating systems, or even a
specific piece of defective or incompatible hardware. These problems can manifest
themselves most often in portable computers, oddly enough. If you
'
ve isolated the
bug to something this specific, the first thing you should try is to update all the rele-
vant drivers. This is a good thing to do in any case, since most driver-related bugs
will disappear when the fresh drivers are installed.
Finally, the duckbilled platypus of weird bugs is the ones generated by the compiler.
It happens more often than anyone would care to admit. The bug will manifest itself
most often in a release build with full optimizations. This is the most fragile section
of the compiler. You
'
ll be able to reproduce the bug on any platform, but it may dis-
appear when release mode settings are tweaked. The only way to find this problem is
to stare at the assembly code and discern that the compiler-generated code is not
semantically equal to the original source code. This scenario occurs most often
when you
'
re doing something extremely tricky, which can expose an edge-case in
the optimizer
'
'
s logic. Finding this bug is not that easy, especially in fully optimized
assembly.
By the way, if you are wondering what you do if you don ' t know assembly, here ' sa
clue: Go find a programmer who knows assembly. Watch that person work and learn
 
Search WWH ::




Custom Search