Intent Forge — Quickstart (15 minutes)¶
You'll build an agent that:
- Plans toward a goal (
HasFood = true). - Picks the cheaper of two paths.
- Drives execution via the built-in dispatcher subsystem — no StateTree or Behavior Tree required. (Both are supported; see the "Alternative runtimes" callout near the end.)
No C++ required for this tutorial. The endgame is a working pawn in PIE whose plan you can inspect via the Live Inspector tab (toolbar → Intent Forge → Open → Live Inspector).
Prerequisites¶
- UE 5.7+ project with Intent Forge enabled in the
.uproject. - Knowledge of: data assets, Blueprint, the Content Browser.
The default Auto dispatch mode needs no AI-runtime plugin. The plugin's
GameplayStateTree dependency is for the optional IntentForgeStateTree
module; you can ignore it for this tutorial.
Step 1 — Create the fact schema¶
- Right-click in the Content Browser → Miscellaneous → Data Asset →
FactSchemaAsset. Name it
DA_Schema_Forager. - Open it. In Facts, add three entries:
| Id | Type | Triggers Replan |
|---|---|---|
HasFood |
Bool | true |
NearTree |
Bool | true |
NearLake |
Bool | true |
- Save.
Step 2 — Author two actions¶
These represent two ways to get food: forage from a tree (cheap, slow), or hunt at the lake (more expensive but always available).
- Right-click → Miscellaneous → Data Asset → IntentAction. Name it
DA_Action_Forage. -
Open it and configure:
-
Preconditions: add one row, set its type to Bool Fact Equals →
FactId = NearTree,bExpected = true. - Effects: add one row, Set Bool Fact →
FactId = HasFood,bValue = true. - Executor Class:
Wait(from the bundled standard executors). - Default Params: set the type to
Wait Executor ParamsandOverride Duration = 2.0. -
Cost Strategy: choose Constant and set
Cost = 1.0. -
Duplicate the asset, name it
DA_Action_HuntFish: -
Preconditions: Bool Fact Equals →
NearLake = true. - Effects: Set Bool Fact →
HasFood = true. - Executor Class:
Wait, Override Duration = 5.0. - Cost Strategy: Constant,
Cost = 5.0.
The planner will prefer Forage whenever NearTree is true because it's
cheaper, falling back to HuntFish when only NearLake is true.
Step 3 — Author a goal¶
- Right-click → Miscellaneous → Data Asset → IntentGoal. Name it
DA_Goal_Eat. - Desired State: one row, Bool Fact Equals →
HasFood = true. - Considerations: Goal Consideration: Constant,
Value = 1.0. - Priority:
1.0.
Step 4 — Bundle into an archetype¶
- Right-click → Miscellaneous → Data Asset → IntentArchetypeAsset.
Name it
DA_Archetype_Forager. - Schema:
DA_Schema_Forager. - Goals: add
DA_Goal_Eat. - Actions: add
DA_Action_ForageandDA_Action_HuntFish.
Step 5 — Put the component on a pawn¶
- Open any pawn Blueprint (a basic AI character will do).
- Add Component → IntentForge Component.
- In the component's Details panel:
- Archetype:
DA_Archetype_Forager. - Leave
Replan Safety Net Interval,Min Action Commit Time, andGoal Momentum Bonusat defaults.
Step 6 — Wire StateTree execution¶
- Create a new StateTree asset, schema StateTreeComponentSchema.
Name it
ST_Forager. - Add a state called
RunIntentForge. - Add the
Run Action (IntentForge)task to that state. The task has one external data slot — point it at your pawn'sIntentForgeComponent(the editor surfaces this in the task's details). - Set the state as Root.
- Add a StateTree Component to your pawn Blueprint and assign
ST_Forageras its StateTree.
Step 7 — Sense the world¶
The simplest way to set facts is to call SetFactBool on the component
from Blueprint. For the tutorial, just hardcode NearTree = true in
BeginPlay so the agent always plans to forage.
In a real game this would come from AIPerception, overlap events, or distance checks against world POIs.
Step 8 — Run it¶
- Drop the pawn in a level.
- Hit Play.
- Open the Gameplay Debugger (apostrophe key by default), select the pawn, and find the IntentForge category. You should see:
Archetype: DA_Archetype_Forager
Goal: DA_Goal_Eat (cost 1.00)
Plan:
-> [0] DA_Action_Forage
World State (v=2):
HasFood = false
NearTree = true
NearLake = false
- After ~2 seconds the Wait executor completes, the planner re-evaluates,
sees
HasFood = true, and the plan goes empty (goal satisfied).
You've shipped your first plan. Read the Cookbook for patterns that build on this baseline.
What just happened, in 5 bullets¶
- The component asked the planner for a plan toward
Eat. - The planner enumerated actions whose preconditions held, found
Foragecheaper thanHuntFish, and returned a 1-step plan. - The StateTree task spawned a
UWaitExecutor, calledEnterAction, and ticked it until the 2 s timer elapsed. - The component applied the action's effects (
HasFood = true) to its world state and tried to plan again. - The new plan was empty because the goal was already satisfied.