GFF files are the "Generic File Format" of Neverwinter Nights. A binary encoded file with a basic structure, it contains all the blueprints, area instanced information, even saved games contents.
The game comes with a very basic Windows only GFF editor, good for simple changes. In NWN:EE it is located in Neverwinter Nights\util\win32\GFFEditor.exe
There is the tool TlkEdit2 (2da/tlk/gff/erf Editor) on the vault, this runs in Java so is more cross compatible and may be easier to use.
Then you can decompile the files into JSON using the neverwinter-nim tooling. This is good for mass changes or uploading to a code repository.
There may be references on other wiki pages to editing GFF files directly - the toolset either doesn't support specific changes (eg; higher numbers than the toolset shows) or doesn't support the changes full stop even if the game recognises them (eg; setting a NPC familiar type).
To edit the modules GFF files first open it so it extracts the contents to the Documents\Neverwinter Nights\modules\temp0 folder. Then find the file you wish to edit in your editor of choice (or copy it elsewhere, then copy it back). Once edited save the module and it'll package up the file without question.
Editing it later in the toolset may change the GFF fields back to some default or remove them entirely - so be warned changes made using a GFF editor may be undone at any moment.
You can convert most GFF formats to Json with ObjectToJson and back from Json to GFF formats with JsonToObject. Limitations here are the bigger fields like DWORD or DWORD64.
You can read most of the generic information in the GFF format specification Bioware made with a rundown of how it operates in the PDF.
Here is some cribbed information for ease of access.
This is the most useful information for many basic edits.
| Data Type | NWN Explorer Name | Size (in bytes) | Value Limits | Description | Notes |
|---|---|---|---|---|---|
| BYTE | UINT8 | 1 | 0 to 255 | Unsigned single byte | Smallest unit to store so also used for booleans |
| WORD | UINT16 | 2 | 0 to 65535 | Unsigned integer | UINT16 in Explorer |
| DWORD | UINT32 | 4 | 0 to 4294967296 | Unsigned integer | |
| DWORD64 | UNIT64 | 8 | 0 to roughly 18E18 | Unsigned integer | |
| CHAR | INT8 | 1 | -128 - 127 | Single character signed integer | |
| SHORT | INT16 | 2 | -32768 to 32767 | Signed integer | |
| INT | INT32 | 4 | -2147483648 to 2147483647 | Signed integer | |
| INT64 | INT32 | 8 | Roughly -9E18 to +9E18 | Signed integer | |
| FLOAT | FLOAT | 4 | Variable see Wikipedia | Floating point value | |
| DOUBLE | 8 | Variable see Wikipedia | Double-precision floating point value | ||
| CExoLocString | variable | n/a | Localized string. Contains a StringRef DWORD, and a number of CExoStrings, each having their own language ID. | ||
| CExoString | STRING | variable | n/a | Non-localized string | Commonly used in the toolset (ie user set per-module) |
| CResRef | RESREF | 16 | 16 characters | Filename of a game resource. Max length is 16 characters. Unused characters are nulls. | |
| VOID / Binary | variable | n/a | Variable-length arbitrary data | Used to store things like sqlite data on BICs or Modules/Saves | |
| Struct | ENTRY | variable | n/a | A complex data type that can contain any number of any of the other data types, including other Structs. | Used to lay out data in the GFF, eg; level data in a BIC |
| List | LIST | variable | n/a | A list of Structs. |