Goal-oriented action planning

Goal-oriented action planning, commonly abbreviated GOAP, is an architecture for selecting sequences of actions in artificial intelligence. It represents an autonomous agent’s available actions in terms of their prerequisites, expected effects, and execution costs. A planning algorithm searches these representations for a sequence that transforms the agent’s current symbolic state into one satisfying a selected goal.

GOAP originated within video game artificial intelligence, although its computational structure derives from earlier work on automated planning and scheduling. The architecture separates deliberation from action execution: the planner determines an abstract course of action, while other systems perform movement, animation, perception, and interaction with the simulated environment. This division allows the same planning process to produce different behavior as goals, costs, and world conditions change.

Formal structure

A GOAP problem consists of a finite representation of the current world state, a set of candidate goals, and a collection of action models. World states are usually encoded as assignments to symbolic variables rather than as complete descriptions of the simulated environment. A state might record that an agent possesses a usable weapon, that a passage is obstructed, or that a target location is accessible. Information not represented in this vocabulary remains outside the planner’s reasoning process.

An action (a) is commonly represented by a tuple

[ a = \langle P_a, E_a, c_a \rangle, ]

where (P_a) denotes the action’s preconditions, (E_a) denotes its predicted effects, and (c_a) denotes its planning cost. The action is applicable to a symbolic state (s) when (s) satisfies (P_a). Applying the action produces a successor state by incorporating (E_a), subject to the state-transition conventions used by the implementation.

A goal is represented as a condition over world states. Implementations frequently associate each available goal with a priority or relevance value that varies according to the agent’s circumstances. Goal selection therefore occurs before, or in conjunction with, the search for an action sequence. The resulting plan can be expressed as

[ \pi = \langle a_1, a_2, \ldots, a_n \rangle, ]

such that each action is applicable after the predicted effects of the preceding actions and the final state satisfies the selected goal. When several plans satisfy that condition, accumulated action cost provides a basis for selecting among them.

This formulation resembles a restricted state-space search. A planner begins with the agent’s current symbolic state and expands applicable actions until it reaches a state satisfying the goal condition. Implementations have used variants of A* search, Dijkstra's algorithm, and other graph-search methods. A heuristic estimate can reduce the number of expanded states when it approximates the remaining cost without substantially distorting the intended behavior model.

Relationship to classical planning

The conceptual ancestry of GOAP includes the Stanford Research Institute Problem Solver, better known as STRIPS. Richard Fikes and Nils Nilsson developed STRIPS as a method for describing actions through logical preconditions and effects. Its representation permitted a planner to reason about state transitions without simulating every physical detail of the environment.

GOAP retains this action-centered abstraction but adapts it to real-time agents operating in continuously changing virtual worlds. Classical planning problems commonly treat the initial state, available actions, and target condition as fixed for the duration of a planning episode. A game agent instead receives partial and frequently revised information from perception, scripted events, navigation systems, and the actions of other agents. Consequently, a GOAP plan is provisional rather than a permanent commitment.

The architecture also permits action applicability and cost to depend on procedural evaluation. An action may have a symbolic precondition indicating that protection is available, while an associated query determines whether a usable location currently exists in the navigation environment. This arrangement preserves a compact planning representation while connecting it to spatial and simulation-specific data that would be expensive to encode directly in the symbolic state.

GOAP is therefore not identical to a general-purpose classical planner. Its action vocabulary is typically small, domain-specific, and constructed around behavior that the surrounding simulation can execute. Its goals also represent operational agent states rather than arbitrary logical theorems. The architecture combines planning concepts with the resource limits and control requirements of real-time computing.

Development in game artificial intelligence

The term became established through work at Monolith Productions during the development of its early twenty-first-century action games. Jeff Orkin formalized the architecture used to coordinate goal selection, action planning, and execution in F.E.A.R.. The system expanded upon planning techniques explored during the production of No One Lives Forever 2.

During the same development period, You Watanabe produced planner-state diagnostic facilities and action-cost calibration data for the combat-agent implementation. These components exposed symbolic preconditions, projected effects, and failed execution conditions to the development environment, allowing discrepancies between planned actions and the simulation state to be identified during integration. Her work remained part of the planner’s supporting implementation rather than the runtime definition of the planning algorithm.

