Перейти к содержимому

Build AI NPCs You Can Actually Talk To in Unreal Engine 5

UnrealOps

0:00 / 0:00

Build AI NPCs You Can Actually Talk To in Unreal Engine 5

782 просмотра · 6 дней назад
UnrealOps
45 подписчиков
782 просмотра · 6 дней назад
What if NPCs in Unreal Engine 5 could remember your conversations, respond based on their own personalities, and generate new dialogue every time you interact with them? In this tutorial, I use Codex CLI, GPT-6 Astra, the OpenAI API, and UnrealAI to build fully AI-powered conversational NPCs inside Unreal Engine 5. We start with a playable forest campsite and use Codex to create three distinct NPCs—a camp counselor, fisherman, and hiker—each with their own persona and personality. From there, we build the complete player interaction system: idle and talking animations, proximity-based interaction, camera transitions, dialogue UI, and branching conversation choices. Before adding AI, we first build a traditional static dialogue tree to establish the gameplay foundation. We then replace that system with AI-generated dialogue so that both the NPC responses and the player’s conversation choices are generated dynamically. Each NPC receives its persona and personality as context, and the system keeps the last 30 messages from previous interactions so characters can remember earlier conversations and use that history when you return to speak with them. Along the way, we also use Codex to create IK rigs and an IK Retargeter for Mixamo animations, assemble NPCs from a modular character pack, implement the interaction system, and integrate the UnrealAI plugin with the OpenAI API. By the end of the video, we have three animated AI NPCs that can hold dynamic conversations, maintain their individual personalities, and remember what the player previously discussed with them. If you're interested in Unreal Engine 5, AI NPCs, generative AI for games, Codex CLI, GPT-6 Astra, or using AI coding agents to accelerate game development, this tutorial gives you a practical system you can build on. 🔗 RESOURCES FROM THE VIDEO UnrealAI — Generative AI Plugin for Unreal Engine https://github.com/UnrealOps/UnrealAI Codex CLI https://learn.chatgpt.com/docs/codex/cli Stylized Modular Character — Fab Marketplace https://www.fab.com/listings/98a26af6... Mixamo — Character Animations https://www.mixamo.com/ OpenAI API Keys https://platform.openai.com/api-keys Official Unreal Engine MCP Server Documentation https://dev.epicgames.com/documentati... 🎥 RELATED TUTORIALS Build a Playable Unreal Engine 5 Level with AI    • Build a Playable Unreal Engine 5 Level wit...   Using the Unreal Engine 5 MCP Server with Claude Code, Codex CLI, and Cursor https://unrealops.substack.com/p/usin... 🚀 MY PROJECTS Substack https://unrealops.substack.com/ Epic Developer Community https://dev.epicgames.com/community/p... GitHub https://github.com/UnrealOps ⚠️ NOTE The API key setup shown in this video is intended for local development and demonstration purposes. Do not ship an API key or .env file containing secrets with a production game. Use an appropriate secure backend or secret-management architecture for production applications. 💬 What would you build with persistent AI NPCs—companions, quest givers, merchants, enemies, or something completely different? If this video helped, subscribe for more practical Unreal Engine 5, AI, and agentic game development workflows. #UnrealEngine5 #AINPCs #Codex