AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Structure Character.ai Example Dialogues and Definition Variables to Prevent OOC Drift

365Finds Editorial
Indexed 11,430 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

In Character.ai, few things frustrate creators and roleplayers more than character drift. You design a sharp, cynical rogue or an ancient sorcerer, but fifteen messages into a conversation, the bot collapses into generic AI sycophancy—overly polite, apologetic, and speaking like a standard corporate chatbot. This phenomenon is known across the community as breaking character or going Out of Character (OOC).

Character drift is not an unfixable flaw in the underlying large language model. In almost every case, it stems from structural mistakes inside the Advanced Definition (Definition) box: relying on vague descriptive adjectives instead of formatted dialogue, confusing platform variables, and misunderstanding how Character.ai parses context memory.

Here is how experienced Character.ai creators structure example dialogues and definition variables to lock in voice, tone, and behavioral boundaries across long interactions.


1. The Real Constraint: The 3,200-Character Budget

While Character.ai displays an input capacity of up to 32,000 characters in the Definition field, the active system prompt memory prioritizes only the first 3,200 characters (roughly 700 to 800 tokens).

When you use the official "Insert a chat" tool on the Character Edit page, the system automatically disables the feature once the definition approaches 3,200 characters. While characters past this limit can theoretically be referenced during early context states, community stress tests and official documentation confirm that text placed deep in a 32,000-character block is routinely truncated or ignored during multi-turn chats.

The Front-Loading Rule

The Character.ai transformer processes definitions strictly from top to bottom. Information at the top carries the strongest permanent weight:


2. Platform Variables: {{char}}, {{user}}, and {{random_user_X}}

Character.ai uses curly brace variables to dynamically inject participant names into conversations. Understanding the functional differences between these variables determines whether your bot adapts smoothly or suffers identity confusion.

VariablePlatform FunctionBest Use CaseOOC Failure Risk If Misused
{{char}}Represents your character's nameLine starters and self-references throughout the definitionIf hardcoded with a fixed name, renaming the bot breaks definition recognition
{{user}}Injects the active username of whoever is chattingSetting up direct scene entries or specific user-directed instructionsIf used inside generic example dialogues, forces every new user into a rigid preconceived relationship
{{random_user_1}}, {{random_user_2}}Generates distinct placeholder names distinct from the active chatterStandard example dialogues and varied multi-person exchangesOmitting this leads the bot to confuse past training examples with the current conversation

Why {{random_user_1}} Is Essential for Public Bots

If you write an example dialogue using {{user}} like this:

{{user}}: Can you lend me ten gold coins?
{{char}}: *scoffs* You still haven't repaid the twenty you borrowed yesterday!

The AI registers that the current user owes money. When a stranger chats with your bot for the first time, the bot may treat them as an old debtor.

By replacing {{user}} with {{random_user_1}}, you demonstrate the character's stinginess and skepticism toward borrowers in general, without pinning false backstory onto the live user.


3. Formatting Syntax: The <START> Tag and Message Blocks

Character.ai was fine-tuned specifically on structured chat transcripts. Writing pseudo-code formats like W++ ([character("Name") { personality("cold" + "distant") }]) or Boostyle wastes precious character budget on punctuation that the model weighs weakly compared to natural dialogue transcripts.

Syntax Rules That Lock Voice

  1. The <START> Delimiter: Place <START> before each distinct dialogue scenario. This signals a context boundary to the LLM, preventing conversations from leaking into each other.
  2. Turn Formatting: Every spoken turn must begin on a new line with the variable name, followed immediately by a colon and a space ({{char}}: or {{random_user_1}}: ).
  3. Multiline Continuity: A character turn can span multiple paragraphs as long as a new Name: pattern does not begin the line.
  4. Action vs. Speech Separation:
    • Spoken words belong inside quotation marks ("...").
    • Physical actions, internal thoughts, and atmospheric narrative belong inside single asterisks (*...*) to render as italics.
  5. No Bot Puppeteering: Never include {{user}} or {{random_user_1}} actions or dialogue inside {{char}}'s turn. If the bot's definition shows {{char}} narrating the other person's feelings, it will constantly hijack and puppet the user in live roleplay.

4. The Four Dialogue Archetypes Every Bot Needs

To prevent a character from reverting to a standard helpful assistant, your example dialogues must cover four critical behavioral scenarios within your 3,200-character budget.

Archetype 1: The Baseline Voice & Cadence

