Behavior Systems

Agent
Intelligence

Behavior trees, utility AI, and a streaming nav mesh. Authored visually, hot reloaded at runtime, and debugged inline against a live game.

What the AI stack actually is

Crowe AI is not a single decision model. It is three cooperating systems. A behavior tree engine that handles the tree shaped decisions most NPCs need, a utility scorer for the decisions where a tree gets awkward, and a navigation runtime that gives both of them a world to move through.

Trees are hot reloaded. Edit in the visual authoring tool, save the file, and agents pick up the new tree on their next tick without a rebuild or a level reload. The editor shows you the active node for every selected agent, live, while the game runs.

The nav mesh is not a prebake. It is a runtime surface that stitches across streamed chunks and rebuilds only the parts that changed. A demolition or a procedural corridor updates navigation within the same frame it changes geometry.

Neural network visualization
Components

The three cooperating systems

Behavior Trees

Composable trees with blackboards

Selectors, sequences, parallels, decorators, and leaf tasks. Each tree owns a scoped blackboard, and child subtrees inherit or shadow keys explicitly. This keeps large AI codebases sane once you pass the hundred tree mark.

  • Hot reload without losing agent state
  • Scoped blackboards with type checked keys
  • Event driven decorators for interrupts
  • Visual debugger pins to any live agent
Utility AI

Utility scored decisions

For decisions that do not fit a tree, write scoring curves and let the agent pick the action with the highest weighted utility. Curves are authored like animation curves and live in the same data. You get explanations for why an action won.

  • Curve based scoring with preview
  • Per archetype weight sets
  • Inspector shows decision breakdown
  • Drops into a tree as a single node
Navigation

Streaming nav mesh

A tile based runtime nav mesh that rebuilds only the tiles that changed. Off mesh links carry agents across jumps and doors. Areas tag cost for each agent type so the same mesh serves humans, vehicles, and aerial units.

  • Tile granular incremental rebuild
  • Off mesh links for jumps, doors, ladders
  • Per agent area costs and filters
  • Path smoothing with funnel algorithm
Perception

Sight, sound, and memory

A perception system that emits stimuli, decays them over time, and exposes a memory buffer to the behavior tree. Sight uses the physics query API. Sound attenuates through the same propagation used for audio mixing.

  • Stimulus decay with per sense curves
  • Shared sight rays with batching
  • Sound propagation matches audio mixer
  • Per agent working memory window

Wiring an agent

A tree, a blackboard, and a navigation agent. That is the whole setup:

C#
// Create an agent with a behavior tree and a nav agent
var agent = World.CreateEntity("Guard_01");

agent.Add<NavAgent>(new NavAgentDesc {
    Radius = 0.4f, Height = 1.8f,
    AreaFilter = NavArea.Walkable | NavArea.Jumpable
});

agent.Add<BehaviorTree>(Resources.Load<BehaviorTree>("ai/guard_patrol"));

// Set starting blackboard values
agent.Blackboard.Set("patrolRoute", Resources.Load<NavRoute>("routes/warehouse_A"));
agent.Blackboard.Set("alertThreshold", 0.65f);

// Hot reload picks up any edits made in the tree editor
BehaviorTree.WatchForChanges = true;

Budget per agent

Numbers below are from a 500 agent stress scene on a single CCD of a Ryzen 9 7950X. All three subsystems active, perception enabled.

500Active agents
2.4msAI tick cost per frame
4.8μsMedian tree tick
12Nav tiles rebuilt per sec
Applications

Shipping patterns

Squad and companion AI

Tree driven roles with utility overrides for combat target selection. Perception handles the subtle behavior players notice, like guards hearing you two rooms away and escalating rather than sprinting the moment they see you.

Open world crowd

Simple trees ticked on a low frequency schedule, plus spatial queries run in batches. Streaming nav keeps crowds walking across chunks that just finished loading without pathfinding glitches.

Strategy and simulation

Utility scoring replaces scripted priority tables. Designers tune curves instead of hand authoring branches, which is faster to iterate on and easier to explain in a review meeting.

Related

Keep going

Wire an agent in the editor

The guard patrol sample runs out of the box. Edit the tree, save, and watch the agent pick up the change on its next tick.