# What is an NPC dialogue?
NPC dialogues (Non-Player Characters) are conversations powered by artificial intelligence that allow readers to freely converse with the characters in your story. Instead of offering pre-written responses, the AI embodies the character and responds consistently with their personality, knowledge, and the story's context.
Living characters
# Configuring a dialogue step
To create a dialogue step, you need to configure several elements: the character who speaks, the instructions that define their behavior, the contextual content, and the conversation parameters.
Choose the character
Select the character from your story who will be embodied by the AI. Their attributes and biography will serve as the basis for the conversation.
Write instructions
Write detailed instructions for the AI: the character's tone, what they know and don't know, their motivations, their potential secrets.
Define contextual content
Write the scene context that will frame the conversation (where the dialogue takes place, what just happened).
Configure parameters
Set the welcome message, message limit, end conditions, and closing messages.
# Welcome message and closing messages
The welcome message is the first message displayed to the reader when they enter the dialogue step. The character speaks first to establish the context of the conversation.
Two types of closing messages can be defined:
- Condition-based closing message — Displayed when the dialogue's end condition is met (the player obtained the sought information, the NPC accepted a proposal, etc.).
- Limit-based closing message — Displayed when the maximum number of messages is reached without the end condition being met. This message can reflect the NPC's impatience or the natural end of the conversation.
# Message limit
The max messages parameter defines the maximum number of exchanges allowed in the dialogue. This limit controls the conversation duration and prevents endless interactions. When the limit is reached, the limit-based closing message is displayed and the reader moves to the next step.
Balancing the limit
# End conditions
End conditions define the criteria that naturally end the dialogue. The AI automatically detects when the condition is met during the conversation. For example: the player obtained the password, the NPC revealed their secret, or the player convinced the guard to let them through.
Depending on whether the end condition is met or not, a different closing message is displayed. This distinguishes a successful conversation (the player got what they were looking for) from a failed one (the message limit was reached).
# Icon in the step list
Dialogue steps display a message icon in the step list, allowing you to visually identify them among your standard steps and explorations.

# Testing dialogues
From the step editor, you can test your dialogue directly. The test interface lets you converse with the character just as a reader would, verify that instructions are properly followed, and that end conditions work correctly.

# Best practices for instructions
- Define the personality — Describe the character's temperament in detail: are they suspicious, jovial, enigmatic, impatient?
- Specify knowledge — Clearly indicate what the character knows and doesn't know. The AI must not reveal information the character doesn't possess.
- Mention secrets — If the character is hiding something, specify under what conditions they may reveal it (player insistence, keyword, presented evidence).
- Provide emotional context — Is the character stressed, angry, in love? Their emotional state will influence the tone of their responses.
- Set boundaries — Indicate topics the character refuses to discuss or actions they refuse to take.
- Use examples — Provide examples of typical lines to help the AI capture the character's speech style.