Games

Conversational AI NPCs for games

Build a talking NPC with a persona, voice and game-world knowledge. Connect scene context and permitted Blueprint actions so players can converse with the character.

Dialogue trees have a hard ceiling: the player can only ask what a writer thought of. An IAMX NPC has a persona, a memory, knowledge of your world and a set of things it is allowed to do, so the player can ask anything and the answer stays in character. You set the character up in IAMX Studio and connect it to your Unreal project with one component.

The IAMX component added to a character Blueprint in Unreal Engine
One component on your character Blueprint is the whole integration. The character itself is set up in IAMX Studio.

What an IAMX NPC can do that a scripted one can't

CapabilityWhat it means in your game
Unscripted conversationThe player speaks or types anything. The NPC answers in character, in its own voice, with lip sync.
Scene awarenessThe NPC knows what you told it is around it. "What's that on the table?" gets a real answer because the objects you registered are described to it.
Movement decisionsIt can decide to walk somewhere, follow the player, stop or wait because the conversation called for it. Your Blueprint carries out the movement.
GesturesIt picks gestures such as wave, nod or point to match what it says, and your montages play them.
Your own actionsAnything you expose from Blueprint: open a door, hand over an item, start a quest, sound an alarm.
NPC-to-NPCStart Npc Conversation passes each reply of one IAMX component to another as its next input. With cloud characters both share one session, so one character answers every line; see NPCs that talk to each other.
MemoryWith memory on, it remembers each player between sessions: what they did, what they promised, what they were told last time.
Lore that stays consistentYour world bible goes in the knowledge base, so the NPC quotes your canon instead of inventing it.

Set up the character in IAMX Studio

There is no game-specific template in the cloud studio. New character on the Characters page creates a draft at once and opens the editor on Templates, where you pick a look. Then set it up for a game:

  1. Write who it is: on Identity, fill in Name, Role, Background / Persona and Conversation Style.
  2. Keep answers short: on Mind & knowledge › Core AI, pick the model and set Max Tokens (per response) under Generation Settings.
  3. Pick a fast voice: on Language & voice › Language & Voice, choose the voice and a fast TTS Model.
  4. Turn on the game switches: on Identity & model › Model settings › UE Plugin Settings, switch on Game Actions (MoveTo / Follow / …) and Conversational Gestures as needed.
  5. Save: press Save in the editor toolbar. The settings apply from the next session.
Keep replies short. An NPC that delivers a paragraph breaks the pace of a game far more than one that says three sentences. A few hundred tokens in Max Tokens (per response) is plenty for most NPCs.

Making it aware of the world

The two switches on UE Plugin Settings give the language model ready-made tools:

Then, from Blueprint, tell it what is around it. Register the objects and characters you want it to know about, a name and a short description each, with Register Scene Object or Register Scene Actor. Those become things it can talk about and target. Register them once the session has started: the Blueprint API page shows the event to use.

Scene objects you register:
  "Tavern door"      — heavy oak door, leads to the street
  "Bruno"            — the blacksmith, working at the anvil
  "Locked chest"     — iron chest by the fireplace, no key in sight

The NPC can now answer "who's that by the anvil?", walk to the door when it says it's leaving, and refuse to open the chest because it hasn't got the key.

Register only what matters. An NPC handed hundreds of scene actors spends its attention on furniture, and one update carries at most 100 objects. Give it the handful of things a player might ask about, and update the list as the scene changes.

Letting it run your game logic

This is the part that turns conversation into gameplay. You define an action with Register Action or in the component's Local Action Tools, for example give_quest, open_gate or hand_over_item, with a description of when to use it. The NPC decides to call it mid-conversation and your Blueprint runs.

  1. Define the action and describe it the way you'd brief an actor: "Use this when the player agrees to help find the missing shipment."
  2. Handle the event: bind On Action Received and branch on the action name, then start the quest, spawn the marker or play the cutscene.
  3. Test with an oblique request. Don't say "give me the quest"; say "alright, I'll look into it" and check that it fires. That is what players will actually say.
