Game Development Reference
In-Depth Information
Dexterity. The quarterback's general dexterity in handling the ball. This affects
his chances of dropping the snap or fumbling a handoff.
Awareness. The quarterback's ability to sense that he's about to be tackled and
to try to get out of the way.
Athlete AI Design
In action games and first-person shooters, the player's AI-driven opponents typi-
cally exhibit a small number of behaviors each triggered by a specific event
(appearance of the player on the scene, being shot at, and so on). When together in
a group, the AI seldom assigns special roles to particular individuals or instructs
them to help each other. It's every monster for itself.
These kinds of actions aren't acceptable in a sports game. People don't mind if a
monster in a first-person shooter wanders aimlessly around, but the athletes in a
sports game must behave like humans, and that means deliberate, intelligent
action. Particularly in team games, each athlete works with the others on the team
to accomplish particular goals. The position the athlete plays dictates behavior to
some extent, but within those boundaries, the athlete still must respond intelli-
gently to a number of possible events. In a relatively simple simulation such as
tennis, there might not be many of these events, but a highly complex simulation
such as American football, with 22 players on the field at a time, presents hundreds
of them.
DEFINING THE STATE SPACE
The play in a sports match can be broken down into states that are defined primar-
ily by the rules and secondarily by the tactics and strategy of the game. For
example, the period of time before a tennis player serves the ball is one state, and
the rules dictate where she may stand and what actions she may take (and likewise
for her opponent). The moment she serves the ball, the game enters a new state.
The moment the ball passes over the net, it enters another one, and so on. The best
way to design a sports-game AI is to map out a game's states as a giant flowchart.
There could be far more states than you realize at first. Corner kick in soccer is not
just one state but several: the period before the ball is kicked, after the kick but
before the ball touches another athlete, after it has been touched by another ath-
lete, and so on. See Figure 16.3 (next page) for a partial example.
Consult the official rules of the sport as you construct the flowchart; they often
describe states in detail, with special rules applying to each. However, the rules
alone are not enough—rules describe game states for the purposes of listing legal
and illegal actions, but not for purposes of tactics or strategy. Whenever something
changes that requires the athletes to adopt a different tactic, the game has moved
into a different state.
Search WWH ::




Custom Search