Game Development Reference
In-Depth Information
Some Random Notes
In the last 50 pages or so, you
ve read about sound resources, audio buffers, audio
systems, and sound processes. This is where most topics would stop. Neither my
editor nor my readers will find any surprise in me continuing on a bit about
sound. Why? I haven ' t told you a thing about how to actually use sound in your
game.
'
Data-Driven Sound Settings
Sometimes I think this topic is equally good at showing you how not to code game
technology as it is at showing you how to code correctly. The observant programmer
would notice that all my sound examples in the previous pages all had hard-coded
constants for things like volume, fade-in times, or animation points.
From day one, most programmers learn that hard-coded constants are a bad thing,
and they can become a complete nightmare in computer game programming. The
reason that I use so many of them in this topic is because they make the code easier
to read and understand. Real computer games would load all of this data at runtime
from a data file. If the data changes, you don
t have to recompile. If the game can
reload the data at runtime with a cheat key, you can test and tweak this kind of
data and get instant feedback.
With this kind of data-driven solution, programmers don
'
t even have to be in the
building when the audio guys are making the sounds. Believe it or not, they actually
work later than programmers. This leaves programmers doing what they do best
'
programming game technology! A bit of volume data can also be tweaked more eas-
ily than the original sound file can be releveled, so your audio engineer doesn
'
t have
to be in the building, either.
So who
s so easy that
even a producer could do it. For those of you outside the game industry, I could as
well have said,
'
s left to set the level on new sound effects on a Saturday? It
'
It
'
s so easy, your boss could do it!
Record All Audio at Full Volume
Every sound effect should be recorded at full volume, even if it is way too
loud for the game. This gives the sound the highest degree of waveform
accuracy before it is attenuated and mixed with the other sounds in the
primary sound buffer.
 
 
 
Search WWH ::




Custom Search