Skip to content

Radoub Formats GFF

LordOfMyatar edited this page Dec 15, 2025 · 1 revision

GFF Format

Generic File Format - the foundation format for most Aurora Engine data files.


Overview

GFF (Generic File Format) is a hierarchical tree structure used by virtually all Aurora Engine game data. Dialog files (.dlg), creature templates (.utc), items (.uti), journals (.jrl), and dozens of other file types are all GFF files with different type signatures.

File Types Using GFF: DLG, UTC, UTI, UTP, UTD, UTE, UTT, UTS, UTW, UTM, JRL, IFO, ARE, GIT, GIC, FAC, GUI, ITP, and more.


Binary Layout

Header (56 bytes)

Offset Size Type Description
0 4 char[4] FileType (e.g., "DLG ", "UTC ", "JRL ")
4 4 char[4] Version (always "V3.2")
8 4 uint32 StructOffset
12 4 uint32 StructCount
16 4 uint32 FieldOffset
20 4 uint32 FieldCount
24 4 uint32 LabelOffset
28 4 uint32 LabelCount
32 4 uint32 FieldDataOffset
36 4 uint32 FieldDataCount
40 4 uint32 FieldIndicesOffset
44 4 uint32 FieldIndicesCount
48 4 uint32 ListIndicesOffset
52 4 uint32 ListIndicesCount

Data Sections

flowchart TB
    Header[Header 56 bytes]
    Structs[Struct Array]
    Fields[Field Array]
    Labels[Label Array]
    FieldData[Field Data]
    FieldIndices[Field Indices]
    ListIndices[List Indices]

    Header --> Structs
    Structs --> Fields
    Fields --> Labels
    Labels --> FieldData
    FieldData --> FieldIndices
    FieldIndices --> ListIndices
Loading

Structs

Each struct is 12 bytes:

Offset Size Type Description
0 4 uint32 Type (application-specific meaning)
4 4 uint32 DataOrDataOffset (see below)
8 4 uint32 FieldCount

DataOrDataOffset interpretation:

  • FieldCount == 0: No fields (value ignored)
  • FieldCount == 1: Direct field index
  • FieldCount > 1: Byte offset into FieldIndices array

The root struct is always index 0.


Fields

Each field is 12 bytes:

Offset Size Type Description
0 4 uint32 Type (see Field Types below)
4 4 uint32 LabelIndex
8 4 uint32 DataOrDataOffset

DataOrDataOffset interpretation:

  • Simple types (0-9): Value stored directly
  • Complex types (10-15): Byte offset into FieldData

Field Types

Value Name Size Storage
0 BYTE 1 Direct
1 CHAR 1 Direct
2 WORD 2 Direct
3 SHORT 2 Direct
4 DWORD 4 Direct
5 INT 4 Direct
6 DWORD64 8 Direct*
7 INT64 8 Direct*
8 FLOAT 4 Direct
9 DOUBLE 8 Direct*
10 CExoString Variable FieldData
11 CResRef 1-17 FieldData
12 CExoLocString Variable FieldData
13 VOID Variable FieldData
14 Struct 4 FieldData (struct index)
15 List Variable ListIndices

*Note: 64-bit types store value directly but only lower 32 bits fit in DataOrDataOffset; implementations vary.


Complex Type Formats

CExoString (Type 10)

Offset Size Type Description
0 4 uint32 Length
4 Length char[] UTF-8 string (not null-terminated)

CResRef (Type 11)

Offset Size Type Description
0 1 byte Length (max 16)
1 Length char[] ASCII resource reference

CExoLocString (Type 12)

Offset Size Type Description
0 4 uint32 TotalSize (bytes following)
4 4 uint32 StrRef (0xFFFFFFFF = no TLK)
8 4 uint32 SubStringCount
12+ Variable SubString[] Localized strings

SubString format:

Offset Size Type Description
0 4 uint32 LanguageID (Language * 2 + Gender)
4 4 uint32 StringLength
8 Length char[] UTF-8 string

VOID (Type 13)

Offset Size Type Description
0 4 uint32 Length
4 Length byte[] Raw binary data

Struct (Type 14)

Offset Size Type Description
0 4 uint32 Struct index

List (Type 15)

DataOrDataOffset points to ListIndices array:

Offset Size Type Description
0 4 uint32 Count
4 Count*4 uint32[] Struct indices

Labels

Labels are 16-byte fixed-width fields:

Offset Size Type Description
0 16 char[16] Null-padded label text

Maximum label length is 16 characters.


Usage in Radoub.Formats

Reading

using Radoub.Formats.Gff;

var gff = GffReader.Read("mydialog.dlg");

// Access file metadata
string type = gff.FileType;     // "DLG "
string version = gff.FileVersion; // "V3.2"

// Navigate structure
var root = gff.RootStruct;
var entryList = root.GetField("EntryList");

// Type-safe access
uint delay = root.GetFieldValue<uint>("DelayEntry", 0);
string text = root.GetFieldValue<CExoLocString>("Text")?.GetDefaultString();

// Iterate list
if (entryList?.Value is GffList list)
{
    foreach (var entry in list.Elements)
    {
        // Process each struct
    }
}

Writing

using Radoub.Formats.Gff;

var gff = new GffFile
{
    FileType = "DLG ",
    FileVersion = "V3.2"
};

// Build structure
gff.RootStruct = new GffStruct { Type = 0xFFFFFFFF };
gff.RootStruct.Fields.Add(new GffField
{
    Type = GffField.DWORD,
    Label = "DelayEntry",
    Value = 0u
});

// Write to file
GffWriter.Write(gff, "output.dlg");

Implementation Notes

Label Format Auto-Detection

Radoub.Formats auto-detects label format based on section size:

  • 16-byte fixed (Aurora standard)
  • 18-byte length-prefixed (some tools)
  • Null-terminated (rare)

Encoding

  • CExoString: UTF-8 with Windows-1252 fallback
  • CResRef: ASCII only
  • Labels: ASCII only

Validation

The reader validates:

  • Header size and magic
  • Version string ("V3.2" only)
  • Array bounds for all offsets
  • Struct/field indices within range

Page freshness: 2025-12-15


Parley

Getting Started

User Guide

Features

Help


Manifest


Quartermaster


Fence

  • Fence - Merchant/Store Editor

Trebuchet


Shared Features


Developers

Parley Internals

Manifest Internals

Quartermaster Internals

Fence Internals

Trebuchet Internals

Radoub.UI


Radoub.Formats

Library

Low-Level Formats

High-Level Parsers


Legacy Bioware Docs

Original BioWare Aurora Engine file format specifications.

Core Formats

Object Blueprints

Module/Area Files

Reference


Index

Clone this wiki locally