Skip to content

Node Types ​

LLMStateTree supports the following StateTree node types. All node types are automatically discovered from UE reflection via the schema system.

Schema File: Config/Schemas/StateTreeNodeSchema.llmstateschema


State Types ​

State ​

Basic state that executes tasks and transitions to other states.

json
{
  "name": "Idle",
  "type": "State",
  "tasks": [...],
  "transitions": [...]
}

Group ​

Container state that manages child states with a selection behavior.

json
{
  "name": "Patrol",
  "type": "Group",
  "selectionBehavior": "TrySelectChildrenInOrder",
  "children": [...]
}

Selector ​

Utility AI selector - evaluates children and selects highest utility.

json
{
  "name": "SelectAction",
  "type": "Selector",
  "selectionBehavior": "UtilityMax",
  "children": [...]
}

Sequencer ​

Executes children in sequence, succeeds when all complete.

json
{
  "name": "AttackSequence",
  "type": "Sequencer",
  "children": [...]
}

Tasks ​

Tasks are behaviors executed within a state.

StateTreeDelayTask ​

Wait for a specified duration before succeeding.

PropertyTypeDescription
DurationfloatTime to wait in seconds
RandomDeviationfloatRandom deviation range
bRunForeverboolRun indefinitely

StateTreeMoveToTask ​

Move to a target location (from GameplayStateTree module).

StateTreeRunParallelStateTreeTask ​

Run another StateTree in parallel.

PropertyTypeDescription
StateTreeobjectReference to another StateTree asset
PropertyOverridesarrayProperty override bindings

StateTreeDebugTextTask ​

Draw debug text on HUD.

PropertyTypeDescription
TextstringDebug text to display
TextColorcolorText color
FontScalefloatFont scale
OffsetvectorScreen offset
ReferenceActorobjectActor to attach text to

Conditions ​

Conditions are boolean checks for transitions.

StateTreeCompareIntCondition ​

Compare two integers.

PropertyTypeDescription
OperatorenumLess, LessOrEqual, Equal, NotEqual, GreaterOrEqual, Greater, IsTrue
LeftintLeft operand
RightintRight operand

StateTreeCompareFloatCondition ​

Compare two floats.

PropertyTypeDescription
OperatorenumLess, LessOrEqual, Equal, NotEqual, GreaterOrEqual, Greater, IsTrue
LeftfloatLeft operand
RightfloatRight operand

StateTreeCompareBoolCondition ​

Compare two booleans.

PropertyTypeDescription
bLeftboolLeft operand
bRightboolRight operand

StateTreeCompareEnumCondition ​

Compare two enum values.

PropertyTypeDescription
ValueenumEnum value to compare
EnumobjectEnum type reference

StateTreeCompareNameCondition ​

Compare two FName values.

PropertyTypeDescription
LeftnameLeft operand
RightnameRight operand

StateTreeCompareDistanceCondition ​

Compare distance between two vectors.

PropertyTypeDescription
OperatorenumLess, LessOrEqual, Equal, NotEqual, GreaterOrEqual, Greater
SourcevectorSource location
TargetvectorTarget location
DistancefloatDistance to compare against

StateTreeRandomCondition ​

Random chance condition.

PropertyTypeDescription
ThresholdfloatProbability threshold (0-1)

GameplayTagMatchCondition ​

Check if actor has a gameplay tag.

PropertyTypeDescription
TaggameplaytagTag to check
GameplayTagsarrayTag container
bExactMatchboolRequire exact match

GameplayTagContainerMatchCondition ​

Check tag container against another container.

PropertyTypeDescription
MatchTypeenumAny or All
GameplayTagsarrayTags to match against

GameplayTagQueryCondition ​

Check against a Tag Query expression.

StateTreeObjectIsValidCondition ​

Check if an object is valid.

PropertyTypeDescription
ObjectobjectObject to check

StateTreeObjectEqualsCondition ​

Check if two objects are the same.

PropertyTypeDescription
LeftobjectLeft object
RightobjectRight object

StateTreeObjectIsChildOfClassCondition ​

Check if object is of a specific class.

PropertyTypeDescription
ObjectobjectObject to check
ClassobjectClass to check against

Considerations ​

Considerations are utility AI factors that produce a score.

StateTreeConstantConsideration ​

Constant score.

PropertyTypeDescription
ConstantfloatFixed score value

StateTreeFloatInputConsideration ​

Score based on float input with response curve.

PropertyTypeDescription
InputfloatRaw input value
MinfloatMinimum input
MaxfloatMaximum input
DefaultValuefloatDefault when out of range
KeysarrayResponse curve keys

StateTreeEnumInputConsideration ​

Enum-based consideration for Utility AI.


Transitions ​

Transitions define how the AI moves between states.

json
{
  "trigger": "OnStateCompleted",
  "type": "GotoState",
  "target": "Patrol"
}

Trigger Types ​

  • OnStateCompleted - State finished executing
  • OnStateFailed - State reported failure
  • OnEvent - Custom event received

Transition Types ​

  • GotoState - Move to specified state
  • EvaluateConditions - Evaluate conditions before transition

Binding Expressions ​

Use ${} syntax to reference parameters and context data:

  • ${Param.Speed} - Reference a parameter
  • ${Context.Target.Location} - Reference context property
  • ${Param.IdleDuration * 2} - Expressions supported

Powered by VitePress