Get Playtests

How to Add Subtitles to a Game: Timing, Style and Engine Setup

How to add subtitles to a game: XAG and Steam rules, reading speed and timing, a line data format, Godot, Unity and Unreal setup, and a ship checklist.

Updated · 10 min read · For developers

If you are wondering how to add subtitles to a game, the short answer is: store every spoken line as data with a speaker and a timing, show it in one subtitle box that players can resize and put a background behind, and turn it on before the first line of audio plays. The longer answer is below: the rules worth following, a data format that survives translation, setup notes for Godot, Unity and Unreal, and a quick way to check the result with real players before launch.

Subtitles are not a niche feature. Figures that Ubisoft's David Tisserand shared in 2018 and 2019 show that about 60 percent of Assassin's Creed Origins players turned subtitles on when they shipped off by default, while 95 percent of Assassin's Creed Odyssey players and 97 percent of Far Cry New Dawn players kept them on when they shipped on. Whatever the reason each player had, most people play with text on screen when it is offered up front.

Subtitles vs captions: decide what you are building

The Xbox Accessibility Guidelines draw a clean line. Subtitles are text for speech and dialogue. Captions are text for all audio: speech plus sound effects, music and cues such as [footsteps behind you] or [radio static]. Captions can also carry tone ("sarcastic") and source ("over the radio").

For most indie games, plan for three layers and let players toggle each one:

  • Dialogue subtitles: cutscenes, conversations, narration.
  • Ambient or bark subtitles: NPC chatter, enemy callouts, background radio.
  • Sound captions: important non-speech sounds that affect play, like an enemy reloading off screen or a door opening behind the player.

XAG 104 asks for exactly this kind of split, so different types of caption information can be switched on and off on their own. The Outer Worlds is the example Microsoft uses: separate toggles for conversation, bark and cinematic subtitles.

If you only have time for one layer, start with dialogue subtitles for every spoken line, then add captions for any sound the player needs to react to. A sound that matters for gameplay and has no visual cue is a design problem as much as a subtitle problem.

The rules that matter, in one list

These come from XAG 104, the Game Accessibility Guidelines, and Steam's recommendations for the Subtitle Options accessibility feature. Treat them as your spec.

  • On by default, or set before any audio. Either ship subtitles on, or show the setting before the opening cutscene. Gears 5 starts with subtitles on and shows the accessibility menu after the first video.
  • Name the speaker. Show the name when a new speaker starts talking. XAG 104 says you don't need to repeat it on every line from the same speaker unless there is a long pause. Color can help tell speakers apart, but never color alone.
  • Two lines at most. Three only in exceptional cases.
  • Short lines. Around 40 characters per line is the common game guideline. Netflix allows 42 for English. Break lines by hand at sensible points instead of trusting auto wrap.
  • Big enough text. The Game Accessibility Guidelines recommend no smaller than 46 px at 1080p, either by default or through options. XAG 104 asks that subtitle text scale to at least 200 percent of your default size.
  • Background box. Players should be able to put a solid or semi-opaque box behind the text, with opacity from 0 to 100 percent. White text over a bright sky or desert sand is unreadable without one.
  • Mixed case, sans serif. All caps is harder to read. Offer at least one plain sans serif font even if your UI font is stylized.
  • Size separate from UI. Steam's recommendation is to let players scale subtitle text separately from other UI text.
  • Keep clear of the HUD. Subtitles should never sit behind or over health bars, prompts or the minimap, even at the largest size.
  • Show a preview. Let players see their settings applied while they adjust them. Forza Horizon 4 shows sample text from the settings menu.

If you plan to tick the Subtitle Options box in Steam's accessibility features, Valve's own recommendations are the floor: identify the speaker, avoid HUD overlap, use a readable sans serif font, provide a background container with adjustable opacity, and allow subtitle scaling separate from UI text. Our game accessibility testing guide shows how to test each claimed feature before you tick it.

Timing: how long each line stays up

Games don't have a frame-locked video track for most dialogue, so timing is where many indie subtitle systems break. Use these numbers as starting points:

  • Reading speed. Netflix caps English subtitles at 20 characters per second for adult programs and 17 for children's programs. The BBC works from 160 to 180 words per minute, which it turns into a minimum of about 0.3 seconds per word.
  • Minimum duration. Netflix uses five sixths of a second as the shortest a subtitle should be on screen. In practice, short barks like "Over here!" read better at a second or more.
  • Maximum duration. Netflix caps a single subtitle event at 7 seconds. If a line runs longer, split it into two events at a natural pause.

