Jump to content

Language/Need for Speed

From Burnout Wiki

The Language resource type in Need for Speed Hot Pursuit and Most Wanted is similar to its predecessor in Burnout Paradise. Each string is assigned an ID and pointed to in a table. However, the IDs are now unique IDs rather than JAMCRC hashes of an identifying string, and although strings remain null-terminated they now have associated capacity values as well.

Whereas Paradise used standard UTF-8, NFS uses a custom wide-character encoding most similar to, and compatible with, UCS-2 (a fixed-width 16-bit encoding format related to UTF-16). Criterion uses the private use area, with characters in the E0XX and E1XX ranges being used for custom symbols such as the one for Speed Points. The F0XX range is used for inline styles.

Note: Hot Pursuit uses the AK namespace rather than Game.

Structures

Game::LanguageResource

32-bit

Offset Length Type Name Description Comments
0x0 0x4 uint32_t meLanguageID Language ID See ELanguage.
Unlike Paradise, this matches the bundle name.
0x4 0x4 uint32_t muSize Number of strings
0x8 0x4 UniqueId* mpStringIDs String IDs
0xC 0x4 WideStringAllocated* mpStrings String info

64-bit

Offset Length Type Name Description Comments
0x0 0x4 uint32_t meLanguageID Language ID See ELanguage.
Unlike Paradise, this matches the bundle name.
0x4 0x4 uint32_t muSize Number of strings
0x8 0x8 UniqueId* mpStringIDs String IDs
0x10 0x8 WideStringAllocated* mpStrings String info

CgsCore::WideStringAllocated

Offset Length Type Name Description
0x0 0x8 WideStringBase Base class

CgsCore::WideStringBase

32-bit

Offset Length Type Name Description Comments
0x0 0x4 wchar_t* mpwcString String data Null-terminated
0x4 0x4 int32_t miCapacity String capacity This is allocation amount, not length

64-bit

Offset Length Type Name Description Comments
0x0 0x8 wchar_t* mpwcString String data Null-terminated
0x8 0x4 int32_t miCapacity String capacity This is allocation amount, not length
0xC 0x4 Padding

Enumerations

CgsLanguage::ELanguage

Name Value Comments
E_LANGUAGE_INVALID 0 Invalid language code
E_LANGUAGE_ENGLISH_US 1 English US
E_LANGUAGE_ENGLISH_UK 2 English UK
E_LANGUAGE_FRENCH 3 French
E_LANGUAGE_SPANISH 4 Spanish
E_LANGUAGE_ITALIAN 5 Italian
E_LANGUAGE_GERMAN 6 German
E_LANGUAGE_RUSSIAN 7 Russian
E_LANGUAGE_POLISH 8 Polish
E_LANGUAGE_CZECH 9 Czech
E_LANGUAGE_HUNGARIAN 10 Hungarian
E_LANGUAGE_JAPANESE 11 Japanese
E_LANGUAGE_CHINESE_TRADITIONAL 12 Chinese (traditional)
E_LANGUAGE_DUTCH 13 Dutch
E_LANGUAGE_ARABIC 14 Arabic
E_LANGUAGE_TOTAL 15 Number of languages

CgsTypeSetter::CharFlags::ESize

Name Value Comments
E_SIZE_XXS 1 Extra extra small
E_SIZE_XS 2 Extra small
E_SIZE_S 3 Small
E_SIZE_M 4 Medium
E_SIZE_L 5 Large
E_SIZE_XL 6 Extra large
E_SIZE_XXL 7 Extra extra large
E_SIZE_COUNT 8 Number of sizes

Styles

Inline styles (characters in the F0XX range) are used to apply bold, italic, colors, or sizes to a section of a string. In practice, they are used similarly to how HTML tags are, with start and end characters. A list of styles can be found below.

Char code Description
F000 Starts a bold section of text.
F001 Ends a bold section of text.
F002 Starts an italic section of text.
F003 Ends an italic section of text.
F004 Starts a section of text at XXS size.
F005 Ends a section of text at XXS size.
F006 Starts a section of text at XS size.
F007 Ends a section of text at XS size.
F008 Starts a section of text at S size.
F009 Ends a section of text at S size.
F00A Starts a section of text at M size.
F00B Ends a section of text at M size.
F00C Starts a section of text at L size.
F00D Ends a section of text at L size.
F00E Starts a section of text at XL size.
F00F Ends a section of text at XL size.
F010 Starts a section of text at XXL size.
F011 Ends a section of text at XXL size.
F012 Sets a section of text to use color index 0x3F.
In practice, this is used to end colored sections and is likely a "no color" value.
F013:F091 Sets a section of text to use color index color_code + 0xFED.
Due to integer overflow, effectively results in color_code - 0xF013.
Hmmm...
Hmmm...
To do:
Find out what these color indices are pulling from.
F092 Starts a section of text set to use the keyboard.
F093 Ends a section of text using the keyboard.
Cookies help us deliver our services. By using our services, you agree to our use of cookies.