Getting started
Like every Pulse plugin, Pulse AI is used in four steps: Set Up, Create, Test and Check. The Pulse window (Tools > Pulse > Pulse) walks through them, and its Guide shows each step in the editor. The list at the start of each section comes from the plugin itself; the text after it goes into the details.
The details build a guard that patrols, notices you, chases you, gives up when you run too far and goes back to work. The finished result is /PulseAI/Examples/LV_PulseAI_Example; to see it first, start with Test.
Set Up
The Pulse window (Tools > Pulse > Pulse, tab Workflow, step Set Up) checks each of these and fixes it with a click:
- Optional: Add the Pulse Team component to the Player State. Agents tell friends from enemies by team (Pulse::Team): players need one, a Pulse Team component on the player state (its empty team becomes the Player Team of Project Settings > Pulse > Foundation). Games with their own team logic implement Pulse Team Interface instead.
- Optional: Place Nav Mesh Bounds Volume in the level. Agents move on the navigation mesh: a Nav Mesh Bounds Volume around the area they walk in (scale it to the area after placing it).
- Optional: Connect with PulseGameplay: PulseAICombatBridge. Agents fight with Pulse combat: teams as attitude, attack sets, attack tokens, telegraphs, bosses and encounters with waves.
- Optional: Connect with PulseDialog: PulseAIDialogBridge. Agents in dialogs: they stand still and face the player (In Dialog task), break off on alarm; dialog tasks set their profile or send AI events.
- Optional: Connect with PulseQuest: PulseAIQuestBridge. Agents in quests: quest tasks spawn them, change their profile, send AI events and raise alarms; objectives to defeat a group or escort an agent.
- Optional: Connect with PulseBuild: PulseAIBuildBridge. Agents raid buildings: they find hostile building pieces, move to them and damage them; doors of pieces get navigation links.
- Optional: Connect with PulseTime: PulseAITimeBridge. Daily routines with Pulse Time: windows of the day in which agents use a smart object, go to a place or switch their profile; StateTree nodes for the time of day.
- Optional: Connect with PulseFaction: PulseAIFactionBridge. Agents tell friend from foe by faction: players by their reputation rank, other agents by the relation of their factions; profiles give agents their factions.
- Optional: Connect with PulseGameplay: PulseAIHUDBridge. Awareness markers (“?”, “!”) above agents and attack warnings on the Pulse HUD.
- Optional: Connect with PulseWorld: PulseWorldAIBridge. Agents at camps of Pulse World by biome, paused outside the simulation ring of the players.
Enable the plugin
Enable Pulse AI (it enables PulseFoundation, StateTree, GameplayStateTree, SmartObjects and GameplayBehaviorSmartObjects). Restart the editor.
Navigation mesh
Agents move on the navigation mesh: add a Nav Mesh Bounds Volume around the area they walk in. Set Up checks the level open in the editor and places one with **Add to
Prepare the pawn
Any pawn works; a character moves best.
- Add the component Pulse AI Agent (
UPulseAIAgentComponent). - Set AI Controller Class to
APulseAIControllerand Auto Possess AI to Placed in World or Spawned.
APulseAITestCharacter is a ready test pawn (cylinder body, nose, agent, controller) whose color shows the awareness.
Create
New assets come from Add > Pulse > AI in the content browser or New in the Pulse window:
- AI Profile (
UPulseAIProfile, the main asset): One AI type: StateTree, team, perception, reaction time, speeds, leash, difficulty and extensions; select it on the Pulse AI Agent component. - AI StateTree (
UStateTree, schemaUPulseAIStateTreeSchema): The behavior of an AI type: a StateTree with the Pulse AI schema, built from the Pulse AI tasks, conditions and considerations. - AI Controller (Blueprint of
APulseAIController): An AI controller of your own on top of Pulse AI Controller, which sets up perception, awareness and the brain from the profile. - Starter content: The guard: its profile and its StateTree (patrol, investigate, chase, return home). The example map stays in the plugin. Add Starter Content copies it to
/Game/Pulse/PulseAI.
Write the StateTree
Create an AI StateTree (Add > Pulse > AI > AI StateTree: a StateTree with the schema Pulse AI). A small guard:
| State | Enter condition | Tasks | Transitions |
|---|---|---|---|
| Return Home | Beyond Leash | Return Home | completed → Root |
| Combat | Has Target | (children) | events AwarenessChanged, TargetChanged → Root; tick + Beyond Leash → Return Home |
| Combat / Chase | Target In Range (max 250, inverted) | Move To (Pulse), current target | completed → Combat |
| Combat / Engage | Focus Target, Telegraph | completed → Combat | |
| Search | Awareness Is at least Suspicious | (children) | events → Root |
| Search / Investigate | Investigate | completed → Calm Down | |
| Search / Calm Down | Set Awareness Unaware | completed → Root | |
| Idle | (children) | events → Root | |
| Idle / Patrol | Patrol | failed → Wander | |
| Idle / Wander | Wander | completed → Root |
Put the awareness event transitions on the states that should react, not on the root. A root transition also fires in Return Home, where forgetting the targets changes the awareness and would cut the way home short.
Make a profile
Create an AI Profile (Add > Pulse > AI > AI Profile, class UPulseAIProfile): set the StateTree, the team (Pulse.Team.Enemy; players need a team too: the Pulse Team component on the player state, or PulseAIGrant in a test), sight and speeds. Select it on the agent component.
Patrol route
Place an APulseAIPatrolRoute, move its points in the viewport and select it as the agent’s Patrol Route.
Test
- Play Example in the Pulse window opens
/PulseAI/Examples/LV_PulseAI_Exampleand starts Play in Editor. - Then the cheat
PulseAIGrantgives the player what the plugin needs. - PulseAIGrant gives you a team (Pulse.Team.Player) when the project gives players none. A guard walks its route. Walk into its view: it turns yellow (?), orange (!) and red (fight), follows you and walks home once you are farther away than its leash. PulseAISpawnPatrol spawns another guard, PulseAIInfo prints what the closest agent knows, PulseAIShowLOD shows the LOD; the Live page of the Pulse Debugger shows the agents.
The example map
Play Example for AI in the Pulse window opens /PulseAI/Examples/LV_PulseAI_Example (enable Show Plugin Content in the content browser) and starts Play in Editor; a plain Play works the same.
The guard walks the route; walk into its view and it turns yellow (“?”), orange (“!”) and red (fight), follows you, and walks home once you are farther than its leash.
PulseAISpawnPatrol spawns a guard with a square route in front of you, PulseAIInfo prints what the closest agent knows and which states run.
Pulse AI has no grant cheat: a player needs nothing to be seen. Add > Pulse > AI > Add Starter Content copies the guard profile and its StateTree to /Game/Pulse/PulseAI (the map stays in the plugin). The Live page of the Pulse Debugger shows the agents; all cheats are on Console.
Check
- Check in the Pulse window, Check All there (console
Pulse.Check) or the commandlet-run=PulseCheck -Plugins=PulseAIchecks the setup and validates every AI Profile, AI StateTree and AI Controller in the project.
Profiles validate themselves when they are saved (a StateTree is set, the lose-sight radius is not below the sight radius, the awareness thresholds are in order); Check does it for every profile and AI StateTree of the project, together with the setup. For what agents do at runtime see Debugging.