Characters

This guide explains how to set up your own character in CBMKit: mesh, animations, emotions, lip sync, the character definition asset, multi-character rooms, the TTS voice, and the prompt files (persona, modes, worlds, scenarios). It also explains how to package your characters, voices and prompts as a content pack.

Related guides:

Property names in this guide are the C++ names, for example MouthOpenMorphName. The Details panel shows them with spaces, for example "Mouth Open Morph Name". Labels that the plugin sets itself (menu entries, buttons, room fields) are written exactly as they appear in the editor.

1. What makes a character

Part Where it lives What it holds
Character definition CBMCharacterDefinition data asset Mesh, animation class, idle animation, face and lip sync settings, emotion profile, prompt folder, language, world, TTS voice
Emotion profile CBMEmotionProfile data asset Per-emotion motions, talking gestures, expression morph targets and curves, idle overrides
Prompt folder prompts/<language>/characters/<folder>/ text files Persona (persona.txt), modes, optional overrides
TTS voice models/tts/<voice>/voice.json under the Local AI folder Speaker vectors for each language and emotion
Room (optional) CBMRoomDefinition data asset Two or more characters on one stream, with roles

To switch the whole character, you change one asset: the character definition.

2. Shipped samples

The samples are under /CBMKit/Samples (the Plugins/CBMKit/Content/Samples folder). Use them as references or as starting points.

Sample Path
Character definitions /CBMKit/Samples/Lena/Data/DA_Lena, /CBMKit/Samples/Ursia/Data/DA_Ursia
Emotion profiles /CBMKit/Samples/Lena/Data/DA_Lena_EmotionProfile, /CBMKit/Samples/Ursia/Data/DA_Ursia_EmotionProfile
Meshes, face pose assets, animations /CBMKit/Samples/<Name>/Mesh, /CBMKit/Samples/<Name>/Animation
Room /CBMKit/Samples/Rooms/Room_Sample (both sample characters)
Levels /CBMKit/Samples/Maps/CBM_CompanionLevel, /CBMKit/Samples/Maps/CBM_BroadCastLevel
Prompt folders prompts/en/characters/lena, prompts/en/characters/ursia (and the same under prompts/ko)
TTS voices bright (used by the DA_Lena sample), sweet (used by the DA_Ursia sample)

The sample folders follow the folder layout in section 3.1. That layout lets the editor fill most fields for you.

3. Create a new character

3.1 Folder layout and naming

Put each character in its own Content Browser folder. The folder name is the character name.

<Name>/
  Mesh/        skeletal mesh and face pose asset. Their asset names contain <Name>.
  Animation/   AS_<Name>_<type>_<index>, for example AS_MyChar_happy_01, AS_MyChar_talk_02, AS_MyChar_idle_01
  Data/        the emotion profile and the character definition. Their asset names contain <Name>.

<type> is one of the six built-in emotions (normal, happy, sad, angry, surprised, embarrassed), talk, or idle. Name matching ignores upper and lower case.

3.2 Steps

  1. Import the skeletal mesh into <Name>/Mesh. If you use a pose asset for the face, put it in <Name>/Mesh too.
  2. Import the animations into <Name>/Animation with the names from 3.1.
  3. In <Name>/Data, create the emotion profile: Content Browser → right-click → Miscellaneous → Data Asset → CBMEmotionProfile. Name it, for example, DA_<Name>_EmotionProfile.
  4. In <Name>/Data, create the character definition: Data Asset → CBMCharacterDefinition. Name it, for example, DA_<Name>. Create it after the emotion profile so it can find the profile.
  5. Open the definition and check the fields (section 4). Set the face settings (section 7).
  6. Create a prompt folder for the character (section 9). If the prompt folder name is the same as the Content Browser folder name, the definition picks it up when you create the definition. Otherwise set PromptFolder.
  7. Set TTSVoice (section 8).
  8. Place the character in a level (section 5).

3.3 What the editor fills in for you

When you create a CBMEmotionProfile inside a folder named Data, the editor reads <Name>/Animation and fills the profile:

Animation name Goes to
AS_<Name>_<emotion>_<index> Motions of that emotion
AS_<Name>_talk_<index> TalkingMotions of every built-in emotion
AS_<Name>_idle_01 IdleAnimation of every built-in emotion

It adds only motions that are not in the list yet. To run it again after you add animations, click the Auto Fill button in the profile's Details panel (category "Auto Fill").

When you create a CBMCharacterDefinition inside a folder named Data, the editor fills the fields that are empty:

Field Value
CharacterId, DisplayName The folder name
SkeletalMesh The first skeletal mesh in <Name>/Mesh whose name contains <Name>
FacePoseAsset The first pose asset in <Name>/Mesh whose name contains <Name>
DefaultIdleAnimation The first animation in <Name>/Animation that has idle as a separate _ part of its name
EmotionProfile The first emotion profile in <Name>/Data whose name contains <Name>
Emotions The built-in emotions that the emotion profile has entries for
PromptFolder The prompt character folder with the same name, if it exists
TTSVoice The TTS voice with the same name, if it exists
VisemePoseNames aa, ih, ou, ee, oh mapped to the same names

