Skip to content
Benjamin Auquite edited this page Jan 3, 2026 · 47 revisions

Welcome to the PyKotor Wiki

Documentation

For End Users

For Mod Developers

Official Bioware Aurora Documentation

The following documents ARE official Bioware Aurora Engine file format specifications. These ARE authoritative references for the underlying file formats used by KotOR:

Aurora Engine Basics (KotOR)

The following information describes the resource system used by KotOR and TSL. While KotOR shares the Aurora engine with Neverwinter Nights, this section focuses on KotOR-specific behavior and file locations. Some details (like nwn.ini) are NWN-specific and are noted as such.

KEY files:

  • chitin.key: Master index file that maps resource names to BIF archives locations. Given a resource name, chitin.key can be used to locate the master data file (BIF) containing the resource.
  • dialog.tlk: Text resource file containing localized strings referenced by StrRef IDs. This centralizes strings for easy localization and allows changing text without modifying or recompiling scripts. Different language versions of dialog.tlk can be installed for localization support.
  • kotor.ini: Configuration file with [Alias] section mapping logical directory names to physical paths. This allows the game to locate data files regardless of installation directory structure. Note: nwn.ini is the Neverwinter Nights equivalent and is not used in KotOR.

Reference: vendor/xoreos-docs/specs/torlack/basics.html - Tim Smith (Torlack)'s Aurora engine basics documentation (originally NWN-focused, but resource resolution order and key file concepts apply to KotOR)

Resource Resolution Order:

  1. Override folder (override/)
  2. Currently loaded MOD/ERF files
  3. Currently loaded SAV file (if in-game)
  4. BIF files via KEY lookup
  5. Hardcoded defaults

Resource types:

KotOR uses hexadecimal resource type identifiers inherited from the Aurora engine. The following table lists resource types used in KotOR (some types may be legacy from earlier BioWare games or shared with Neverwinter Nights):

Resource Name type ID Description
RES 0x0000 Generic resource (legacy)
BMP 0x0001 Bitmap image (legacy)
MVE 0x0002 Movie/video file (legacy)
TGA 0x0003 Targa image format (legacy)
WAV 0x0004 Wave audio file (see WAV File Format)
PLT 0x0006 texture palette (Neverwinter Nights only, NOT used in KotOR - see PLT File Format)
INI 0x0007 Configuration file (e.g., kotor.ini)
BMU 0x0008 Unknown (legacy)
MPG 0x0009 MPEG video (legacy)
TXT 0x000A Text file (legacy)
PLH 0x07D0 Placeable header (legacy)
TEX 0x07D1 Texture (legacy, replaced by TPC)
MDL 0x07D2 3D model file (see MDL/MDX File Format)
THG 0x07D3 Unknown (legacy)
FNT 0x07D5 Font file (legacy)
LUA 0x07D7 Lua script (legacy)
SLT 0x07D8 Unknown (legacy)
NSS 0x07D9 NWScript source code (see NSS File Format)
NCS 0x07DA Compiled NWScript bytecode (see NCS File Format)
MOD 0x07DB Module archive (ERF variant, see ERF File Format)
ARE 0x07DC Area definition (see GFF-ARE)
SET 0x07DD Unknown (legacy)
IFO 0x07DE Module information (see GFF-IFO)
BIC 0x07DF Character template (legacy)
WOK 0x07E0 Walkmesh (see BWM File Format)
2DA 0x07E1 Two-dimensional array data (see 2DA File Format)
TLK 0x07E2 Talk table (localized strings, see TLK File Format)
TXI 0x07E6 texture information (see TXI File Format)
GIT 0x07E7 game instance template (see GFF-GIT)
BTI 0x07E8 Blueprint trigger (legacy)
UTI 0x07E9 item templates (see GFF-UTI)
BTC 0x07EA Blueprint creature (legacy)
UTC 0x07EB creature templates (see GFF-UTC)
DLG 0x07ED Dialogue/conversation (see GFF-DLG)
ITP 0x07EE ITP format (legacy name for GFF, see GFF File Format)
BTT 0x07EF Blueprint trigger (legacy)
UTT 0x07F0 Trigger template (see GFF-UTT)
DDS 0x07F1 DirectDraw Surface texture (see DDS File Format)
UTS 0x07F3 Sound template (see GFF-UTS)
LTR 0x07F4 Letter format (see LTR File Format)
GFF 0x07F5 Generic file format (container, see GFF File Format)
FAC 0x07F6 Faction (legacy)
BTE 0x07F7 Blueprint encounter (legacy)
UTE 0x07F8 encounter template (see GFF-UTE)
BTD 0x07F9 Blueprint door (legacy)
UTD 0x07FA door templates (see GFF-UTD)
BTP 0x07FB Blueprint placeable (legacy)
UTP 0x07FC placeable templates (see GFF-UTP)
DTF 0x07FD Unknown (legacy)
GIC 0x07FE Unknown (legacy)
GUI 0x07FF User interface definition (see GFF-GUI)
CSS 0x0800 Unknown (legacy)
CCS 0x0801 Unknown (legacy)
BTM 0x0802 Blueprint merchant (legacy)
UTM 0x0803 Merchant/store template (see GFF-UTM)
DWK 0x0804 Door walkmesh (see BWM File Format)
PWK 0x0805 Placeable walkmesh (see BWM File Format)
BTG 0x0806 Blueprint trigger (legacy)
UTG 0x0807 Unknown (legacy)
JRL 0x0808 Journal/quest log (see GFF-JRL)
SAV 0x0809 save game archives (see ERF File Format)
UTW 0x080A waypoint template (see GFF-UTW)
4PC 0x080B Unknown (legacy)
SSF 0x080C sound set files (see SSF File Format)
HAK 0x080D Hak pak archive (ERF variant)
NWM 0x080E Neverwinter Nights module (ERF variant, not used in KotOR)
BIK 0x080F Bink video format
PTM 0x0811 Unknown (legacy)
PTT 0x0812 Unknown (legacy)
ERF 0x270D Encapsulated resource file (see ERF File Format)
BIF 0x270E BioWare index file (archive, see BIF File Format)
KEY 0x270F KEY table (BIF index, see KEY File Format)

