Expand description
§jugar-ai
AI systems for Jugar including Behavior Trees, GOAP, and Aprender integration.
Per spec Section 5.3: Aprender AI Integration for YAML-first game creation.
§Example
ⓘ
use jugar_ai::{AiSystem, YamlAiBridge, AiInputs};
use glam::Vec2;
let mut system = AiSystem::new();
let bridge = YamlAiBridge::new();
// Resolve YAML AI keyword
let model_id = bridge.resolve("builtin:chase", &mut system)?;
// Run inference
let inputs = AiInputs::from_positions(
Vec2::new(0.0, 0.0),
Vec2::new(100.0, 50.0),
0.016,
);
let outputs = system.infer(&model_id, &inputs)?;Structs§
- Action
- An action for GOAP planning
- AiComponent
- AI component attached to entities
- AiInputs
- Input data for AI inference
- AiOutputs
- Output from AI inference
- AiSystem
- The AI system that manages and runs AI models
- Behavior
State - Current state of a behavior
- Goal
- Goal for GOAP planning
- Planner
- GOAP Planner
- Selector
- Selector node - runs children until one succeeds
- Sequence
- Sequence node - runs children in order until one fails
- World
State - World state for GOAP planning
- Yaml
AiBridge - Bridge between YAML keywords and AI behaviors
Enums§
- AiError
- AI system errors
- Node
Status - Behavior tree node status
Traits§
- Behavior
Node - Behavior tree node trait
Type Aliases§
- Result
- Result type for AI operations