If an asset does not follow the naming rule, it is not used. When you open the definition or the profile, the editor shows a dialog and writes each skipped asset to the Output Log. Rename the asset, or set the field by hand.

If you create the asset outside a Data folder, nothing is filled in. Set all fields by hand.

4. Character definition reference (CBMCharacterDefinition)

The Primary Asset Type of the definition is CBMKit.

Category Property Description
Character CharacterId, DisplayName Identifier and display name
Visual SkeletalMesh Character mesh
Visual AnimClass Default CBMCharacterAnimInstance, which works without an Animation Blueprint. Set your own Animation Blueprint here (section 6)
Visual DefaultIdleAnimation Idle loop. An emotion's IdleAnimation in the emotion profile is used before this
Visual UpperBodyRootBone Bone where UpperBody slot motions start to blend. Default Spine1. Common values: Mixamo spine_01, VRM J_Bip_C_Spine. None = the anim instance's own value. If the bone is missing, the motion blends on the full body
Visual MeshRelativeTransform Mesh transform relative to the actor. Usually Yaw -90, and Z set so the feet are at the origin
Visual EmotionProfile Emotion profile asset (section 7)
Face MouthOpenMorphName, VisemeMorphTargets, bDriveVisemeMorphTargets Morph target lip sync (section 7.2)
Face FacePoseAsset, VisemePoseNames, FacePoseBaseName (default sil), MouthOpenPoseName (default aa) Pose asset lip sync (section 7.3)
Face MouthOpenGain, VisemeGain Strength of the mouth opening and of the vowel shapes
Conversation PromptFolder Folder name under prompts/<language>/characters. Holds persona.txt and the modes (section 9)
Conversation PromptMode Mode to use (characters/<folder>/modes/<mode>.txt). Empty = no mode
Conversation Language Language for prompts, speech recognition and the TTS voice. Empty = Project Settings → Plugins → CBM → Character Language
Conversation World World file (worlds/<world>.txt). Empty = Project Settings World
Conversation Emotions, DefaultEmotion Emotion tags the LLM may use, and the default emotion. Empty = Project Settings Emotions and DefaultEmotion
Conversation Actions Action tags the LLM may use (section 9.7). Empty = Project Settings Actions
Conversation States State values such as mood or energy (section 9.8). Empty = Project Settings States
Room RoomRole Main or Guest. Main speaks first and starts new topics. Any character can take either role
Voice TTSVoice Voice folder name under models/tts (section 8). Empty = Project Settings TTSCharacter
Voice TTSExternalVoice Voice name for an external TTS API or the generic HTTP TTS provider (TTSBackend = Provider). Empty = the voice set in Tools > CBM > AI Connections…, or the provider config's voice
Voice TTSEmotionOverrides Maps a character emotion to a TTS emotion name, for example embarrassed → shy. Emotions not in the map are sent as they are

When the definition of the active character changes at runtime (SetDefinition on the actor, ApplyDefinition on the component, or a character with a different definition becomes active), the conversation stops the current turn, clears the conversation history, and loads the persona, emotions and voice of the new definition. UCBMConversationSubsystem::GetActiveDefinition() returns the definition in use.

5. Place the character in a level

  1. In Place Actors, search for CBM Character Actor and drag it into the level.
  2. In Details, set Definition to your definition. If it is empty, the actor uses Project Settings → Plugins → CBM → DefaultCharacter.

The actor has the components Root (Scene Component), Mesh (Skeletal Mesh Component) and CBMKit (CBM Character component).

Property Description
Definition Character definition. The viewport updates the mesh and idle at once when you change it. You can pass it as an Expose on Spawn pin when you spawn the actor
FitHeight (cm) Scales the mesh so the character is this tall. 0 = the definition's scale. The companion sample level uses 60, so characters of any height show at the same size on the desk
FramingCamera A camera that the actor places at the character's eye level, looking slightly down. It is set when the definition is applied and again at BeginPlay. None = the camera stays where you placed it
FramedHeads Height shown on screen, in head sizes from the top of the head. Default 3 (head to waist). It never exceeds the full body, so short characters show whole

Characters that use the same FramingCamera are framed together in one shot. The camera height is their average eye level. The camera keeps its direction to the characters and changes only distance, height and pitch.

At runtime, call SetDefinition(NewDefinition) to switch the character. FrameCamera() re-frames the camera.

