← All namespaces

ai

AI & gameplay Experimental

Wire AI assets across perception, blackboards, behavior trees, EQS, Mass, Smart Objects, and StateTree.

What it's for

This namespace creates and configures the assets that make an AI think and act: AI Controller Blueprints, Blackboard data assets, Behavior Trees, perception components, EQS queries, Mass Entity Configs, Smart Object Definitions, and StateTree assets. It covers the whole authoring surface, from making a fresh asset to wiring it onto a controller and tuning its parameters.

Reach for it when a task spans several AI subsystems at once, or when you need to connect AI assets to a controller or Blueprint. A single request such as "stand up a patrolling enemy" can create the controller, blackboard, and behavior tree, then bind them together, all through this one namespace.

For lower-level graph edits inside an individual Behavior Tree asset, use the dedicated behavior_tree namespace instead. New Environmental Query System authoring lives in eqs, and native StateTree editor-node edits live in state_tree — the matching ai.* entry points remain as compatibility shims over those surfaces.

This area is experimental and still improving. Method shapes and coverage across the AI subsystems may change between releases.

Examples

Stand up an AI controller with a blackboard and behavior tree

Create the three assets and bind them together in one pass.

You: Make an AI controller for the guard, with its own blackboard and behavior tree, all wired up.

  call("ai.create_ai_controller", {name:"BP_GuardController"})
    → {ok:true, path:"/Game/AI/Controllers/BP_GuardController"}
  call("ai.create_blackboard_asset", {name:"BB_Guard"})
    → {ok:true, path:"/Game/AI/Blackboards/BB_Guard"}
  call("ai.create_behavior_tree", {name:"BT_Guard"})
    → {ok:true, path:"/Game/AI/BehaviorTrees/BT_Guard"}
  call("ai.assign_blackboard", {controllerPath:"/Game/AI/Controllers/BP_GuardController",
        blackboardPath:"/Game/AI/Blackboards/BB_Guard"})
    → {ok:true}
  call("ai.assign_behavior_tree", {controllerPath:"/Game/AI/Controllers/BP_GuardController",
        behaviorTreePath:"/Game/AI/BehaviorTrees/BT_Guard"})
    → {ok:true}

Done. BP_GuardController runs BT_Guard against BB_Guard.

Add a blackboard key

Give the blackboard a typed key the behavior tree can read and write.

You: Add a TargetActor object key to BB_Guard.

  call("ai.add_blackboard_key", {blackboardPath:"/Game/AI/Blackboards/BB_Guard",
        keyName:"TargetActor", keyType:"Object", baseObjectClass:"/Script/Engine.Actor"})
    → {ok:true, key:"TargetActor"}

Done. TargetActor (Object) added to BB_Guard.

Configure sight perception on the controller

Tune the sight sense so the guard spots targets at the right range.

You: Give the guard sight out to 1500 units with a 90 degree cone.

  call("ai.configure_sight_config", {blueprintPath:"/Game/AI/Controllers/BP_GuardController",
        sightConfig:{sightRadius:1500, loseSightRadius:1800, peripheralVisionAngle:90}})
    → {ok:true}

Done. Sight configured: 1500 unit radius, 90 degree cone.

← Back to all namespaces