-
Notifications
You must be signed in to change notification settings - Fork 10
ENG file format
Translatable strings in the citybuilding games are stored in ENG files. There are two types of files:
- Text files for simple text strings
- Message files for complex messages with title, body text, and more properties, such as the help pages
Strings in text files are grouped together into groups. A text is referenced by two numbers: its group number, and an index of the string within the group.
Text files consist of three parts:
The games look up strings in the following way: first, the index entry for the group is consulted. This gives us the offset into the data part where the group's strings start. Then, the data part is consulted. If the third string is needed, the first two strings starting at the offset are skipped, and the third string encountered in the group is returned.
The 28-byte header consists of the following fields:
| Offset | Length | Description |
|---|---|---|
| 0 | 16 | String describing the file, example: "C3 textfile." |
| 16 | 4 | Total number of groups in use, defined by maximum used group ID, plus 1 |
| 20 | 4 | Total number of strings in the file |
| 24 | 4 | Total number of words in the file, may not be accurate |
The index consists of 1000 entries. Each entry is 8 bytes in total, but the exact meaning of the fields differs per game.
| Offset | Length | Description |
|---|---|---|
| 0 | 4 | Index into the data part of the file where this group starts |
| 4 | 4 | Earlier games: 0 = entry is unused, 1 = entry is used Later games: the number of strings in this group, implying 0 = unused |
The data is just a lot of strings one after the other, separated by one (or more) 0-byte per string. A string must contain at least one printable character (value >= 32) to count.
TODO