← All examples

godot components

GOAP planner with A* over world states

Plan the cheapest sequence of actions from preconditions, effects and costs to reach a goal world state, with optional procedural checks and a bound on expanded states.

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • baltor_test.gd
  • component.json
  • goap_planner.gd
  • inspect_gdscript.py
  • run_tests.gd
  • test_package.py
  • tests/test_goap_planner.gd
  • verification/native.json

How it works

Class
BaltorGoapPlanner, extends RefCounted
Methods
add_action(action_name: StringName, preconditions: Dictionary, effects: Dictionary, cost: float = 1.0, check: Callable = Callable()) -> bool; remove_action(action_name: StringName) -> bool; has_action(action_name: StringName) -> bool; satisfies(state: Dictionary, conditions: Dictionary) -> bool; apply(state: Dictionary, action_name: StringName) -> Dictionary; is_applicable(state: Dictionary,…
Placement
res://baltor/godot_components/goap_planner/

Recorded checks

godot 4.7.2.stable.official.ed1daf0bf

  • godot_parse_check_only
  • godot_gdscript_tests
  • godot_tests_reject_gutted_component
  • godot_editor_import
  • godot_contract_reflection
  • godot_readme_usage_compiles

Limits to consider

Forward search over Dictionary world states; facts are compared with ==. The heuristic counts unmet goal facts, so the plan is the cheapest only when every action costs at least 1 and sets at most one goal fact. Large action sets need the max_nodes bound. Verified with Godot 4.7.2 headless; written against the Godot 4.3 API.