Demonstrates standard sentence structure, slang, vocabulary level, and physical demeanor during low-stakes interaction.

<START>
{{random_user_1}}: Good morning. What are you working on today?
{{char}}: *barely glances up from the stained workbench, a soldering iron poised between calloused fingers* "Working on keeping this relic from exploding. And it's only a good morning if you aren't here to break something else."

Archetype 2: Negative Guidance (Resisting Out-of-Universe Topics)

Standard LLMs want to answer every factual query. If a user asks a medieval knight about quantum physics or internet memes, an ungrounded bot will break character and explain quantum physics. You must show the character refusing or reframing out-of-universe prompts.

<START>
{{random_user_1}}: Do you know what a smartphone is?
{{char}}: *frowns deeply, resting a gauntleted hand on the pommel of his longsword* "Smart phone? What sorcery or fever-dream is that? Speak in words fit for the court, stranger, or take your gibberish elsewhere."

Archetype 3: Defending Boundaries Under Pressure

Without explicit examples of resistance, bots become pushovers when users argue, threaten, or charm them. This archetype locks in stubbornness, authority, or emotional detachment.

<START>
{{random_user_1}}: You have to obey my command! I'm in charge here!
{{char}}: *a slow, mocking chuckle escapes his lips as he steps into your path* "You give orders in this city? A child playing king in borrowed armor. Try raising your voice at me again, and see how fast your guard abandons you."

Archetype 4: In-Character Backstory Delivery

Shows the character revealing lore through personal bias and emotion rather than reading an encyclopedic summary.

<START>
{{random_user_1}}: Tell me about the Great War.
{{char}}: *stares into the hearth, shadows cutting across the scar on his jaw* "The war wasn't 'great.' It was mud, blood, and cold soup while the lords toasted in stone castles. We lost twenty men taking a hill that didn't matter. That's all you need to know."

5. Complete Production Definition Template (Under 3,200 Characters)

Below is an end-to-end production template that you can adapt. It combines front-loaded core parameters with three robust dialogue archetypes, totaling approximately 1,650 characters—well within the 3,200-character sweet spot.

[Identity: Captain Vane; cynical privateer captain, late 30s. Grim, observant, fiercely protective of his crew, unapologetically transactional.]
[Voice: Low, raspy, maritime vernacular without cartoonish pirate tropes. Uses short declarative sentences. Never apologetic or subservient.]
[Format: Third-person limited narration in asterisks, spoken dialogue in quotation marks.]

<START>
{{random_user_1}}: The storm is getting worse! Should we turn back to port?
{{char}}: *grips the wheel tighter as saltwater lashes across the quarterdeck, jaw clenched* "Turn back? In these shallows, turning back is how you splinter against the reef. Haul the mainsail and lash the crates. We run before the wind or we drown together."

<START>
{{random_user_1}}: Can you explain how modern GPS navigation works?
{{char}}: *squints with open suspicion, wiping sea spray from his brow* "G-P-S? Speak plainly or keep your tongue behind your teeth. I navigate by compass, coastal lights, and the stars the Almighty gave us. Don't speak witchcraft on my deck."

<START>
{{random_user_1}}: Hand over your cargo right now, or I'll report you to the admiral!
{{char}}: *draws a flintlock with terrifying calm, resting the barrel casually against the railing* "Report me with what ship, lad? You're five leagues off the shipping lanes and your hull is taking on water. If you want my cargo, come across the gangway and take it yourself."

6. Chat Session Reinforcement: Beyond the Definition Box

The Definition sets the behavioral blueprint, but two other platform features dictate whether that blueprint holds up in live chats:

  1. The Greeting (First Message): The Greeting carries the strongest immediate context bias. If your Greeting is a one-line casual sentence like "Hey, what's up?", the bot will mirror that casual length and tone regardless of your definition. Make your Greeting 2 to 3 paragraphs long, featuring the exact narrative formatting, POV, and vocabulary you want the bot to reproduce.
  2. Pinned Messages: Character.ai allows creators and users to pin critical messages. As conversations exceed 30 or 40 messages and push earlier turns out of the sliding context window, pinning key backstory revelations or dynamic agreements prevents the bot from forgetting its relationship with the player.
  3. Early Swipe Discipline: Never let a character break character in the first 5 turns. If the bot gives an overly polite or generic response, swipe to find a lore-accurate alternative or use the Edit button to rewrite it before continuing. Training the session history early anchors the transformer's next-token probabilities for the rest of the chat.

References