Write the action description in terms of player intent, not keywords. "When the player agrees to help" catches "sure", "fine, I'll do it" and "where do I start?"; a keyword list catches none of them.

NPCs that talk to each other

Start Npc Conversation links two IAMX components for an exchange. Call it on one component with the other component, a Topic and Max Turns (default 6, from 1 to 50). The first component sends the topic as its text input; after that, each complete reply is sent to the other component as its input. The exchange ends after at most Max Turns replies, when you call Stop Npc Conversation, or when text is sent to either component with Send Text Input or the built-in chat; that component then answers the text. The node does nothing if the other component is the same one or either one is already in an exchange.

The plugin keeps one IAMX connection per game instance, and it holds one session. Each IAMX component that begins play with the connection on reconnects it to its own character, so the character of the component that began play last answers every turn, whichever component sends it, and every connected component receives and plays the replies. A component that begins play with the connection off closes the connection. Use one IAMX component per game instance.

For an exchange between cloud characters, this means both components use the same session: the topic and every handed-on line go to the character of the component that began play last, that character answers every line, and each reply reaches both NPCs. In one game instance the node does not give you two cloud characters that each answer with their own persona and voice.

Quests and story structure

For an NPC that has to move a story forward rather than just chat, write the stages and what moves the player from one to the next into its Background / Persona. Keep the current stage up to date from Blueprint with Set Context Fact, for example Set Context Fact("quest_stage", "The player agreed to find the shipment"), and let actions report progress back to your game. The NPC improvises the words; the instructions and the facts keep it on mission.

The studio's Narrative tab stores a stage graph with the character, but in the current version conversations do not follow it. Use the persona and context facts as above.

Practical matters

Usage per NPC

Usage is counted per conversation turn, in quota units from your plan, not per NPC. Units are weighted, so heavier models and realtime voice use more per turn. An NPC nobody talks to uses none, and each line of an NPC-to-NPC exchange is a turn. Use the lightest model that holds character: for most NPCs a small fast model is not just adequate but better, because waiting is what breaks immersion. See plans & quota.

NPC typeSuggested setup
Ambient villagerSmall fast model, a higher temperature, short replies, no actions
Quest giverSmall fast model, the quest stages in its persona, your Blueprint actions registered
Companion who remembers youMid-tier model, Long-term Memory enabled with a longer Retention Period (days)
Central story characterFlagship model, world lore in the knowledge base, actions and tools attached
Memory and emotion state are kept per speaker ID. Set the component's CloudSpeakerId to a stable value per player, so each player gets their own memory instead of sharing default-user.

Latency

Three settings decide how alive an NPC feels, and none of them is the model's intelligence:

Keeping it in character

Use Behavior › Guardrails (Enable guardrails, then write the Rules) to stop the illusion breaking: no discussing the real world, no admitting to being an AI, no answering questions this character could not possibly know. A medieval blacksmith explaining machine learning ends the immersion instantly.

Give each NPC only the lore it would have. The innkeeper knows the village and the road; the court advisor knows the politics. On each character's Mind & knowledge › Knowledge Base tab, switch on only the files that character should know.

Getting started

  1. Install the plugin in your project.
  2. Create a character in IAMX Studio, write its persona on Identity, and turn on the UE Plugin Settings you need.
  3. Copy its Character ID from Channels › Publish and create an API key on My workspace › API Keys.
  4. Add the IAMX component to your NPC Blueprint and enter the connection settings. Set its Interaction Mode to Proximity if the conversation should start when the player walks up.
  5. Add the three animation nodes so it lip syncs and looks at the player.
  6. Press Play and talk to it. Then add scene objects, actions and lore.

Where to go next

Wire the actions

Actions & Blueprints →

Full Blueprint reference

Blueprint API →

Give it your lore

Knowledge Base →

IAMX AI STUDIO