Sound
system
These
days sound systems are getting more and more complex, what with
Dolby Digital 5.1 speaker systems, 3D sound systems, and 3D accelerated
sound cards. Add to that mix real time music mixing, midi playback
and environmental sound, and it starts getting really complicated.
Has anyone here ever seen a movie without all the incidental music
and sound effects? Looks really weird doesnt it? Well games
are no different. Sound and music are becoming more and more important
for scene and mood setting, as well as aural cues to whats
going on. In the PC world, there are three main sound systems.
Direct Sound - created by Microsoft. This is bad news, not only
does it not work correctly, when it does work its pretty hit and
miss. Plus the fact that its not supported under NT makes it the
worst choice. We use it as a fall back system in case all else
fails. Then theres EAX, created by Creative Labs, the people
that brought you the Sound Blaster, and most recently the 4 speaker
system Sound Blaster Live! This is a pretty damn good system,
with lots of built in effects, like echo, as well as sound reflection
and on the fly sound modification. Lastly there is the Aureal
A3D system. Like EAX, its pretty good, with all the clever
stuff done to the sounds inside the card, rather than in software,
which is always good.
These
days not enough is done with sound, it tends to be the last thing
thats thrown in at the last minute. On the other hand it
is a burgeoning discipline - we now have one programmer that is
dedicated to handling sound issues. Sound on the consoles and
in the arcade is handled a little differently. Again, like the
renderer, the sound system is always known in advance, which is
handy, since once you've written a sound system, you can use it
again and again, since sound systems are the one area of code
that traditionally doesn't change much between projects. One thing
to bear in mind though, is support of both sound compression systems
and multi-speaker support. Sounds are one the biggest memory hogs
we have in games. I use samples in our games that are bigger than
the entire memory of a Commodore 64. Since this is a memory waster,
we can either go with making the sample itself smaller by down
shifting the sample rate, a make it sound crap, and inspiring
the wrath of our sound designers, or we can investigate sound
compression systems.
MP3 is
one that springs to mind, however, we do have to balance CPU time
required to decompress these samples on the fly with the rest
of the game. And for those interested, I don't know of anyone
that actually generates sound effects on the fly anymore, like
we used to have to do back in the dark ages. Lastly, in these
days of Dolby Digital and AC3, we are finding more and more people
with multi speaker systems. And we need to support them. While
its cool, it does actually have some practical game applications,
for instance in a four speaker system, you can actually hear where
some one is in 3D relation to you, which believe me, if your in
a crucial situation can spell the difference between wasting time
hunting for some one and not. We are just starting to get to the
point in games where we can start to do clever stuff like aural
occlusion, so if someone is behind a wall and shoots a weapon,
their sound is muffled. This is a subtle thing, but can be very
helpful. For this, of course, we need accelerated sound cards;
in much the same way we need accelerated 3d graphics cards. I
don't believe you'll see this kind of effect on this generation
of consoles, and in the arcade environment its pretty pointless,
since your not going to hear it in the din of an arcade, and the
speakers are too close together anyway.
Control
mechanisms/physics
How is
your game going to be controlled? Mouse? Trackball? Joystick?
Keyboard? Controller? There are many different ways to allow data
entry in a game. Being able to cope not only with the data entry,
but also translating it into meaningful responsiveness on the
screen is a key element of a good game. At the root of all the
other systems is the main controlling element that runs the game.
This is what scans the input devices, and translates what they
say into motion and activity on the screen. At the root of every
good game is a blazingly fast and extremely comprehensive input
system.
Take Quake
for example, while not particularly fast, it has that extremely
useful and helpful console system. Its like having a dos shell
within a game. What you have to do is create an intuitive interface
between the player and the game. This is one area where we start
getting into game design rather than implementation, so rather
than discussing what controls are best, I'll talk about how we
implement them. For instance your game may use digital joysticks
as well as a normal mouse. You, as a programmer, have to figure
out a control system in your game that can handle both digital
inputs from a joystick - up down, left and right, and the analogue
input that you get from a mouse.
Not as
easy as it sounds, since they both have 'feel' right. Then of
course there is force feedback, something relatively new in the
games world. This is where your control mechanism reacts to events
occurring in the game via internal motors. For instance, getting
shot and the joystick jumping in your hand to reinforce this event.
Mostly events like this are tied to sound cues in the game. Most
always an event you need to be felt through force feedback has
a loud noise attached to it. All things that have to be taken
into account, and a bad or rushed implementation of this stuff
is probably responsible for more games failing that could have
been fun, than anything else.
Physics
are integral to the player movement system, since it affects how
the computer player responds to your commands and controller manipulations.
Something to be aware of here is that almost every non game developer
keeps going on and on about true physics systems making games
more realistic. Well, speaking as a developer, Im here to
tell you that true physics may be more realistic, but they definitely
are NOT more fun. If Quake or NBA JAM had real physics
in them, there is no way youd be running around at 40 miles
an hour from a standing start! Sometimes, what feels
right in a game has nothing to do with real physics. Actually,
the modification of true physics into game physics
makes a tremendous difference in game play, and the correct balance
of the two is definitely a skill. All of that is quite apart from
the fact that implementing a true physics system, with moments,
friction, forces and so on is pretty expensive when it comes to
floating point computation. It might be right, but its CPU expensive
and often not that fun.