Game Development Reference
In-Depth Information
'
Beyond this, another feature of DirectInput that
s pretty useful is called action map-
ping. This is a concept that binds actions to virtual controls. Instead of looking at the
X-axis of the joystick to find the direction of a car
s steering wheel, DirectInput can
map the action of steering the car to a virtual control. The actual controls can be
mapped to the virtual controls at the whim of the player and are the basis for provid-
ing a completely configurable control system. Some gamers really love this. Direct-
Input isn
'
t the only way to make that work, however, but it does buy you a few
other things like a standard way to tweak the force-feedback system.
'
Remappable Controls Are Expected by Your Players
Whether you use DirectInput or not, this action-mapping idea is something every
game should have, even if you have to code it yourself. If you can easily switch
your
controls
from right-handed to left-handed or
from normal
camera
movement to inverted camera movement, you
'
ll automatically get more people
to play your game. Actually, you
ll keep people from throwing your game in the
garbage. Most players expect a customizable interface, and you
'
ll find more
players giving your game great reviews if they can adopt a control scheme
they are comfortable with. Even more importantly, PC gamepads from different
manufacturers may map input completely differently
'
for example, one may
switch the thumbsticks from left-handed to right-handed or give you negative
values when you expect positive values. A configurable input scheme lets you
easily remap these wacky values to a standard your game will use.
Mass market games that don
t have
insanely configurable controls can work just fine with Windows messages and the
Windows Multimedia Platform SDK. You don
'
t use any advanced features of joysticks or don
'
t have to learn to use DirectInput to
make games, and Windows messages are easy and familiar. There are plenty of
DirectInput samples in the DirectX SDK for you to look at, so I
'
m not going to
waste your time or any trees on the subject. What I want to work on is the fact that
there
'
s plenty to talk about in terms of user interface code, regardless of the API you
use or on what platform your game ships.
'
A Few Safety Tips
I
ve probably spent more of my programming time on user interface tasks than
almost anything else. The design for the early Ultima games loaded tons of control
on the mouse the idea being that the player could play the whole game without ever
touching the keyboard. As good an idea as it seemed at the time, this was a horrible
idea because it ignored simple physiology and the nature of the hardware. Remember
that any input scheme should be designed around how players physically manipulate
the device, and that they tend to do this for hours at a time.
'
 
 
Search WWH ::




Custom Search