5.2 Your own actor or Character Blueprint

  1. Open your actor Blueprint (for example an ACharacter subclass) and choose Add Component → CBM Character.
  2. Set CharacterDefinition. At BeginPlay the component copies the emotion profile, default emotion, idle animation and face settings from the definition.
  3. Set the mesh and its Anim Class yourself. With Anim Class = CBMCharacterAnimInstance the character works without an Animation Blueprint.
  4. At runtime, call ApplyDefinition(NewDefinition) on the component to switch.

If CharacterDefinition is empty, set the component properties by hand (section 10).

The component registers itself with the conversation subsystem at BeginPlay.

6. Animation

6.1 Anim instance

Option Setup Behavior
Native (default) Anim Class = CBMCharacterAnimInstance No AnimGraph. C++ builds the pose: (1) idle loop, (2) DefaultSlot montages on the full body, (3) UpperBody montages from UpperBodyRootBone up, with mesh-space rotation blend, (4) face pose asset, (5) expression curves from the emotion profile. Curves inside the animations (for example ARKit jawOpen, eyeBlink*) pass through; expression and face curves are combined with them by taking the larger value. You do not need to add the slots in the skeleton's Anim Slot Manager. Root motion is not extracted
Custom Animation Blueprint Create an Animation Blueprint with Parent Class CBMCharacterAnimInstance, and set it as the definition's AnimClass If something is connected to Output Pose in the AnimGraph, the graph runs (section 6.3). If not (event graph only), native evaluation is used. Turn off bUseNativeEvaluation to always use the graph

Idle order: the current emotion's IdleAnimation, then the definition's DefaultIdleAnimation, then the anim instance's IdleAnimation. When the idle changes, it cross-fades over IdleBlendTime.

