Spielerando

Lesson 9 of 14People and a world that answer8 minFree

Ambient Barks: Telling a Game Story Without Stopping Play

A pixel art beekeeper walks up to an older beekeeper in a green hat who stands by two hives. A small die shows a roll, and the older one says something in a speech bubble with a picture in it, a jar or a heart. Then a grey bar over her head runs down while she stays quiet, even when the younger one shakes a hive. At the top, the pictures she said lately are greyed out.

Standing in her hearing is an event every tick, but she rolls only when she is free: half the rolls pass. A line shows for 2.5 seconds, then she is quiet for 8; a failed roll waits 3. The last 3 lines, greyed at the top, are not said again, in either pool.

Try it: Shake a hive while she is talking or while the grey bar runs: the shake is dropped, and no late answer comes after the silence. Stay close and watch the die: a red roll starts a short wait, a green one a line. The bee is in both lists, so once she has said it, it is greyed in both.

Keys: ←→ walk Space shake a hive

This little game runs this blueprint's tested code in your browser. Nothing you press is sent anywhere. Its code on GitHub.

The game above is the playable demo of our blueprint Ambient Barks. It runs that blueprint's tested code in your browser.

A game's world can tell its story while the player keeps playing: a line said in passing, at the moment it fits, and not said twice in a row. Nobody has to stop and read. The old beekeeper in the game above talks to whoever comes near her hives, by a few plain rules that decide when she speaks and when she keeps quiet. This lesson walks past her, and then you take a wall of text from your own game and cut it into lines that wait for their moment.

Also in this lesson 5 things to read up on 3 questions to check yourself

The idea

A short line that a character calls out on her own is called a bark. It is the opposite of a page of text before the game begins. A bark is small, it belongs to a place and a moment, and the player hears it with her hands still on the controls.

Three rules make barks tell a story instead of making noise:

A bark can be missed, and that is part of the deal. So it is the place for colour, hints and the feel of a world, never for the one fact a later scene cannot do without.

How it works

  1. Walk into her hearing and keep walking. The dotted line on the ground lights up. Soon she says something: a picture in a bubble, for 2.5 seconds. You never had to stop. Then a grey bar runs over her head while she is quiet for 8 seconds.
  2. Stay close and watch the die at the top right. Standing in her hearing is an event on every tick, but she rolls only when she is free. A green mark starts a line. A red one starts a short wait of 3 seconds, shown as a red bar, before she rolls again. Each roll passes with a chance of one half. Without that wait she would roll sixty times a second and speak almost at once, every time.
  3. Watch the lists at the top. The lines she said last are greyed out, the last 3 of them, and she picks from the rest. Her friendly list has five lines, so you hear one she has not said lately, and never the same line twice in a row.
  4. Shake a hive while she is speaking, or while the grey bar runs. A red cross: the shake is dropped. When her silence ends, she does not come back to it. If shakes were kept and played later, she would talk about bees that calmed down long ago.
  5. Now do it for your game. Take a wall of text you were going to show before play, and cut it into single facts, one line each. For every fact, name the moment in play when it is true or in sight: a place, an event, a character standing near it. Each fact becomes a line in the pool of that moment. Mark the facts a later scene needs. Those also get a place the player cannot miss, such as a scene that always plays.

What goes wrong

The shortcut is the wall. You ask your AI to introduce the world and its story, and it does what was asked: before the player may move, there are screens of history, names and places. The player presses on to get to the game. The facts are gone before she has seen any of the places they are about, and afterwards the world is silent while she plays.

When you then ask for the world to talk during play, the next shortcut follows. Every character answers every event at once, so ten lines arrive together and none is understood. Events that came during a line are kept in a queue and played late. And the pick is random, so in a small pool the same line comes back again and again, which sounds broken.

You notice the wall by counting: how many presses go to reading before the first press goes to playing? You notice the noise by standing next to a character for a few minutes and writing down every line with the time you heard it. Two lines at once, a line about something that is over, or one line twice in a row: each one is a rule that was left out.

Tell your AI

My game tells its story in [the intro, or these scenes]. I want part of it told in passing, while the player plays. Do not write any lines yet.

1. Cut [the text] into single facts, one line each. Mark every fact a later scene needs, such as a quest, a clue or an ending that reads it. Each marked fact must also be told somewhere the player cannot miss, because a line said in passing can be missed.
2. For every other fact, name the moment in play when it is true or in sight: a place, an event, or a character nearby. Group the facts into pools by event, and give every line an id of its own.
3. For each event, say whether it happens once or is true on every frame, such as the player standing near. Say which event wins when both come at the same time.
4. Use these rules: one line at a time per character, a silence after each line, a dice roll with a wait after a failed roll, events that come during a line or a silence are dropped and never queued, and none of the last few lines is said again while another line fits.
5. Draw the states and moves (ready, speaking, staying quiet) and write one test for every move. Then write a test that plays [ten] minutes near each character and prints every line with its time and its event, and after that: any line said twice in a row, any line that started during another, and how often each pool was heard. Run the tests and show me their output.

Try it

Read up

Where to go deeper: the pages of ours this lesson builds on, and what others have written about its point.

Check yourself: three questions

Each answer is checked and explained at once. The questions are part of the quiz, so they count for your Game Coder IQ like any other.

Question 1 of 3Easy

A guard in your game calls out short lines as the player walks past. Which of these facts must not be told only in such a line?

All questions of this course · The quiz and the Game Coder IQ

Next lesson Detective Game Clues That Add Up: A Case the Player Can Solve

How useful was this page?

Nobody has rated this page yet.

One click, no account. It tells us which pages to make better next.

Last updated: 2026-11-27