Game Development Reference
In-Depth Information
Chapter 23
by David “Rez” Graham
Debugging and Profiling
Your Game
By the end of any game development project, the programmers and their teammates
spend all of their time fixing bugs and tweaking performance. As important as
debugging is (especially in game development), techniques in debugging are rarely
taught. They tend to just come from experience or are traded around the program-
ming team. Since I ' m communicating to you through a book, we can ' t trade much,
but since you bought the topic, I think we can call it even.
Games are complicated pieces of software, and they push every piece of hardware in
the system. Bugs are usually pilot error, but there are plenty of cases where bugs trace
their roots to the compiler, operating system, drivers, and even specific pieces of
hardware. Bugs also happen as a result of unexpected interactions in code written
by different programmers; each module functions perfectly in a unit test, but failures
are seen after they are integrated. Programmers spend lots of time hunting down
issues in code they didn
t write.
If you are going to have any chance at all of fixing broken code, whether you wrote it or
not, you should have a few ideas and techniques in your toolbox. It
'
'
s not uncommon to
spend more time debugging than writing new code, especially toward the end of a project.
I need to warn you up front that you
re going to see some assembly code and other
heavy metal in this chapter. You simply can
'
t perform the task of debugging without
a basic working knowledge of assembly code and how the CPU really works. This is
not a gentle chapter because we
'
'
re not discussing a gentle problem. However, it
'
s not
brutally hard to learn assembly, and you have an excellent teacher
your debugger.
797
 
 
 
Search WWH ::




Custom Search