AI SYSTEMS

AI Systems

Navigation, behavior trees, voice commands, and NPC intelligence. All AI runs on-device with zero cloud dependency.

BEHAVIOR

Behavior Trees

Visual node graph for designing complex NPC behaviors. Composites, decorators, blackboard data sharing, and full serialization.

  • Visual node graph editor for behavior authoring
  • Composite nodes: sequence, selector, parallel, random
  • Decorator nodes: inverter, repeater, cooldown, probability
  • Blackboard for shared data across tree nodes
  • JSON serialization for runtime loading and hot-reloading
Key benefit: Design sophisticated enemy AI without writing state machine spaghetti. Behavior trees are modular, debuggable, and reusable.
// Create behavior tree RakuBT bt = raku_bt_create(); // Build tree structure RakuBTNode root = raku_bt_selector(bt); RakuBTNode combat = raku_bt_sequence(bt); raku_bt_add_child(combat, raku_bt_condition("enemy_visible")); raku_bt_add_child(combat, raku_bt_action("attack", attack_fn)); RakuBTNode patrol = raku_bt_action("patrol", patrol_fn); raku_bt_add_child(root, combat); raku_bt_add_child(root, patrol); // Blackboard data raku_bt_blackboard_set_float(bt, "aggro_range", 15.0f); raku_bt_blackboard_set_entity(bt, "target", player); // Serialize / deserialize raku_bt_save_json(bt, "guard_ai.json"); RakuBT loaded = raku_bt_load_json("guard_ai.json");
VOICE

Voice Commands

On-device speech recognition with intent parsing, wake words, and text-to-speech with lip sync for NPCs. No cloud, no latency.

  • Speech recognition with configurable vocabulary
  • Intent parsing: map spoken phrases to game actions
  • Wake word detection for hands-free activation
  • Text-to-speech with multiple voices and emotions
  • TTS-driven lip sync with viseme generation
Key benefit: Talk to your game. Say "open inventory" or "attack the dragon" and watch it happen. NPCs talk back with synchronized lip animation.
// Register voice commands raku_voice_register_command("open inventory", open_inv_cb); raku_voice_register_command("cast fireball", cast_fire_cb); // Intent parsing with parameters raku_voice_register_intent("attack {target}", attack_cb); // "attack the goblin" -> target = "goblin" // Set wake word raku_voice_set_wake_word("hey raku"); raku_voice_on_wake(on_wake_cb); // Text-to-speech with lip sync raku_tts_speak(npc_entity, "Welcome, traveler."); raku_tts_set_voice(npc_entity, RAKU_VOICE_DEEP_MALE); raku_tts_set_emotion(npc_entity, RAKU_EMO_FRIENDLY); // Lip sync auto-binds to character mesh raku_tts_enable_lipsync(npc_entity, true);
NPC

NPC Intelligence

On-device SLM-powered NPCs with dynamic dialogue, sentiment analysis, and procedural quest generation. Built on the RakuSLM inference engine.

  • Dynamic dialogue generation with context and memory
  • Sentiment analysis on player text and voice input
  • Procedural quest generation based on world state
  • NPC personality profiles with trait-based responses
  • Relationship tracking with reputation and affinity
Key benefit: NPCs that remember conversations, react to player tone, and generate unique quests. Every playthrough is different.
// Create NPC with personality RakuNPC npc = raku_npc_create(entity); raku_npc_set_personality(npc, "gruff but kind blacksmith"); raku_npc_set_knowledge(npc, "knows about the dragon attack"); // Dynamic dialogue const char* response = raku_npc_dialogue( npc, "Do you have any quests for me?" ); // Sentiment analysis on player input RakuSentiment s = raku_npc_analyze_sentiment(player_text); // s.valence, s.arousal, s.dominance // Generate quest from world state RakuQuest quest = raku_npc_generate_quest(npc, world_state); raku_quest_activate(quest); // Relationship tracking raku_npc_modify_affinity(npc, player, +10);

Powered by AI

Every AI system runs on-device via RakuSLM. No cloud calls, no latency, no privacy concerns. Works offline.

NavMesh Pathfinding
Behavior Trees
Voice Commands
Speech Recognition
NPC Dialogue
Sentiment Analysis
Quest Generation
Dynamic Difficulty
Player Profiling
Adaptive Audio
Text-to-Speech
Lip Sync

Build Smarter Games

AI is not a plugin. It is the foundation. Every Raku game has access to navigation, behavior, voice, and NPC intelligence from day one.

Explore the SDK XR Features Spatial Engine