BlaziumGoapGoal
A goal that an agent attempts to satisfy using a sequence of actions.
Description
BlaziumGoapGoal defines a desired state that an AI agent wants to reach. When evaluated, the action planner attempts to find a path of BlaziumGoapAction sequences whose combined effects fulfill this goal's desired_state. The agent automatically prioritizes the goal with the highest priority.
Example usage:
class_name GoalSurvive extends BlaziumGoapGoal
var achieved := false
func _init():
set_name("SurviveGoal")
priority = 10
desired_state = {"has_campfire": true}
func _on_goal_achieved():
achieved = true
Properties
|
||
|
||
|
||
|
||
|
Methods
void |
_enter() virtual |
void |
_exit() virtual |
_get_cost(blackboard: Dictionary) virtual const |
|
_get_priority() virtual const |
|
_is_valid() virtual const |
|
void |
_on_goal_achieved() virtual |
void |
_on_goal_failed() virtual |
void |
|
void |
_prepare() virtual |
void |
enter() |
void |
exit() |
get_action_name() const |
|
get_agent() const |
|
get_cost(blackboard: Dictionary) const |
|
get_priority() const |
|
void |
init(actor: Node, world_state: BlaziumGoapWorldState) |
is_performing() const |
|
is_valid() const |
|
void |
|
void |
|
void |
|
void |
prepare() |
Property Descriptions
A static cost modifier utilized by the A* calculation metric pathing.
bool default_valid_state = true 🔗
Determines baseline validity for tracking natively if no GDScript override acts upon the goal.
Dictionary desired_state = {} 🔗
void set_desired_state(value: Dictionary)
Dictionary get_desired_state()
The explicit dictionary requirements necessary to satisfy this goal natively through the action loop planner.
Flags whether the goal can natively be selected by the agent for processing.
The raw priority used when calculating which goal assumes control. Higher priority takes precedent.
Method Descriptions
void _enter() virtual 🔗
Called natively right before the agent actively begins following the plan for this goal.
void _exit() virtual 🔗
Called natively right after the agent stops following the plan for this goal.
int _get_cost(blackboard: Dictionary) virtual const 🔗
Calculates dynamic cost evaluations. Used natively if the goal incorporates variable state weights.
int _get_priority() virtual const 🔗
Called conditionally when the Agent sorts goals. Returning a dynamic number here allows the goal to spike in priority dynamically based on health or real-time world events.
bool _is_valid() virtual const 🔗
Evaluated continuously while the goal is active or queued. Natively aborts the plan entirely if this suddenly returns false.
void _on_goal_achieved() virtual 🔗
Invoked securely exactly when all sequence actions finish cleanly natively matching the desired state organically.
void _on_goal_failed() virtual 🔗
Invoked securely when the A* planner cannot resolve a path, or an action breaks midway invalidating the sequence.
void _perform(delta: float) virtual 🔗
A tick function executing recursively inside the active Godot process frame while this specific goal manages the active plan natively.
void _prepare() virtual 🔗
Calculates variables linearly right before resolving dynamic traits in the agent loop natively.
void enter() 🔗
C++ wrapper triggering _enter().
void exit() 🔗
C++ wrapper triggering _exit().
StringName get_action_name() const 🔗
Returns the object's configured node name natively.
BlaziumGoapAgent get_agent() const 🔗
Returns the BlaziumGoapAgent natively resolving this Goal.
int get_cost(blackboard: Dictionary) const 🔗
Evaluates the cost dynamically through _get_cost() and base cost.
Calculates final execution priority natively mapping _get_priority().
void init(actor: Node, world_state: BlaziumGoapWorldState) 🔗
Links references directly with the parent orchestration Agent.
Returns true if this Goal currently holds control asynchronously.
Internal validity checker wrapping _is_valid().
void on_goal_achieved() 🔗
C++ callback directly invoking _on_goal_achieved().
void on_goal_failed() 🔗
C++ callback directly invoking _on_goal_failed().
C++ frame loop invoking _perform().
void prepare() 🔗
Internal setup resolving _prepare().