A simple rule you can code: duration equals the larger of the voice clip length or (characters divided by 17), clamped to at least one second. Then let the subtitle end when the audio ends, unless that would break the minimum.

For games with no voice acting, you still have "subtitles" in the form of dialogue boxes. The same reading speed logic applies to auto-advancing text. If text advances on its own, give players a way to slow it down or switch to manual advance.

Store lines as data, not in scenes

The most common mistake is typing subtitle text directly into cutscene timelines or UI nodes. It works for one language and one cutscene, and then you can't translate it, search it or fix a typo in one place.

Store every line in a table, usually a CSV or spreadsheet that exports to CSV. One row per line:

  • id: a stable key like CH1_DOCK_MARA_03
  • speaker: the display name key, not the name itself, so it can be translated
  • text: the English line, with manual line breaks where needed
  • category: dialogue, bark or caption
  • audio: the voice file, if any
  • start and end: only for lines inside a longer clip, like a cutscene with several speakers

Then your code asks for CH1_DOCK_MARA_03 and gets back the right text in the current language. Godot's tr() function and CSV translation importer work this way. Unity's Localization package does the same with String Tables. Unreal uses its own text localization on the subtitle cue text. When those keyed lines are ready for translators, our guide to indie game localization cost shows how vendors price them per word.

Translated lines are often longer than English, so a line that fits in two rows of 40 characters may need three in German. Plan for that from day one: keep the box width generous, re-check line counts per language, and see our game localization testing guide for checking overflow with pseudolocalization.

Engine setup: Godot, Unity and Unreal

None of these steps is hard. The work is in wiring every line through one system.

Godot

Godot has no built-in subtitle node, so you build one:

  1. Create a SubtitleLayer scene: a CanvasLayer with a PanelContainer (the background box) and a RichTextLabel or Label inside it, anchored bottom center.
  2. Make it an autoload so every scene can call it, for example Subtitles.show_line("CH1_DOCK_MARA_03").
  3. In show_line, look up the text with tr(), prepend the translated speaker name, set the label, and start a timer for the duration rule above.
  4. For dialogue inside a long audio clip, read the playback position each frame. Godot's audio sync docs recommend get_playback_position() plus AudioServer.get_time_since_last_mix(), minus AudioServer.get_output_latency(), for accurate timing.
  5. Bind font size, background opacity and on or off to your settings so the layer updates live.

If you prefer to author timings visually, a cutscene's AnimationPlayer can call show_line from a method track at the right frame.

Unity

Unity also has no general subtitle component for gameplay. A common setup:

  1. A SubtitleManager MonoBehaviour on a persistent Canvas with a TextMeshPro text and an Image as the background box.
  2. Lines come from a Localization String Table, keyed by line ID.
  3. For cutscenes built in Timeline, put a marker with a Signal Emitter at each line and a Signal Receiver that calls SubtitleManager.Show(lineId). Unity's Timeline docs walk through markers and signals using footstep sounds, and the same pattern works for lines.
  4. For gameplay barks, call Show from the same place you play the voice clip, so the two can never drift apart.

Unreal Engine

Unreal has subtitles built into Sound Wave assets. Each Sound Wave has a Subtitles array of cues with text and a start time, plus options like single line display and subtitle priority. Make sure subtitles are enabled in Project Settings.

Since Unreal Engine 5.6, Epic also ships a Subtitles and Closed Captions plugin that is meant to decouple subtitles from audio playback. Its audio subsystem can automatically queue subtitles for sounds and Dialogue Waves. If you are starting a new project on 5.6 or later, look at the plugin first.

Whichever route you take, style the subtitle widget yourself so it meets the size, background and placement rules above. The default look will not.

A shortcut for line wrapping

If you'd rather not hand-tune line breaks in every language, the open source game-subtitles library by wildwinter preprocesses strings with break hints, then measures words in your actual font at runtime to wrap and paginate. It has players for Unreal Engine 5, Unity, Godot and JavaScript.

Writing the captions themselves

