Table of contents
The local implementation of String Data Base is based on the (SQLite Version 3), and the C# plugin for RedStrings - (System.Data.SQLite Version 1.0.66) The RedStrings can be recompiled with different version of C# SQLite if required.
The whole database is split into two parts: the base part (original game content) and the user part (everything else that user will create). This is reflected by having two DataBase files on disk. The first, called „base.sqlite” (~100MB) holds original data, the second one called „user.sqlite” holds user strings and dialog lines and is initially empty. The base file is never modified by the editor or by RedStrings application. User file if not found, will be created by the editor or by RedStrings whichever will be run first.
Internally, all new strings will have their IDs assigned from the range >=1 000 000, thus creating an easy way to guess whether an ID is from the base subset or from the user's subset. Also, the versioning of localized data was removed since it was almost never used in the editor.
The original dialog lines and voiceover files cannot be changed in the Editor. They are there only for reference.
Two new directories under data directory are created. The first is „local_speech” into which we can export all existing speech and lipsync data thus enabling live preview of dialog audio and lipsync in the editor. The second one named „user_speech” is supposed to hold the audio data for the user-created dialogs.
Both directories share a common structure. First, there's a subdirectory named with a two-letter mnemonic code for each language, then, inside each of those there exist „audio” directory for the audio files and „lipsync” for the lipsync files. Some example paths:
All file names for the voiceovers are RELATIVE to those paths. For example, if a voiceover file named VO_TEST_123 is being associated with some dialog line, then, depending on the current language setting, the Engine will try to load a file from following location:
data\local_speech\en\audio\VO_TEST_123.mp2 – if English is selected
data\local_speech\pl\audio\VO_TEST_123.mp2 – if Polish is selected
and so on.
There's no possibility to assign files with different file names for different languages. This is the limitation of the current system. There is, however, a possibility to create subdirectories within the “audio” directory, so for example the name “geralt\quest1\g_0011” is a valid voice over name and will direct to file:
data\local_speech\en\audio\geralt\quest1\g_0011.mp2 – if English is selected
All strings that existed in the game can be exported along with the audio and lipsync data.
Exporting original content
In order to export existing content you need to execute game executable with some special commands. First make sure that the active directory is the the „bin” directory of the installed game. Then, delete the ”base.sqlite” file. After that run the following: IN ESPECIALLY CREATED EXE FILE
or, if you want also to export audio and lipsync data:
witcher2.exe exportstrings exportvo
Whole operation may take several minutes and may require up to 1GB of free HDD space per each exported language. By default all languages are exported.
Cooking new content
New strings along with their audio files can be cooked back into w2strings and w2speech files by using special commandlet called „cooklocalstrings”.
First make sure the current directory is the „bin” directory of the installed game. Then run the following command:
where can be ONE of the following:
strings – to cook only user strings (no audio)
speech – to cook strings + speech
and is the list of two-letter languages mnemonics separated by spaces ( e.g: „en pl de” ) or is empty in which case all languages will be processed.
Cooked files are named according to scheme: en_user.w2strings, en_user.w2speech and so on and are automatically recognized by game.
Supported audio formats
The only supported audio formats are mp2 ( MPEG Layer 2 ) and wav (PCM).
Supported lipsync formats
The only supported lipsync formats are hkx ( Havok Animation ) or raw binary format that is not accessible by the user. Original lipsync data is exported as compressed raw animation format and cannot be easily converted back into HKX animation. If we wish to allow users to reverse-engineer the lip-sync format it would be advisable to address this issue by, for example, giving the original lipsync data directly from P4.
Assigning voice over files inside the editor
Each dialog line has a property named „customVoiceOverName”
The assigned voiceover file can be played to test if it is the right one by clicking the small green „play” button. There is one limitation to the current system: we can only assign voiceover files to the strings that has been added to the data base. Therefore, for a new dialog line you first need to save the Dialog by File->Save and only then you can assing the voice over file name for that line. There is a message box implemented to remind user of that requirement.
Viewing localized strings in the RedStrings
Every localized content (string) can be opened inside the RedStrings by clicking the small „magnification glass” icon next to the string. This option is accessible in the various property browsers.
The first launch of RedStrings may take a long time.
Launching RedStrings from editor
New toolbar icon was added to start RedStrings directly from the Editor. The first launch of RedStrings may take a long time.
Modifications to RedStrings
The RedStrings application now shows all the strings, not only the ones that have non empty String Key. This modification was needed in order to allow the user to browse and change the Voice Over files.
A new column named „String Index” was added that shows the internal string ID of every localized string.
A new button was added next to “Voiceover” control to allow the user to browse for the voice over file.