2DA Files

2das (two-dimensional arrays) are what Jade Empire uses instead of a database. Almost all of the game's parameters are stored in the 2das. In comparison to earlier Bioware titles the number of 2das has increased quite dramatically. There is still a small amount of magic numbers hard-coded in the scripts and in the game engine itself, but most of the game's parameters - be it the sequence of combat moves, the radius of area effects, the textures of the characters, the prices of gems and a million other things - are accessible and editable now.

Listings of 2das
The following pages list all of the game's 2das:
 * Basic 2das
 * Henchmen 2das
 * Style 2das
 * Area Reward 2das

Binary and Text Versions
2das come in two flavors: a text form and a binary form. The game engine understands both flavors but a vanilla installation of Jade Empire uses only the binary form. The binary 2das probably load slightly faster than text 2das, but unlike the text versions the binaries are not meant to be read or edited by human beings. So if you want to mod the 2das you will have to use the text form. You can convert the one form into the other with Convert2da. You can also download all of the 2das in text form here.

Editing 2DAs
The structure of 2das in text form is relatively simple. Here is an excerpt from as an example: (The real items.2da has hundreds of rows and twice as many columns)



The structure very much resembles that of a spreadsheet. The items are sorted in rows and the columns contain the relevant information about the item in the respective row.

2das in text form always start with the prologue "2DA V2.0". This is followed by an empty line and a line containing the column labels. The first column does not have a label. These are the row indexes. They're usually numeric but not always and they usually start with zero but not always. The columns are separated by spaces. At least one space between them is required. The width of the column is dictated by its widest field. The columns are always aligned left. Some fields contain a special value: ****. This special value is actually no value at all. It simply says that the field is empty. This is the equivalent to NULL in a traditional database.

Binary 2DAs
Binary 2das always start with the prologue "2DA V2.b" followed by a linefeed character (LF).

Next comes a list of the column labels as ASCII strings that are delimited by TABS. The list ends with a NUL character.

Next is an unsigned 32-bit integer that contains the number of rows in the table.

Next is a list of row labels. They too are delimited by TABs but they do not end in a NUL character.

Next is a two dimensional array (row major order) containing 16-bit offsets into the data fields. The offsets are relative to the start of the first data field.

Next come two unused bytes.

And finally comes the list of data fields as a series of NUL-terminated strings.