Chapter 29. Analysis and Specification
At this stage of the book, the reactive animats are competent enough to perform various
This chapter covers the following topics:
At the end of this chapter, we'll have a code skeleton ready for an implementation of these behaviors.
Objects in the World
The game environment is
Some items in the game have a direct effect on the player's state. When picked up, health packs and stimpacks increase the player's health immediately. The same applies to the various forms of armor; the combat armor, the jacket and vest, as well as the shards contribute positively to the player's armor count. Although Quake 2 has some subtleties with different armor types (for instance, conversions between green, yellow, and red), the general pattern is very similar to most first-person shooters; the player automatically benefits from health and armor and does not need to pay attention to it.
On the other hand, some items are not always used directly -such as quad damage (four times weapon strength), health regeneration, invincibility, and the silencer. In single-player modes, these items are stored in the inventory, and only activated when the player uses them. During multiplayer
Specific sequences of actions are often required to activate these contraptions, as defined by the game logic. For example, pressing a switch calls the platform, a key unlocks a door, and the player needs to touch the ladder face on before climbing it. These actions are prerequisites for any player in the world to use these objects.
A Test Bed
Because health and armor are essential
On the other hand, contraptions such as doors, teleporters, ladders, platforms, or even jump pads are relatively rare. When they are present, these elements are usually centerpieces to the architecture of a level. Developing the artificial intelligence (AI) requires a variety of different levels as a test bed, because a unique level with all the required features will be hard to find. Developing the AI for ladders and platforms proves somewhat challenging regardless. Indeed, contraptions are quite rare, so there won't be too many opportunities for the animat to test its behaviors.
Using customized simplified levels is a common practice