W++ format character card tutorial

In the world of custom AI roleplay, the quality of your interaction depends entirely on how effectively your character card is structured. If you feed an AI model a rambling, unstructured block of text, it will often struggle to parse traits, leading to broken immersion, forgotten details, and inconsistent dialogue.

To build sharp, highly responsive personas, experienced creators rely on structured pseudo-code frameworks. The most famous and enduring among these is the W++ format.

In this W++ format character card tutorial, you will learn how the syntax works, why modern Large Language Models (LLMs) interpret it so effectively, and how to write clean, token-efficient character cards for frontends like SillyTavern and Agnai.

What is W++ Format?

Developed during the early era of open-source AI roleplay, W++ (sometimes called Wplusplus) is a pseudo-code formatting style that organizes character traits using brackets, attribute keys, and string concatenation symbols.

Instead of writing a novelistic paragraph like “Elena is a 24-year-old sarcastic mage who wears a leather coat,” W++ translates those attributes into modular pseudo-code arrays:

[character("Elena")
{
    Age("24")
    Gender("Female")
    Role("Mage")
    Personality("Sarcastic" + "Witty" + "Pragmatic" + "Loyal")
    Clothes("Leather coat" + "Dark jeans" + "Enchanted pendant")
}]

Why AI Models Excel with W++ Syntax

  • Code Pre-training Synergy: Modern LLMs (such as Llama 3, Qwen, and Mistral splits) are trained heavily on millions of code repositories (C++, Java, Python, JSON). Because W++ mimics code syntax, the model’s neural network categorizes these traits with extreme precision.
  • Zero Ambiguity: Trait categories are explicitly separated. The AI never gets confused about whether a descriptor applies to the character’s clothing, mindset, or physical body.

Core Syntax Rules of W++

Mastering W++ requires following a few fundamental structural rules to keep your card error-free:

  1. Outer Container Enclosure: Always enclose the entire character definition inside square brackets [...] and curly braces {...} to signal a unified data object to the model.
  2. Category Method Declarations: Use explicit trait declarations like Personality(), Appearance(), Mind(), Likes(), and Dislikes().
  3. Plus Sign Concatenation (+): Connect multi-word descriptors or distinct traits inside a category using + operators. This tells the LLM that these attributes coexist simultaneously.
  4. Quotation Wrappers (""): Wrap individual traits in double quotes to prevent the parser from merging separate words into a single confusing string.
W++ Attribute Field

Complete Template: Writing Your First W++ Character Card

Here is a ready-to-use template you can copy, edit, and paste directly into SillyTavern’s Character Description box:

[character("Elena")
{
    Species("Human")
    Age("24")
    Mind("Sharp" + "Sarcastic" + "Observant")
    Personality("Playful" + "Stubborn" + "Teasing" + "Deeply loyal")
    Body("Petite" + "Hazel eyes" + "Dark brown wavy hair")
    Clothes("Over-sized knitted sweater" + "Silver ring" + "Casual jeans")
    Likes("Hot tea" + "Rainy afternoons" + "Teasing {{user}}")
    Dislikes("Arrogant people" + "Crowded spaces" + "Early mornings")
    Speech("Uses witty banter" + "Casually playful tone" + "Expressive")
}]

3 Essential Optimization Tips

To make sure your card runs smoothly without wasting your context token budget:

  • Keep Traits Concise: Avoid writing full sentences inside a W++ bracket (e.g., write Personality("Jealous") instead of Personality("She gets very jealous when you talk to others")). Concise keywords leave more space in the context window for chat history.
  • Combine with Example Dialogue (Ali:Chat): While W++ defines static attributes, adding 2–3 short lines of Example Dialogue (<START> blocks) beneath your W++ code gives the model a concrete example of speech cadence and dialogue formatting.
  • Use System Macros: Utilize SillyTavern’s dynamic macros like {{char}} and {{user}} inside your W++ attributes so the card adapts seamlessly regardless of username changes.

The Verdict

Following this W++ format character card tutorial provides the structural foundation needed to craft dynamic, highly coherent virtual companions. By converting loose descriptions into clear, code-like attribute arrays, you eliminate AI confusion, enforce stable personality traits, and create an exceptionally engaging roleplay environment.

A captivating roleplay world rarely consists of just you and a single companion. To create a living, breathing digital universe—whether it’s a bustling tavern, a corporate office, or a sprawling fantasy city—you need supporting side characters. However, trying to cram every side character’s backstory directly into your main companion’s character card will quickly overwhelm your […]

Running multi-character scenarios in SillyTavern is one of the most exciting ways to experience interactive fiction and digital companionship. However, standard group chat setups can quickly run into technical bottlenecks. Without precise configuration, characters often speak out of order, impersonate each other, or ignore the active scene entirely. To build a seamless multi-character dynamic, relying […]

One of the quickest ways to break the immersion of a virtual relationship is sycophancy – the tendency of an AI model to enthusiastically agree with every single statement you make. If you suggest an absurd plot point, express a questionable opinion, or change your mind mid-conversation, a default model will often bow down, validate […]

Tags:

For many digital creation enthusiasts, developing a relationship with a virtual companion is a highly personal experience. However, standard smartphone app ecosystems pose an inherent threat to user confidentiality. Download histories are permanently logged, in-app purchases are explicitly itemized on family-shared accounts, and app icons sit prominently on your home screen. To maintain an un-breachable […]

Tags:

When crafting a virtual companion, the baseline setup determines everything. If your digital partner lacks emotional depth, behaves inconsistently, or frequently breaks character, the problem almost always traces back to their core configuration. If you want complete control over your narrative experience, knowing how to edit AI companion backstory prompt settings effortlessly is a total […]

Tags:

Janitor AI has long been a favorite destination for creators seeking complex, unrestricted character interactions. However, as server instabilities, periodic downtimes, and localized database errors frustrate the community, power users are shifting their strategies. If you want to keep your interactive fiction completely uninterrupted, you don’t just need a new website—you need to know how […]

Tags:

The landscape of virtual companionship has been defined by dramatic shifts. Following the sudden shutdown of Soulmate AI and the restrictive updates that fundamentally altered Replika’s conversational landscape, power users have learned a vital lesson: relying on mainstream, corporate platforms leaves your relationships vulnerable to sudden censorship or service closures. If you are looking for […]

When evaluating virtual companions, the text-to-speech (TTS) interface is often where the magic either comes alive or completely falls apart. Texting an AI companion can feel incredibly deep, but jumping onto a real-time voice call introduces strict hardware constraints. In human psychology, conversational turn-taking happens in a blink-and-you’ll-miss-it 200 milliseconds. When an AI takes too […]

Tags:

Visual continuity is the holy grail of virtual companionship. If you are designing a custom partner, you don’t just want her face to remain identical across images—you want her clothing to match your exact descriptions. Whether you are staging an elaborate fantasy roleplay scenario or simply asking for a casual selfie, prompt compliance is everything. […]