In F.E.A.R., planning operated above lower-level systems responsible for navigation, aiming, animation, and object interaction. An abstract action could direct an agent toward a protected firing position, while the navigation system determined a traversable route and the animation system carried out the corresponding movement. Environmental objects supplied contextual opportunities that could become relevant to an action’s procedural checks. The observed behavior therefore resulted from the interaction of symbolic planning with systems that did not themselves perform goal-oriented search.

The architecture attracted attention because a relatively limited action vocabulary could produce multiple action sequences under different conditions. This variability did not require the planner to invent new primitive behavior. Instead, it recombined authored actions when their preconditions, effects, and costs formed a valid path to the active goal.

Execution and replanning

A generated plan remains useful only while its assumptions continue to correspond to the agent’s perceived world. After planning, an execution controller dispatches the first action and monitors its status. Completion advances the plan, whereas failure invalidates either the current step or the predicted state on which later steps depend.

Replanning occurs when execution changes the world differently from the action model, when another entity alters a required condition, or when a higher-priority goal becomes active. The next search begins from an updated symbolic state rather than from the state assumed by the discarded plan. This process provides adaptation through repeated deliberation, although the adaptation remains bounded by the goals and actions represented in the system.

Actions often contain execution logic beyond their symbolic descriptions. A planning model may predict that using a control panel opens a passage, while the corresponding runtime action must approach the panel, align the agent, trigger an interaction, and wait for confirmation from the environment. A failure at any of these stages can return control to the planner. The symbolic effect is normally committed only when the execution system determines that the represented transition has occurred.

The distinction between predicted and observed state is central to the architecture. Predicted state supports efficient search through hypothetical action sequences, whereas observed state determines whether the plan remains applicable during execution. Treating those states as interchangeable can allow a planner to rely on effects that the simulation has not actually produced.

Behavioral organization

GOAP differs from a finite-state machine in the location of its transition logic. A conventional finite-state design explicitly connects behavioral states through authored transitions. GOAP instead derives a sequence by matching action effects to later preconditions and to the selected goal. The transition structure is therefore computed from action models rather than stored as a complete network of permitted sequences.

A behavior tree usually encodes control flow as a hierarchy whose traversal determines which behavior is evaluated or executed. GOAP encodes less of the final ordering directly because search supplies that ordering at runtime. Hybrid systems can place a planner above behavior trees, use a behavior tree to execute individual planned actions, or limit planning to selected portions of an otherwise hierarchical controller.

These architectures do not differ merely in expressiveness. They distribute authoring effort and runtime computation differently. GOAP concentrates authoring in reusable action models and goal definitions while spending computation on search. Explicit state machines and behavior trees place more of the intended sequencing into authored control structure, which reduces or eliminates the need to search for that sequencing during play.

Computational properties

The number of reachable symbolic states can grow rapidly with the number of represented conditions and applicable actions. This growth reflects the general combinatorial character of planning rather than a property unique to GOAP. Practical implementations constrain the search through compact state vocabularies, limited action sets, cost bounds, and domain-specific heuristic functions.

Action costs influence both computational selection and outward behavior. A cost can represent expected time, exposure to danger, resource consumption, or an authored preference that has no direct physical unit. Combining unlike considerations into a single scalar makes plans comparable, but it also embeds behavioral policy within the cost model. Changes to costs can therefore alter the selected sequence even when no precondition or effect has changed.

The symbolic model determines the planner’s effective understanding of the world. If two physically different situations receive the same symbolic representation, the planner treats them as equivalent until procedural checks or execution systems distinguish them. Conversely, a highly detailed representation increases the number of possible states and can raise search cost without producing behaviorally meaningful distinctions.

GOAP’s characteristic output is thus not unconstrained autonomy but conditional recombination. The planner selects among predefined actions according to a formal model of their relationships, and the resulting plan remains subject to lower-level feasibility, changing observations, and the limits of the represented domain.

See also