# Planowanie działań postaci (GOAP)

EN: **Goal-oriented action planning for game characters** · id `goap` · aliases: GOAP, goal-oriented action planning, planowanie zorientowane na cel

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [AI w grach](https://aiatlasgraph.com/t/gameai.md) › [Zachowanie postaci w grach](https://aiatlasgraph.com/t/gamecharacters.md) › Planowanie działań postaci (GOAP)

## Description

- PL: Planowanie w czasie rzeczywistym dla postaci, w którym system wyszukuje sekwencję akcji opisanych warunkami wstępnymi, efektami i kosztami.
- EN: Real-time planning for characters in which the system searches for a sequence of actions described by preconditions, effects and costs.

## In one sentence

- PL: Postać dostaje cel i listę umiejętności, a sama układa z nich plan, zamiast wykonywać sztywny scenariusz.
- EN: A character gets a goal and a list of skills and puts together its own plan, instead of following a rigid script.

## Problem it solves

- PL: Wrogowie, którzy zawsze robią to samo, gubią się, gdy gracz zablokuje drzwi lub zrobi coś, czego projektant nie przewidział.
- EN: Enemies who always do the same thing get lost when the player blocks a door or does something the designer did not foresee.

## What it does

- PL: Jak nawigacja w samochodzie, ale dla czynności: gdy droga jest zamknięta, od razu wylicza objazd z dostępnych ruchów.
- EN: Like a car's navigation, but for actions: when a road is closed, it instantly works out a detour from the moves available.

## Everyday example

- PL: Żołnierz w strzelance widzi zabarykadowane drzwi, więc wybija okno, wskakuje do środka i dopiero wtedy szuka osłony.
- EN: A soldier in a shooter finds a barricaded door, so he smashes a window, climbs in and only then looks for cover.

## This concerns you if you…

- PL: chcesz, żeby przeciwnicy w grze reagowali na niespodzianki
- PL: interesuje cię klasyczne planowanie w praktyce
- EN: want game enemies that handle surprises
- EN: are curious about classical planning in practice

## Keywords

GOAP · STRIPS · A* planning · replanning · F.E.A.R. AI

## How it works

- PL: Każda akcja ma warunki wstępne, efekty i koszt, a planer przeszukuje stany świata algorytmem A*, łącząc akcje w najtańszą drogę do celu. Gdy plan zawiedzie lub świat się zmieni, postać planuje od nowa.
- EN: Each action has preconditions, effects and a cost, and the planner searches world states with A*, chaining actions into the cheapest path to the goal. When a plan fails or the world changes, the character replans.

## Limits

- PL: Planowanie kosztuje czas procesora, więc stan świata musi być mały i uproszczony. Zachowanie trudniej przewidzieć i przetestować niż w drzewach zachowań. Koordynacja oddziałów zwykle wymaga osobnej logiki ponad planerem pojedynczej postaci.
- EN: Planning costs CPU time, so the world state must be small and simplified. Behaviour is harder to predict and test than with behaviour trees. Squad coordination usually needs separate logic above the single-character planner.

## Key terms

- PL: **warunek wstępny**: Co musi być prawdą, żeby akcję można było wykonać.
- PL: **efekt akcji**: Jak akcja zmienia stan świata.
- EN: **precondition**: What must be true before an action can run.
- EN: **action effect**: How an action changes the world state.

## Know first

- [Planowanie automatyczne (PDDL) (Automated planning (PDDL))](https://aiatlasgraph.com/t/classicalplanning.md)
- [Przeszukiwanie heurystyczne (A*) (Heuristic search (A*))](https://aiatlasgraph.com/t/astar.md)

## Related topics

Untyped, symmetric "see also" links.

- [Hierarchiczne planowanie zadań postaci (HTN) (Hierarchical task network planning for game characters)](https://aiatlasgraph.com/t/htngames.md)
- [Planowanie automatyczne (PDDL) (Automated planning (PDDL))](https://aiatlasgraph.com/t/classicalplanning.md)

## Sources

- [Three States and a Plan: The A.I. of F.E.A.R.](<https://pages.cs.wisc.edu/~dyer/cs540/handouts/gdc2006_orkin_jeff_fear.pdf>) `orkin-fear-goap-2006` · by Jeff Orkin

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/goap · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