Captions for sounds are a writing job, so set a house style early. These conventions borrow from broadcast captioning and fit games well:

  • Put sound descriptions in square brackets, lowercase except names: [glass shatters], [Mara laughing].
  • Describe the sound, not the picture. [distant gunfire] is a caption. [soldiers run in] is a stage direction.
  • Add direction for off-screen sounds. XAG 104 suggests arrows such as < or > next to the text. Minecraft Java Edition does this for sounds like cows and minecarts.
  • Name music by mood when it signals something: [tense music builds] tells a player an encounter is coming.
  • Only caption sounds that matter. A caption for every footstep in a crowd becomes noise.
  • Write speaker labels the same way every time. If a character hasn't been named yet, use a neutral label like [man on radio] instead of spoiling the name.

A subtitle checklist before you ship

Copy this into your task tracker and run through it on a real build:

  • Subtitles are on at first launch, or the setting appears before any voice line.
  • Every spoken line has a subtitle, including barks, radio chatter and lines in the main menu.
  • Every subtitle names its speaker when the speaker changes.
  • No subtitle has more than two lines at your default size.
  • Subtitle size goes to at least 200 percent of the default without overlapping the HUD.
  • Background box opacity goes from 0 to 100 percent.
  • Dialogue, barks and sound captions can be toggled separately.
  • The settings screen shows a live preview.
  • Lines don't disappear before a fast reader can finish them.
  • Subtitles pause when the game pauses and don't leak into the next scene.
  • Every language you ship fits the box without cut-off text.
  • Captions exist for every sound the player has to react to.

Test subtitles with players who rely on them

You can test your own subtitles for bugs, but you already know what every line says. The real question is whether someone who has never seen the script can follow the story and react in time with the text alone.

A simple way to test this:

  1. Ask a few players to play the first 15 to 30 minutes with the sound muted and subtitles on.
  2. Afterwards, ask them to retell the story so far and name who said what at one key moment. Gaps in their retelling point to missing or rushed lines.
  3. Watch for moments where they died or got lost right after an off-screen sound. That's a missing caption.
  4. Ask them to change the subtitle size and background without help. If they can't find the settings, neither will anyone else.

Ideally, include players who are deaf or hard of hearing, and players who use subtitles because English is not their first language. For how to structure sessions you can't sit in on, see our guide to running a remote playtest, and for a full session plan use how to run a playtest.

If you want fresh eyes on your subtitles without recruiting a panel yourself, you can post your game on Get Playtests for free and ask reviewers to play a section with the sound off. Players pick games they actually want to play, and reviews can come back as written notes, a video or a livestream, which lets you watch exactly when they had to pause to read. No credit card needed.

Common subtitle mistakes indie games ship with

  • Tiny text styled to match the UI. It looks good in screenshots and fails on a TV across the room.
  • No background box. Outlines help, but they are not enough on busy scenes.
  • Subtitles only in cutscenes. Barks and radio lines during gameplay often carry objectives.
  • Settings behind the intro. If the opening cutscene has dialogue, the subtitle setting has to come first.
  • Auto-wrap only. Machine wrapping splits names and phrases at awkward points. Hand-break the important lines.
  • Text baked into video. Pre-rendered cutscenes with burned-in subtitles can't be resized, turned off or translated. Render subtitles live over the video instead.
  • Forgetting the tutorial. Voiced tutorial prompts need subtitles too, and the text should match the prompt timing. Our game tutorial design guide covers how to keep that teaching short.

Get these right and you'll also have an honest claim to Steam's Subtitle Options accessibility tag on your Steam page, plus a game that more people can play the way they prefer.

Sources

  1. XAG 104: Subtitles and captions (Microsoft Learn)
  2. Accessibility Features: Subtitle Options (Steamworks Documentation)
  3. If any subtitles / captions are used, present them in a clear, easy to read way (Game Accessibility Guidelines)
  4. English (USA) Timed Text Style Guide (Netflix Partner Help Center)
  5. Timed Text Style Guide: General Requirements (Netflix Partner Help Center)
  6. Subtitle Guidelines (BBC)
  7. 95 % av Assassin's Creed Odyssey-spelarna har undertexterna pa (FZ.se)
  8. Default On: What Developer Data Shows About Subtitle Use in Games
  9. Sync the gameplay with audio and music (Godot Engine documentation)
  10. Internationalizing games (Godot Engine documentation)
  11. Use markers and signals for footsteps (Unity Timeline manual)
  12. String Tables (Unity Localization package manual)
  13. unreal.SoundWave (Unreal Python API 5.6)
  14. USubtitlesAudioSubsystem (Unreal Engine 5.7 API)
  15. wildwinter/game-subtitles (GitHub)