Players in the game can take advantage of these items and contraptions with specific behaviors. This section investigates such behaviors, starting with an examination of the human approach. The criteria for evaluating AI at this task are discussed, and a case study of the behaviors required finishes the section.
The use of items is the most important ability for humans, then dealing with contraptions, and, finally, behaviors involving objects indirectly.
Picking Up Items
Collecting objects in first-person shooters is mostly a matter of moving toward them and walking over them. The items are automatically used by the player, either added to the inventory or processed directly.
We've already discussed movement as a preventive measure for avoiding obstacles, and even movement with loose goals such as exploration or wandering. The process of picking up items is more focused; it requires moving in a very specific direction.
Humans do this almost subconsciously, combined with the other movement behaviors (such as preventing collision). Picking up objects can be considered a short-term goal-directed behavior that only leads to small detours. Rarely does seeking a target affect the primitive movement abilities, such as avoiding ledges and preventing collision; humans are very good at combining these sometimes contradictory requests.
Handling contraptions in the environment (for instance, ladders or platforms) is more of a challenge; the movement required is not a special case of wandering behaviors. Additional skills such as pressing switches (voluntary contact), waiting for an event, or moving vertically on ladders are more sophisticated behaviors.
On top of this, players also need to combine abilities together to get through contraptions. Sequences of actions are needed to move through open doors or catch an elevator. Each action is triggered by events or conditions that arise from the previous action. For this reason, these short "plans" can be considered as reactive because they are driven by direct observations.
These sequences of actions are therefore very simple. After the decision has been made to use the contraption, it's just a matter of acting reactively according to a set pattern—with little or no variation. Apart from the actions required to activate the contraptions, few other actions are taken.
This part of book covers not only the direct use of objects, but also behaviors that involve objects in a less-obvious manner—for example, animats that rocket jump or even dodge incoming projectiles. Just like the use of contraptions, behavior enhancers can be considered as a sequence of reactive actions. The difference, however, is that the behaviors are triggered at arbitrary moments rather than in specific locations.
Naturally, players determine the most appropriate moment to dodge weapons or rocket jump—instead of doing it all the time. The question of dodging projectiles is relatively straightforward, because it's only possible when a weapon has been fired. On the other hand, determining when to rocket jump is instead dependent on the height of the obstacle in front, and the desire of the player to lose health to get over that.
Just like for other reactive behaviors, certain properties are expected to maintain the illusion of realism. Luckily, the AI relies on existing movement capabilities developed in Part II, so much of the work is already done—guaranteeing smooth, humanlike motion.
In this part, we must pay attention not to abuse the "enhanced" behaviors to prevent them from standing out too much. Even if they are realistic, it's good practice to try and keep their use to a minimum. A good way to achieve this is to abide by the following criteria:
Because there's little common ground among the behaviors, they need to be analyzed separately: