– but it uses them in unconventional ways. Usually, the FSM controls all NPC behavior by way of a list of possible states, with A* planning the paths. In F.E.A.R., however, the FSM has only three states ("GoTo", "Animate", and "UseSmartObject"), and A* is used to plan sequences of action as well as to plan paths. In essence, this means that A* navigates the FSM, selects the state, selects when to initiate a state transition, and selects what parameters to fulfil in each state (e.g. it doesn't just initiate a transition into the GoTo state, it also specifies a location and, upon reaching that location, it specifies to transition to the animation state and what animation to play). The logic determining when to transition from one state to another usually has to be specified manually by a programmer, meaning goals have a hard-coded and unalterable plan. In F.E.A.R., however, GOAP handles this, with the planning system deciding how best to achieve any of the 70 available goals, using any combination from the 120 actions encoded in the game. Orkin explains that "with a planning system, we can just toss in goals and actions. We never have to manually specify the transitions between these behaviors. The AI figure out the dependencies themselves at run-time based on the goal state and the preconditions and effects of actions." This is manifested in the gameplay insofar as, The AI must make these decisions almost instantly, as GOAP is designed so that each choice is complete by the time the next frame starts. When the AI is searching through the available actions within the state-space, it must constantly reevaluate this process based on what is happening in the game world. To do this, separate sensors are used to gather information, with world-knowledge cached locally so the AI always has information immediately available. Because of this, the AI is constantly changing its plan based upon what the player is doing – if the player throws a grenade, the NPCs will flee; if the player is being very aggressive, they'll be defensive; if the player is hiding, they'll be offensive and try to flush him out. An important part of this is the AI's freedom of movement within the game world. According to Orkin, In relation to squad behavior, Orkin explains that "AI have goals to respond to orders, and it is up to the AI to