Game Development Reference
In-Depth Information
'
might have time to rip out the hacks and install an upgraded algorithm. You
ll then
be able to sleep at night.
Hacks in Ultima 7 and Strike Commander
At Origin it was common practice for programmers to add an appropriate
comment if they had to install a hack to fix a bug. A couple of programmers
were discussing which game had the most hacks
Ultima VII or Strike
Commander. There was a certain pride in hacking in those days, since we
were all young, somewhat arrogant, and enjoyed a good hack from time to
time. The issue was settled with grep
a text file search utility. The Strike
Commander team was the clear winner, with well over 500 hacks in their
code.
UltimaVIIwasn
'
t without some great comments, though. My favorite one was
something like,
This hack must be removed before the game ships.
It never
was. What
'
s more, I think the same hack made it into Ultima VIII.
Baby Maker
In The Sims 3 code base, there
s a file named BabyMakerSceneWindowGhetto
UIDeleteMeSomedayPlease.cs. This was a last-minute hack that survived into
the shipping version of the game and even found its way on The Sims
Medieval! Old hacks are the hardest to kill.
'
Commenting your code changes is a fantastic idea, especially late in the project. This
is especially true in any script languages, like Lua, that don
t have the same analysis
tools common in C++. After the code complete milestone, the changes come so fast
and furious that it
'
'
s easy to lose track of what code changed, who changed it, and
why. It
s not uncommon for two programmers to make mutually exclusive changes
to a piece of code, each change causing a bug in the other
'
'
s code. You
'
ll recognize
'
this pretty fast, usually because you
ll go into a piece of code and fix a bug, only to
have the same bug reappear a few versions later. When you pop back into the code
you fixed, you
ll see the code has mysteriously reverted to the buggy version. This
might not be a case of source code control gone haywire, as you would first suspect.
It could be another programmer reverting your change because it caused another bug.
That situation is not nearly as rare as you think, but there is a more common sce-
nario. Every now and then, I
'
ll attempt a bug fix, only to have the testers throw it
back to me saying that the bug still lives. By the time it comes back, I may have for-
gotten why I chose the solution, or what the original code looked like. Even better, I
'
 
Search WWH ::




Custom Search