In sports games, how do the programmers code the hundreds of commentary lines in the game?
Commentary lines are mostly designed to be modular so that we can construct them on the fly as needed. The lines are broken down into individual chunks of recorded audio and assign them to specific categories so that we can assemble finished lines from the chunks. So, for example, let’s say that we start with this intro line from FIFA 2020:
“Welcome to you all here from the Etihad Stadium in Manchester. Martin Tyler here along with Alan Smith. Premier league football is coming right up. Manchester City against Liverpool.”
How can we begin to break this down into categories? We start by going sentence by sentence. There are four sentences here:
Greeting + Location introduction: “Welcome to you all here from Etihad Stadium in Manchester”
Commentator Introduction: “Martin Tyler here along with Alan Smith”
League introduction: “Premier league football is coming right up.”
Team introduction: “Manchester City against Liverpool.”
Within the sentences, we also identify the parts that need to be recognized. Let’s take the Greeting line and break it down. First, the greeting line could be:
“Welcome to you all here from…”
“It truly is a special place, a stadium that every football fan should visit should he or she get the chance, …”
“Hello wherever you happen to be. Welcome to…”
Followed by the stadium name and then the location:
… the Etihad Stadium in Manchester.
… the Estadio Santiago Bernabeu here in Madrid.
… Catalonia. Welcome to Barcelona.
If you combine each of the three greetings with each of the stadium locations, you can have many more valid commentary lines. We can formulate commentary lines like this for in-game events such as short passes, long passes, penalty kicks, blocked shots, short range goal, long range goal, yellow cards, red cards, etc. as well. They just have to follow a formula - a description of the event, the player(s) involved with the event, and maybe a color commentary reaction to the event. The recorded voiceover lines are organized like a bank of different ways to do each of these parts like the event description, the player names, and the color commentary reactions, as well as different inflections and deliveries for each line in order to convey something different (e.g. excitedly announcing a player name vs normally announcing a player name), and then strung together on the fly to form a complete commentary line. The game then does this for every event that triggers a commentary line, resulting in one of many possible commentary combinations. It also works for different spoken languages as well, as long as the specific category tags for each voice line is keyed in to the database properly. Dynamic voiced line systems like this are also often used in RPGs, with variables like character names, locations, etc. being the categories by which the lines are assembled on the fly.
[Join us on Discord] and/or [Support us on Patreon]
The FANTa Project is being rebooted. [What is the FANTa project?]
Got a burning question you want answered?
Short questions: Ask a Game Dev on Twitter
Long questions: Ask a Game Dev on Tumblr
Frequent Questions: The FAQ




















