Personality
The persona is the system prompt of the conversation. It is read on every turn, so every sentence in it should earn its place. Four parts are enough:- Give it a want. A character that wants something (“you want the player to leave before your brother comes back”) drives a conversation; a helpful one waits to be asked.
- Say how it opens. The character speaks first. Without an opening to say, it may talk about its instructions instead: “You speak first: one bored line, such as ‘Next! Another jester.’” Give it the actions and the rest of its persona when it has greeted the player, not before: with an action it must call before every answer already in front of it, it read its instructions out in 7 openings of 8, and “do not call it for the opening” did not help.
- Say how long. Spoken sentences feel longer than written ones, and short answers arrive sooner.
- Put the obstacle in the game, not in the prompt. “Do not give the key unless they pay” is a request; an action that checks the gold is a rule.
- Write for the ear. Plain words only: no stage directions, no emoji. For a laugh or a sigh in the voice there are expression tags, which take a second or more each: use them rarely. With tags in the persona, give the values of an action names that cannot pass for one (
stone_face, notbored): a bracket that is not a tag is read aloud. - Pick the voice with the persona.
F1-F5andM1-M5are ten people;pitchmakes a goblin or an ogre out of them. Try the same line in several. - Languages: with
autothe character follows the player’s. It speaks thirteen and understands nine (which).
Facts of the moment
What changes goes in context, not in the persona: short facts with a name, which you overwrite as the game goes.Actions
Actions are how a conversation has consequences (Unity, Godot). Three kinds cover most characters:
The sentence an action returns is the strongest lever you have: the character speaks right after reading it. Use it to steer (“You are now at 80 of 100”), and to say no.
Ask for
react on every answer, before speaking, and the body moves while the voice is still being made. That hides the latency, and the number is your game’s score.
Written lines
Not everything should be improvised. A written line costs once, starts at once, works offline when shipped, and says exactly what you want: tutorial hints, barks, the first and last line of a scene. The same character can have both. Use a conversation where the player’s own words matter, and written lines everywhere else.Layers
A character that is alive is several simple things running at once, each on its own part of the body. From the bottom up:
Three rules keep them out of each other’s way:
- One writer per bone and per blend shape. Clips move bones and never touch the face; moods own the expression shapes; LokutorLipSync owns the viseme shapes. If a body clip has face tracks, delete them.
- Order. Clip, then look, then springs, so springs react to everything. In Godot: an
AnimationPlayer, then twoSkeletonModifier3Dunder the skeleton, in that order. In Unity: the Animator, thenLateUpdate, where LokutorLipSync already works. - Give way while speaking. A smile and an
aaon the same mouth add up to a shape nobody drew. Fade the mouth shapes of the mood to about 30% while the character speaks and leave brows and eyes alone: the smile still shows, and the lips still close on p, b and m.
From conversation to body
Moods that move out of the way
A mood is a set of weights. Ease towards it, with the mouth held back while the character speaks:Blinks, glances, nods
- Blinks last about 0.17 s, every 2 to 5 seconds, now and then two in a row. Blink on a change of mood or of look: people do.
- Eyes jump, they do not slide. A glance away every couple of seconds while listening, less while speaking.
- Nods follow the voice: feed a smoothed
mouth_open(MouthOpenin Unity) into a few degrees of head pitch, plus slow sines on the other two axes while speaking. Nobody talks with a still head. - Springs go last, as bones that chase their animated place with a stiffness and a damping. Clips then do not need overlapping action drawn by hand, and reactions blended halfway still look right.
The player’s character
When the player is on screen, their mouth has no visemes: it is their own voice. Drive the same LokutorLipSync with the level of the microphone:Characters that talk to each other
Two agents can hear each other. Turn both microphones off (MicMode.Off / MicMode.OFF) before they start, and feed each one what the other plays: VoicePlayed into FeedMicrophone, voice_played into feed_microphone. Those events carry only the voice, so send silence the rest of the time, in real time: the server tells that a turn is over by the silence after it.
Each agent is a session and is billed on its own, and two characters left alone never stop. For a scripted exchange, written lines are cheaper and always land.
Checklist
- It notices the player before they speak (looks, turns, stops what it was doing).
- Something moves within a frame of every state change.
- It does not answer before it has been seen to listen.
- Every action that can fail says why.
- Subtitles for both (
player_said,character_said), and a way to talk without a microphone. - Interrupting it feels good: it stops, and its face shows it.
- It is closed when the player leaves.