NFSLocaleToolHB (Need for Speed Locale Tool Histogram Binary) is a tool designed to decompile and compile localization's binary and histogram chunk files for games based on Frostbite game engine.
The aforementioned game lacks Russian localization since the release. The game also has poor support of Cyrillic characters — only handful of them were encoded into the game for a simple task of displaying songs' track names, rendering the ability to edit the in-game text in Frosty Tool Suite impossible.
NFSLocaleToolHB solves this issue by editing all of the files outside of Frosty Editor and importing them back afterwards, bypassing all checks for histogram characters encoding integrity during mod's compilation. Also, having working Ё and ё is a welcome addition, which official localizations lack and overlook during the development.
- Generate a list of characters:
NFSLocaleToolHB -cl chars_list.txt
- Export the game's locale histogram chunk, then compile a new histogram chunk using generated list of characters and game's histogram chunk:
NFSLocaleToolHB -hg histogram.chunk chars_list.txt newhistogram.chunk
- Extract the locale text from game's binary chunk using new histogram chunk:
NFSLocaleToolHB -t nfsunbound.chunk newhistogram.chunk nfsunbound.chunk.txt
You will be provided with .ids and .txt files that contain hash names and in-game text tied to hashes respectively.
-
Edit whatever you need to edit.
If you're adding a new string into a text, make sure its hash is placed in its appropriate place (and not in the end of file), or else you risk mixing up all of the in-game text and it ending up in inappropriate places. -
Compile a binary chunk with new edits using new histogram and edited text file:
NFSLocaleToolHB.exe -b nfsunbound.chunk.txt newhistogram.chunk nfsunbound.chunk.ids newnfsunbound.chunk
- All you have to do next is import new chunks into the game's database via Frosty Editor and edit
BinaryChunkSize
in game'sFsUITextDatabase
language asset.
Make sure FsLocalization Loader (FsLocalizationPlugin) and Localized String Editor (LocalizedStringPlugin) plugins are not present in Frosty Editor, or else it crashes during the export.
Name | Data type | Size (in bytes) | Comment |
---|---|---|---|
magic | uint32 | 4 | 0x39000 |
fileSize | uint32 | 4 | file size - 8 |
listSize | uint32 | 4 | total amount of entries |
dataOffset | uint32 | 4 | start offset + 8 (hash pairs) |
stringsOffset | uint32 | 4 | string list offset + 8 |
section | cstring | CString (zero terminated) | section name |
000000 | byte | 128 | zero bytes |
hash pair list | uint32, uint32 | 8 | hash and string list offset |
string list | cstring | CString list | collection of all strings |
Name | Data type | Size (in bytes) | Comment |
---|---|---|---|
magic | uint32 | 4 | 0x39001 |
fileSize | uint32 | 4 | file size - 8 |
dataOffSize | uint32 | 4 | 256 |
000000 | byte | 256 | zero bytes |
section | uint16 | 256 | section chars |
byte | other |
This repository contains code (which was edited for production purposes) from NFSFBLocale tool made by @LinkOFF7.
Neither this project or pieces of code, nor authors are affiliated with Electronic Arts and/or DICE.
Need for Speed™ is a registered trademark of Electronic Arts. Frostbite™ is a registered trademark of EA Digital Illusions Creative Entertainment (DICE)