Runtime Debugging¶
The GOAP Hub automatically switches to Debug Mode when Unity enters Play mode. This gives you live visibility into what every agent is thinking and doing.
Activating Debug Mode¶
Debug mode activates automatically when you press Play. No setup required — just have the GOAP Hub window open and select a GameObject with a GoapAgent component in the Hierarchy.
Live Plan Visualization¶
The Plan Row at the top of the GOAP Hub shows the agent's current plan as a sequence of action nodes:
- Completed actions are dimmed
- The current action is highlighted with a progress indicator
- Pending actions are shown in their default state
As the agent executes its plan, the highlighting advances in real time. If the agent replans (due to goal preemption, FSM transition, or world state change), the Plan Row updates to show the new plan.
Live Node Data¶
In Debug mode, the Planner Graph overlays runtime data on every node:
Action Nodes¶
- Current execution state (running, completed, pending, failed)
- Modified cost (including score modifier output)
- Active strategy and post-process progress
Goal Nodes¶
- Current priority (including score modifier output)
- Whether the goal passes
IsValid() - Whether this is the currently selected goal
Auto Tab Switching¶
When the agent transitions between behavioral states, the GOAP Hub automatically switches to the new state's tab. This lets you follow the agent's behavior without manually clicking tabs.
Use the State Lock button in the toolbar to freeze the displayed state. This is useful when you want to inspect a specific state's configuration while the agent is in a different state.
Override Badges¶
If the selected agent has per-agent overrides (via GoapAgentContext), affected nodes show an override badge. This lets you quickly see which actions, goals, or beliefs have been customized for this specific agent.
Debug Flags¶
Two debug flags control the level of detail logged to the Console:
Debug Plan Search¶
On the GoapAgent component inspector:
| Field | Default | What It Logs |
|---|---|---|
Debug Plan Search |
false |
A* search steps — which actions are explored, costs evaluated, and the final plan produced |
Warning
Enable Debug Plan Search only on one or two agents at a time. The A* search log is verbose and can significantly impact performance with many agents.
Debug Execution¶
On the executor (internal):
- Logs action start/stop events, post-process entry/exit, and plan completion
- Useful for understanding the exact sequence of strategy and post-process calls
GOAP Console¶
A dedicated GOAP log viewer is available at Tools > RGS GOAP > Console. It filters for framework-specific messages, separate from Unity's main Console window. This makes it easier to find GOAP-related logs when your project has many other systems logging.
Bake to New Brain¶
During Debug mode, if you've configured per-agent overrides that you want to make permanent, use the Bake button to create a new Brain asset that incorporates those overrides. This is useful for:
- Prototyping variations during Play mode and keeping the results
- Creating specialized brains from a base template with specific overrides applied
Debugging Tips¶
Agent stands still?
Check the GOAP Console for plan failure reasons. Common causes: no valid goal (priority ≤ 0), missing strategy ("Missing Script"), or missing components needed by strategies.
Agent keeps replanning?
Enable Debug Plan Search and watch for rapid plan changes. This usually means a post-process is modifying blackboard state that immediately invalidates the current goal, or goal preemption is thrashing between similar-priority goals.
Wrong state?
Check the Neural Circuit to see which transitions are configured. A belief condition might be firing unexpectedly. Disable the transition temporarily to test.
What's Next¶
- Validation System — Catch errors before you even enter Play mode.
- Troubleshooting — Common issues and their solutions.
- Performance Tuning — Optimize for large numbers of agents.