The Dialog System

Overview

The Dialog System is used to manage spoken text inside the CryENGINE. Every single dialog line has to be specified in a recording list. Some of these lines can be combined into dialogs using the Dialog Editor, as a sequence of sentences spoken by individual characters. These sentences, are defined in terms of sound and appearance in the Localization folder, as their content differs on the base of localized application versions. The following chapter describes how to add sentences spoken by one character and how to change their individual appearance.

Defining Spoken Sentences

Spoken sentences are arranged in files dialog_recording_list.xml and ai_dialog_recording_list.xml, which reference audio and facial animation data.

The xml files contain a structure which describes the type of character speaking (row Person), the subtitle (row DIALOGUE), as well as several properties. The row named PROTOTYPE EVENT identifies the appearance of the spoken sound.

In the file Sounds/dialog/dialog.fdp there is a project in which these prototypes are defined through FMOD Designer. The properties in each line are used to control the prototypes in detail.

As an example row RADIO SQUELCH can be used to define which sound should overlay the speech defined in the spoken audio (See picture). This approach leaves full freedom to sound designers to adapt a spoken text to a specific situation (e.g. a person speaking through a radio while sitting in a helicopter).


Sample of a PROTOTYPE EVENT setup in FMOD Designer.

Managing Dialog Wave Data in FMOD

In FMOD each dialog event needs a special sound definition so the SoundSystem can later replace it with the actual wave data of the voice file. Create a sound definition and add a 'Programmer Sound' to it. This sound definition does not hold any data, it will only trigger callbacks to the SoundSystem at the moment it should play. The SoundSystem then passes the voice file data which it streamed in as a regular wave buffer to this sound definition. See FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_CREATE in the SoundSystem source code.

Voice files which are loaded in as a wave buffer need to be in the format of s_MPEGCompression, although the reference within the dialog_recording lists should always be to the .wav file.