CBMCharacterAnimInstance properties: bUseNativeEvaluation, Definition (used when there is no component, for example in the animation editor preview), IdleAnimation, IdleBlendTime (0.4), IdlePlayRate, UpperBodyRootBone (default spine_01; the definition's value is used first), bMeshSpaceRotationBlend, bApplyFacePose, bWriteExpressionCurves.

6.2 Motion slots

An emotion motion plays on its SlotName:

An AnimMontage plays as it is. Any other animation plays as a dynamic montage on SlotName.

6.3 Your own AnimGraph

You need this only if you build your own AnimGraph.

  1. In the skeleton's Anim Slot Manager, add an UpperBody slot to DefaultGroup. DefaultSlot stays for full-body motions.
  2. Example AnimGraph: [Locomotion / Idle] ──► Cache "Base" Use "Base" ──► Slot 'UpperBody' ──┐ ├─► Layered blend per bone (Branch Filter: spine_01, Blend Depth 0, Mesh Space Rotation Blend on) Use "Base" ───────────────────────┘ (Base Pose) ──► Slot 'DefaultSlot' ──► Output Pose Base Pose is the original pose including the lower body. Blend Poses 0 is the UpperBody slot output. For a VRM4U skeleton, use J_Bip_C_Spine (or spine) as the branch bone.
  3. Emotion pose blending: read GetEmotionWeight("happy") and similar values in the Event Graph and use them as the alpha of Blend Poses by float or Apply Additive.
  4. Expression curves: if you use AnimCurves, add a Modify Curve node and feed it with GetExpressionCurveValue.
  5. Idle override: expose the Sequence pin of a Sequence Player and bind it to GetCurrentIdleAnimation(). When it returns None, select your default idle.
  6. Talking state: use IsTalking() as a state machine transition condition or a blend alpha.

7. Emotions, expressions and lip sync

7.1 Emotion profile (CBMEmotionProfile)

The LLM writes an emotion tag such as [happy] before each sentence. The character plays the matching entry of the emotion profile when that sentence starts to play.

Emotions is a map from emotion name to entry. The key list offers the six built-in emotions: normal, happy, sad, angry, surprised, embarrassed.

Entry field Description
Motions Reaction motions. When the emotion changes, one is picked at random by Weight, without repeating the previous one. Each motion has Animation, Weight, SlotName, PlayRate, BlendIn, BlendOut
bPlayMotionOnEverySegment On = play a reaction motion on every sentence, also when the emotion stays the same
TalkingMotions Random gestures while talking, when no other montage plays. Interval: the component's TalkingMotionInterval
MorphTargets Expression morph values, for example Fcl_ALL_Joy = 1.0
AnimCurves Curve values. A custom AnimGraph reads them with GetExpressionCurveValue. With a face pose asset, a key with the same name as a pose drives that pose
ExpressionBlendTime Blend time of the expression and emotion weights, in seconds
HoldSeconds Time the emotion stays after speech ends before it returns to the default emotion. Negative = stay until changed
IdleAnimation Idle animation for this emotion

FallbackEmotion is the entry used for an emotion that is not in the map. None = the default emotion.

The emotion tags the LLM may use come from the definition's Emotions (or Project Settings Emotions). Keep this list and the profile keys the same.

7.2 Face: morph targets

The component writes the morphs with SetMorphTarget on the face mesh. This works with any anim instance. Use one of the two options, not both on the same morph.

VRM models imported with VRM4U keep their BlendShape names as morph target names:

Use VRoid (VRM0) morph VRM1 expression
Mouth open (MouthOpenMorphName) Fcl_MTH_A aa
Vowels aa / ih / ou / ee / oh Fcl_MTH_A / Fcl_MTH_I / Fcl_MTH_U / Fcl_MTH_E / Fcl_MTH_O aa / ih / ou / ee / oh
happy Fcl_ALL_Joy happy
angry Fcl_ALL_Angry angry
sad Fcl_ALL_Sorrow sad
surprised Fcl_ALL_Surprised surprised
embarrassed Depends on the model, for example Fcl_ALL_Fun plus a blush morph relaxed or similar

Check the real names in the Skeletal Mesh editor's Morph Target Preview. If the face is driven by AnimBP curves (for example a leader pose setup or MetaHuman), use AnimCurves and a Modify Curve node instead of morph targets.

7.3 Face: pose asset

Set FacePoseAsset, then fill:

CBMCharacterAnimInstance (native evaluation, bApplyFacePose on) applies the poses.

Example: the Ursia sample uses UrsiaMouthAnim_PoseAsset with aa→aa, ih→I, ou→u, ee→E, oh→O, MouthOpenPoseName = aa, FacePoseBaseName = sil.

If you set both morph targets and a pose asset, both are applied. Usually you use one.

7.4 Lip sync tuning

The built-in lip sync uses the voice volume and a vowel estimate. It has no external dependency. Tune it on the component (category LipSync): MouthOpenGain, MouthNoiseFloorDb, MouthFullOpenDb, MouthAttackSeconds, MouthReleaseSeconds, VisemeGain.

If the mouth moves before the sound, raise PlaybackLatencySeconds (category Audio, default 0.05). If it moves after the sound, lower it.

7.5 OVRLipSync (optional)

OVRLipSync is a separate plugin under the Oculus Audio SDK License. It is not included with CBMKit. Get it yourself, put it in your project's Plugins/ folder, and check its license.

  1. Add UOVRLipSyncActorComponent (Live Actor Component) to the character.
  2. Set its SampleRate to the sample rate that OnLipSyncPCM passes (the TTS output rate).
  3. Do not call Start(). It starts microphone capture. Use only FeedAudio.
  4. Add "OVRLipSync", "CBMKit" to your game module's Build.cs and bind OnLipSyncPCM in your character's C++ class. The delegate runs on the game thread, in step with the audio you hear, with 10 ms of mono PCM16 per call. Silence between sentences is sent as zero samples.
#include "CBMCharacterComponent.h"
#include "OVRLipSyncLiveActorComponent.h"

void AMyCharacter::BeginPlay()
{
    Super::BeginPlay();

    UCBMCharacterComponent* Live = FindComponentByClass<UCBMCharacterComponent>();
    UOVRLipSyncActorComponent* LipSync = FindComponentByClass<UOVRLipSyncActorComponent>();
    if (Live && LipSync)
    {
        TWeakObjectPtr<UOVRLipSyncActorComponent> WeakLipSync = LipSync;
        Live->OnLipSyncPCM.AddWeakLambda(this, [WeakLipSync](const int16* Samples, int32 Num, int32 SampleRate)
        {
            if (UOVRLipSyncActorComponent* Comp = WeakLipSync.Get())
            {
                TArray<uint8> Bytes;
                Bytes.Append(reinterpret_cast<const uint8*>(Samples), Num * sizeof(int16));
                Comp->FeedAudio(Bytes);
            }
        });
    }
}
  1. Use OVRLipSync as usual: on OnVisemesReady, apply GetVisemes() to your morphs or curves. Leave MouthOpenMorphName empty and turn off bDriveVisemeMorphTargets.

8. TTS voice

8.1 Bundled voices

Voice File
bright ThirdParty/LocalAI/models/tts/bright/voice.json
sweet ThirdParty/LocalAI/models/tts/sweet/voice.json

Both voices are for the built-in (in-process) ZONOS3 TTS. Each has English (en) and Korean (ko) speakers for the six built-in emotions. The voices are AI-generated. Tell your audience that the speech is AI-generated, and do not use the voices to imitate a real person (see ThirdPartyNotices.txt).

Tools > CBM > Local AI Status lists the installed voices in the line "TTS voices".

8.2 How a character picks a voice

  1. Voice name: the definition's TTSVoice. If it is empty: Project Settings → Plugins → CBM → TTSCharacter. If that is empty, or the name is not installed: the first installed voice in alphabetical order.
  2. Language check: if the voice's voice.json has a top-level "language" field that differs from the character language, CBMKit uses <voice>_<language> if it is installed, else the first installed voice of that language, else the voice unchanged. Voices without a "language" field, such as the bundled voices, are used as they are.
  3. Speaker inside the voice: the speaker for the language and the emotion. If that emotion is missing, the voice's default_emotion. If the language is missing, another language in the file.

The character language is the definition's Language, else Project Settings Character Language. The built-in TTS speaks English and Korean. A sentence with Korean letters is spoken as Korean; other sentences are spoken as Korean when the language is ko, else as English.

Emotion names are sent to the TTS as they are. If your character uses an emotion name that the voice does not have, map it with TTSEmotionOverrides.

If you use an external TTS API (Tools > CBM > AI Connections…) or the generic HTTP TTS provider, the character uses TTSExternalVoice instead, and TTSVoice is not used.

8.3 Add a voice

Put a folder with a voice.json under <LocalAIRoot>/models/tts/<voice>/, or in a content pack (section 12). The folder name is the voice name. Then set TTSVoice to that name and run Tools > CBM > Restart Services.

<LocalAIRoot> is Project Settings → Plugins → CBM → LocalAIRoot. Empty = Plugins/CBMKit/ThirdParty/LocalAI. When the plugin is installed in the engine from Fab, the editor uses %LOCALAPPDATA%/CBMKit/LocalAI.

voice.json format (cbm-zonos3-v1):

{
 "format": "cbm-zonos3-v1",
 "default_emotion": "normal",
 "speaking_rate": { "en": 15.5, "ko": 15.5 },
 "speakers": {
  "en": { "normal": "<base64>", "happy": "<base64>" },
  "ko": { "normal": "<base64>", "happy": "<base64>" }
 }
}

Each speaker value is a ZONOS3-Mini speaker embedding (192 float32 values, little-endian) encoded as base64. CBMKit does not include a tool that makes these embeddings from a recording. To make one, you need the ZONOS3-Mini command-line tools from the ZONOS3-Mini project (https://github.com/Zyphra/ZONOS3-Mini), which are not part of CBMKit. Before you use a recording of a person, get that person's permission, including for redistribution if you sell the voice.

9. Prompts and persona

9.1 Where the files are

The text that CBMKit sends to the LLM is in UTF-8 .txt files under <LocalAIRoot>/prompts/. Changes apply from the next turn. You do not need to rebuild. The README.md in that folder is the full reference for the prompt files (Korean: README.ko.md).

There is one folder per language. en and ko ship with the plugin, with the same structure:

prompts/en/
  characters/<C>/persona.txt     Character profile. One folder per character
  characters/<C>/modes/<M>.txt   Optional modes. One file per mode
  characters/<C>/name.txt        Optional display name for this language
  worlds/<W>.txt                 Optional world. One file per world
  scenarios/<S>.txt              Optional stream flow for a topic. One file per scenario
  rules.txt                      Common rules for every character
  rules_short.txt                Shorter common rules for small models
  system/                        Input formats, co-stream, images, memory, topic flow (advanced)
  companion/                     Files used only in the Companion run type
  broadcast/                     Files used only in the Broadcast run type

<C> is the character folder name. Set it in the definition's PromptFolder.

Keep your edits outside the plugin. A plugin update can overwrite the files in the plugin folder. Set Project Settings → Plugins → CBM → PromptDirectory to a folder in your project, for example Config/CBMPrompts. It uses the same structure (for example Config/CBMPrompts/en/rules.txt). A file that is missing there is read from <LocalAIRoot>/prompts. The Prompt Editor saves to this folder. For a packaged game, also add the folder to Project Settings → Packaging → Additional Non-Asset Directories To Copy.

9.2 Prompt Editor

Open Tools > CBM > Prompt Editor…

9.3 Character profile (persona.txt)

These sections have fixed names. Other sections ([Identity], [Relationships], [Emotion tag examples] and so on) are free text and go into the system prompt as written.

Section Use
[Intro] Added to a co-stream partner's system prompt as the introduction of this character
[Greeting] Instruction sent once after the model loads. Missing = system/greeting.txt
[Idle Talk] Instruction sent when there is no input for Project Settings IdleTalkSeconds. Missing = system/idle_talk.txt (system/room_idle_talk.txt in a co-stream)

[Greeting] and [Idle Talk] are not part of the system prompt. They are sent as input at that time.

A section ends at the next line that has only a [...] title. A line such as [happy] Hello has text after the brackets, so it is not a section title.

Write the relationship to co-stream partners in [Relationships] as - Name: description.

persona.txt is used in both run types. Do not write the run type into the persona (for example "You are live now"). That text is in system/run_rules.txt, which exists separately in companion/ and broadcast/.

Write per-character rules (way of speaking, role in a co-stream) in the persona. The persona comes before the common rules in the system prompt.

Companion only: write the relationship to the user and how the character addresses them in companion/characters/<C>/user.txt (User Relationship in the editor). It is added right after the persona. If a user name is set, companion/system/user_name.txt follows it with {user} replaced by the name.

characters/<C>/name.txt (optional): one asset name=name in this language per line. When the definition's DisplayName equals the left side, the right side is used as the name in this language.

9.4 Modes (characters/<C>/modes/<M>.txt)

Use a mode when one character has several stream formats (for example a singing stream and a game stream). The mode text is added right after the persona and the world. A mode does not replace other files.

Choose the mode with the definition's PromptMode, the room slot's "Mode", SetPromptMode at runtime, or the console command CBMKit.Mode <mode> [CharacterId].

9.5 Worlds (worlds/<W>.txt)

A world is a shared setting for several characters: place, organization, facts everyone knows, things not to say. It is added right after the persona, before the mode.

The world is chosen in this order. The first non-empty value wins:

  1. SetPromptWorld at runtime (all characters).
  2. The definition's World. A room's "World" is written to every slot's definition when you apply the room.
  3. Project Settings → Plugins → CBM → World.

9.6 Common rules (rules.txt, rules_short.txt)

Emotion tags, way of speaking, no invented facts, safety rules. {emotions} is replaced by the emotion tag list. Turn on Project Settings bShortRules (Short Rules) to use rules_short.txt instead. Use it with small local models (4B parameters or less).

system/run_rules.txt (or system/run_rules_short.txt with Short Rules) is added right after the common rules. It holds the current situation and the input formats. It exists separately in companion/ and broadcast/.

9.7 Action tags (system/action_rules.txt)

Add actions (Name, Description) to the definition's Actions (or Project Settings Actions). system/action_rules.txt is then added after the common rules, with {actions} replaced by the list. With an empty list, the file is not sent.

When the LLM writes [act:name] or [act:name:value], the tag is not spoken. When that sentence starts to play, the character component fires OnCharacterAction(Action, Value). An action after the last sentence fires when the turn ends. Unknown names are ignored.

To tell the character about something in your game, call SubmitGameEvent(EventName, Detail). It is sent in the format of system/input_event.txt.

9.8 State values (system/state_block.txt)

Add values such as mood or energy to the definition's States (or Project Settings States). Each has Name, Description, Default, Min, Max, DecayPerMinute (movement toward Default per minute) and EmotionDeltas (change per emotion tag). Each turn, system/state_block.txt is added after the input with {states} replaced by lines of - name: value (min~max) description. The system prompt does not change.

Blueprint: SetCharacterState, AddCharacterState, GetCharacterState, and the OnCharacterStateChanged event.

9.9 Scenarios and topics (scenarios/<S>.txt)

When you give a topic, the characters go through the scenario's steps in order. How to start and control topics during a stream is in BROADCAST.md. Scenario file format:

# Lines starting with # are comments.
name: Collab Debate

[Topic]
{topic}

[Step: Arguments]
speaker: alternate
turns: 2
seconds: 0
next: no
plan: no
instruction: Choose your position and give one reason for it.
Key Values
name Name shown in the operator panel and OBS dock. Missing = the file name
speaker main, guest, alternate, auto, or a character name
turns Number of times the characters speak in this step
seconds If not 0, the step also ends after this time
next yes = after the turns or time, wait until the operator presses next
plan yes = replace this step with the talking points the topic planner makes
instruction What the character does in this step

{topic} is replaced by the topic given at the start. A topic without a scenario uses system/topic_default.txt. The shipped example is scenarios/debate.txt.

9.10 File lookup order

For each file, CBMKit first looks for a character-specific copy (characters/<C>/<file>), then the common file (<file>). For each of these, it searches the folders below from top to bottom. <run type> is companion or broadcast.

  1. <PromptDirectory>/<language>/<run type>/
  2. <PromptDirectory>/<language>/
  3. Each pack: <pack>/prompts/<language>/<run type>/, then <pack>/prompts/<language>/
  4. <LocalAIRoot>/prompts/<language>/<run type>/
  5. <LocalAIRoot>/prompts/<language>/

The character-specific copy is an advanced feature and does not show in the Prompt Editor. For example, if characters/<C>/system/room_role_main.txt exists, that character uses it instead of system/room_role_main.txt. The copy replaces the whole file, so later changes to the common file do not reach it.

A run-type file replaces the common file of the same name. A file that exists only in a run-type folder is not used in the other run type. A run-type characters/<C>/ folder may hold only user.txt. Folders without persona.txt do not show in the character list.

Language: the definition's Language, else Project Settings Character Language. If both are empty, the UI language folder is used if it has a rules.txt, else en, else ko. Speech recognition and the TTS voice follow the same language.

An empty file means that text is not sent. Only the {...} placeholders listed for a file are replaced.

9.11 System prompt order

Persona (without [Greeting] and [Idle Talk]), user.txt (Companion, if present), system/user_name.txt (if a user name is set), world, mode, common rules, system/run_rules, system/action_rules (if there are actions), system/room_rules (in a co-stream), and system/vision_rules (with image input) or system/vision_off_rules (without image input, if the file exists).

Memory, current time, state values and topic status are added after the input of each turn, not to the system prompt. This keeps the system prompt the same between turns so the LLM can reuse its cache.

10. CBM Character component reference

Category CBMKit|Setup, CBMKit|Audio, CBMKit|LipSync, CBMKit|Emotion in Details.

Category Property Description
Setup CharacterDefinition Character definition. None = set the component by hand
Setup BodyMeshName Skeletal Mesh Component that plays motions. None = the ACharacter mesh or the first skeletal mesh
Setup FaceMeshName Mesh for face morph targets. None = the body mesh
Audio AudioComponentName Existing Audio Component to use. None = create one
Audio AudioAttachSocket Socket for the created Audio Component, for example head. None = actor root
Audio AttenuationSettings, SoundClass, VolumeMultiplier 3D attenuation (spatialized when set), sound class, volume
Audio PlaybackLatencySeconds Delay between audio generation and output (default 0.05)
Audio SpeakingGapTolerance If the next sentence is late and there is silence for this many seconds, the speaking state ends
LipSync MouthOpenMorphName, MouthOpenGain, MouthNoiseFloorDb, MouthFullOpenDb, MouthAttackSeconds, MouthReleaseSeconds Mouth-open envelope
LipSync bDriveVisemeMorphTargets, VisemeMorphTargets, VisemeGain Vowel shapes on morph targets
LipSync FacePoseAsset, VisemePoseNames, FacePoseBaseName, MouthOpenPoseName Vowel shapes from a pose asset
Emotion EmotionProfile, DefaultEmotion, DefaultIdleAnimation Emotion profile, default emotion (None = Project Settings DefaultEmotion), idle
Emotion bApplyExpressionMorphTargets, bPlayEmotionMotions, bPlayTalkingMotions, TalkingMotionInterval Turn expressions and motions on or off; interval of talking gestures in seconds (min, max)

With CharacterDefinition set, the emotion and face values come from the definition.

Events (bind in Blueprint):

Event When
OnSpeechSegmentStarted(Segment) A sentence starts to be heard. Segment has TurnId, SegmentIndex, bLastInTurn, Text, Emotion, Duration, Actions
OnSubtitle(Text) Same time, text for subtitles
OnSpeechSegmentFinished(Segment) A sentence finished, or was stopped by StopSpeaking
OnTurnFinished(TurnId) The last sentence of a turn finished, or StopSpeaking cancelled the turn
OnSpeakingStateChanged(bSpeaking) Speaking started or ended
OnEmotionChanged(NewEmotion, PreviousEmotion) The emotion changed
OnCharacterAction(Action, Value) An action tag's sentence started (section 9.7)

Functions:

Playback: within one turn, all sentences play back to back on one procedural sound wave without gaps. Sentence events and lip sync follow the audible playback position, on the game thread.

11. Several characters in one stream (rooms)

A room puts two or more characters on one conversation. They take turns and answer each other. Rooms are a Broadcast feature. The Room Setup menu entry shows only when the run type is Broadcast (Tools > CBM > Run Type). See BROADCAST.md for running a co-stream.

11.1 Room Setup

  1. Open Tools > CBM > Room Setup…
  2. Pick a room in "Room", or click New Room. New Room creates a room with two slots (Main and Guest) under /Game/CBMRooms. Both slots start with Project Settings DefaultCharacter as the base.
  3. Edit the slots in "Characters", and the room's "World".
  4. Open the level you want to use and click Apply to Level.

To start from the sample, duplicate /CBMKit/Samples/Rooms/Room_Sample into your project's Content folder and pick the copy. Apply to Level writes assets next to the room, so use a room inside your project.

Slot fields:

Field Description
Role Main or Guest. Main speaks first and starts new topics
Name Display name. It is also the character id. Use a different name for each slot
Default Character Base definition. Animations, face and emotion settings come from it
Mesh Mesh to use instead of the base character's mesh
TTS Voice Voice for this slot
External TTS Voice Voice name for an external TTS API
Language Character language
Prompt Prompt character folder (PromptFolder)
Mode Prompt mode (PromptMode)

Empty fields keep the base character's value.

11.2 What Apply to Level does

Report message Meaning
"A co-stream needs 2 or more slots. The current slots run solo." Add a second slot
"No Main role. The first slot speaks first." Set one slot's Role to Main
"Slot N: no mesh. Set a mesh or a base character." The slot has no mesh
"Slot N: the mesh skeleton differs from the base character, so the base character's animations will not play." Use a base character with the same skeleton, or a mesh on that skeleton
"... characters not in this room remain in the level and also speak. Delete them from the level if not needed." Other CBM Character Actors in the level also take part

Apply to Level does not run during Play In Editor. Stop play first.

11.3 Room settings

Project Settings → Plugins → CBM → Room: bEnableRoom (off = only the last registered character talks), RoomMaxAutoReplies (how many times characters answer each other after one line before they wait for new input), RoomReplyDelaySeconds, and RoomIdleTalkSeconds (quiet time before a character starts a new topic, 0 = off).

Co-stream prompt files: system/room_rules.txt ({self}, {partner}, {partner_intro}, {role_rules}), system/room_role_main.txt, system/room_role_guest.txt, system/room_reply.txt ({partner}), system/room_partner_line.txt ({speaker}, {text}), system/room_idle_talk.txt ({partner}). Each character's [Intro] is shown to its partners.

12. Content packs

A content pack is a separate plugin that adds characters, worlds, scenarios, TTS voices and emotion/animation assets to CBMKit. One pack is one plugin. Use a pack to keep your content apart from the CBMKit folder, or to sell it on Fab.

12.1 Pack layout

<PackName>/
  <PackName>.uplugin           CanContainContent: true, depends on CBMKit
  Config/FilterPlugin.ini      /CBMPack/...  (needed so the CBMPack folder is included in a Fab package)
  CBMPack/
    pack.json                  name, version, description (optional)
    prompts/<language>/        same structure as the CBMKit prompts folder
      characters/<C>/persona.txt
      characters/<C>/modes/<M>.txt
      worlds/<W>.txt
      scenarios/<S>.txt
      system/...               only to replace the default prompts
    voices/<voice>/voice.json
  Content/                     emotion profiles, animations, character definitions, meshes

pack.json example:

{
    "name": "Autumn Scenario Pack",
    "version": "1.0",
    "description": "Five autumn debate scenarios"
}

Without pack.json, the plugin's FriendlyName and VersionName are used.

12.2 Create a pack

  1. Open Tools > CBM > Prompt Editor…
  2. Type the pack name (English letters, digits and _) in the "New Name" box and click Create Pack.
  3. CBMKit creates <Project>/Plugins/<PackName>/ with the layout above and mounts it. The Content Browser shows the pack's content folder.

Edit FriendlyName, Description and VersionName in the .uplugin, and CBMPack/pack.json, by hand.

12.3 Add prompt files

  1. In the Prompt Editor, select the item to add (character profile, mode, world, scenario and so on).
  2. Choose the pack in the "Pack" list and click Copy to Pack.
  3. The file is copied to the same path, for example scenarios/debate.txt → CBMPack/prompts/en/scenarios/debate.txt.
  4. For a Character Profile, the whole character folder (including modes) is copied.
  5. The original stays in the default folder. To test the pack alone, move the original away and test.

Files inside a pack are never changed by the Prompt Editor. If you open a pack file and save it, the edited copy goes to PromptDirectory (or <LocalAIRoot>/prompts), and that copy is used before the pack file.

12.4 Add a voice

In the Output Log console (or the ~ console), run:

CBMKit.Pack.AddVoice <PackName> <voice>

This copies <LocalAIRoot>/models/tts/<voice>/voice.json to CBMPack/voices/<voice>/. Pack voices are picked by name in TTSVoice or TTSCharacter. Only the built-in (in-process) TTS reads pack voices.

12.5 Add assets

Emotion profiles, animation sequences and montages, and character definitions are normal Unreal assets. Create or move them in the pack's Content/ folder. If they reference assets of another plugin, that plugin must also be installed.

12.6 How CBMKit finds packs

Lookup order: prompts follow section 9.10. Voices: <LocalAIRoot>/models/tts/<voice> first, then each pack's CBMPack/voices/<voice>. For the same name, the first one wins.

The Prompt Editor, Room Setup, the operator panel and the OBS dock list the worlds, scenarios, modes and characters of all packs.

12.7 Packaging and Fab

13. Common problems

Problem Check
The definition fields stay empty after you create it The asset must be in a folder named Data, and the mesh, pose asset and profile names must contain the folder name (section 3.3)
A dialog says assets do not match the naming rules Read the Output Log, rename the assets, or set the fields by hand
Emotion motions do not play The profile has entries for the emotion names the LLM uses (Emotions); the motion's SlotName is UpperBody or DefaultSlot; bPlayEmotionMotions is on
The whole body moves for an upper-body motion UpperBodyRootBone does not exist on the skeleton. Set the right bone name
The mouth does not move Morph or pose names do not match the mesh (check Morph Target Preview), or both MouthOpenMorphName and pose settings are empty
The wrong voice plays TTSVoice is not an installed name, so the first voice is used. Check the "TTS voices" line in Tools > CBM > Local AI Status
Prompt edits are lost after an update Set PromptDirectory (section 9.1)
A character is missing from the Prompt Editor list The folder needs a persona.txt
Room Setup is not in the menu Set Tools > CBM > Run Type to Broadcast