Language IDs:

Localized strings use language identifiers:

Reference: vendor/xoreos-docs/specs/torlack/basics.html - Language ID definitions (NWN-focused but applicable to KotOR)

Language ID
English 0
French (Male) 2
French (Female) 3
German (Male) 4
German (Female) 5
Italian (Male) 6
Italian (Female) 7
Spanish (Male) 8
Spanish (Female) 9

Reference: vendor/xoreos-docs/specs/torlack/basics.html - Tim Smith (Torlack)'s NWN data file Basics documentation (Aurora engine fundamentals)

file formats

Internal Documentation

Vendor Implementations

PyKotor includes many vendor submodules that provide alternative implementations of KotOR tools and engines. These serve as reference implementations and enable comparison of different approaches to the same problems.

Engine Reimplementations

Complete game engine rewrites that can load and play KotOR:

file format Libraries

Libraries focused on reading/writing KotOR file formats:

3D Modeling Tools

Tools for working with KotOR 3D models and textures:

Script Development

Tools for writing and editing NWScript:

Modding Tools

Tools for creating and installing mods:

  • KotorCLI (PyKotor) - CLI-first toolset for packing, conversion, Holocron kit generation, and GUI layout scaling. python -m kotorcli kit-generate --installation <path> --module <module> --output <dir> runs headless; launching with no arguments opens the Tkinter kit generator GUI for interactive use. python -m kotorcli gui-convert --input <gui_or_folder> --output <dir> --resolution ALL runs headless for GUI resizing; omitting args opens the converter GUI. (Implementations: Tools/KotorCLI/src/kotorcli/kit_generator.py wraps Libraries/PyKotor/src/pykotor/tools/kit.py; Tools/KotorCLI/src/kotorcli/gui_converter.py delegates to pykotor.resource.formats.gff.)
  • TSLPatcher - Original Perl mod installer (reference implementation) (Mirror: th3w1zard1/TSLPatcher)
  • HoloPatcher.NET - .NET reimplementation of TSLPatcher
  • Kotor-Patch-Manager - Alternative mod manager (Mirror: th3w1zard1/Kotor-Patch-Manager)
  • KotORModSync - Mod synchronization and installation
  • StarForge - Module editor and modding toolkit
  • KotorModTools - Collection of modding utilities (Mirror: th3w1zard1/KotorModTools)

Save Editors

Tools for editing KotOR save games:

Audio Tools

Tools for working with KotOR audio:

Community Resources

Guides, patches, and community-maintained resources:

External Documentation

Reference documentation from related projects (external sources):

  • xoreos-docs - Aurora engine format documentation repository containing file format specifications for reverse-engineering BioWare's Aurora engine games. Part of the xoreos project. The repository includes:

    • Official BioWare specifications (specs/bioware/): Official Aurora Engine file format PDFs from the now-defunct nwn.bioware.com developer site. These documents are authoritative references for formats used across Aurora engine games including KotOR.
    • Torlack's reverse-engineered specs (specs/torlack/): Tim Smith (Torlack)'s reverse-engineered format documentation from his now-defunct website (torlock.com). These include detailed field-by-field breakdowns for formats like BIF, KEY, ERF (MOD), GFF (ITP), NCS, and binary MDL files.
    • KotOR-specific documentation (specs/kotor_mdl.html): Partial KotOR model format specifications with detailed field descriptions.
    • Binary templates (templates/): 010 Editor binary template files for analyzing binary file structures (NWN1, NWN2, Jade Empire formats - NOT KotOR-specific).

    Note: Much of the KotOR-relevant content from xoreos-docs has been comprehensively integrated into this wiki. See individual format documentation pages for specific source references.

  • nwn-docs - Neverwinter Nights documentation (shares Aurora formats)

Clone this wiki locally