Skip to main content
Euca’s in-engine AI drives NPCs, and it is classical and deterministic — not a language model. Two layers: a simple steering goal you set over HTTP, and a full behavior-tree library (euca-ai) you author in Rust.
“AI” here is never an LLM. The agents that drive Euca are external clients (your code or model, over the API). This page is about the NPC AI that lives inside the world. Fully headless.

Steering goals (HTTP)

POST /ai/set attaches an AiGoal with one of four behaviors — idle, patrol (waypoints), chase (a target), flee — plus a speed. The ai_system computes a desired velocity each tick.
# Make entity 0 chase entity 1
curl -s -X POST http://localhost:3917/ai/set \
  -H 'Content-Type: application/json' \
  -d '{"entity_id":0,"behavior":"chase","target":1,"speed":3.0}'
# {"ok":true,"message":"Set entity 0 AI to chase"}

curl -s -X POST http://localhost:3917/step -H 'Content-Type: application/json' -d '{"ticks":1}'
curl -s http://localhost:3917/entities/0
# {"id":0,"ai":"chase (target: 1)","velocity":{"linear":[1.79,...],...}}

Behavior trees (euca-ai)

For richer NPC logic, the euca-ai crate is a full behavior-tree library:
  • CompositesSequence, Selector, Parallel { RequireAll | RequireOne }
  • DecoratorsInverter, RepeatN, RepeatUntilFail, Cooldown, Guard
  • LeavesAction (MoveTo, Wait, SetBlackboard, Log, Custom) and Condition (HasKey, Compare, InRange, IsAlive, Custom)
  • Blackboard — a per-entity typed key-value store; BtBuilder is a fluent construction DSL.
behavior_tree_system ticks every BehaviorTreeExecutor. Behavior trees are authored in Rust today (there is no behavior-tree HTTP surface — the HTTP path is /ai/set).

Endpoints

MethodPathDescription
POST/ai/setSet an NPC steering goal (idle/patrol/chase/flee)

Status

  • ✅ Steering goals (idle/patrol/chase/flee), behavior-tree library (composites, decorators, leaves, blackboard, builder) — shipped and headless, no stubs.

AI endpoint

The /ai/set endpoint with schema.