Skip to main content
A voice that answers is half of a character. The other half is that it knows what is happening, can do something about it, and moves like it means it. This page is the recipe, in the order we build one.

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, not bored): a bracket that is not a tag is read aloud.
  • Pick the voice with the persona. F1-F5 and M1-M5 are ten people; pitch makes a goblin or an ogre out of them. Try the same line in several.
  • Languages: with auto the 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.
Changes are sent together, and they survive a reconnection. Keep the facts few and rounded (“about twenty seconds left”, not a number every frame): each change is a new prompt. A number that is always there gets said in every answer: send it only when it matters (“almost over: hurry them once”). The character uses them in its next reply; a new fact does not make it speak.

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:
  1. 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.
  2. Order. Clip, then look, then springs, so springs react to everything. In Godot: an AnimationPlayer, then two SkeletonModifier3D under the skeleton, in that order. In Unity: the Animator, then LateUpdate, where LokutorLipSync already works.
  3. Give way while speaking. A smile and an aa on 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

Blend slowly into calm clips (0.3 s or more) and fast into reactions (0.1 s). Two or three talking clips picked at random are worth more than one perfect one.

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:
For a cartoon, replace the easing with a spring that overshoots a little: expressions pop.
  • 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 (MouthOpen in 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.