nwn-lib-d 1.0.0-rc2

Library & tooling for Neverwinter Nights 2 resource files

To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:


Multi-platform D library & tooling for handling Neverwinter Nights 1 & 2 resource files

nwn-lib-d codecov

GitHub license


Command-line tools

nwn-lib-d tools are a set of command-line tools for manipulating Neverwinter Nights 2 files (and some NWN1 files). They are multi-platform (usable on Windows or GNU/Linux) and do not require the game to be installed.

[Download nwn-lib-d tools](https://github.com/CromFr/nwn-lib-d/releases)

  • nwn-gff
  • Read / write GFF files (ifo, are, bic, uti, ...)
    gff:whitecheckmark::whitecheckmark:NWN binary. Generated binary file match exactly official NWN2 files (needs to be tested with NWN1)
    json:whitecheckmark::whitecheckmark:Json, compatible with Niv nwn-lib
    json_minified:whitecheckmark::whitecheckmark:Same as json but minified
  • Pros
    • Pretty fast
    • GFF nodes keeps their original ordering, making diffs very consistent
    • Automated GFF modifications (set / add / remove nodes)
  • nwn-tlk
  • Serialize TLK files to readable text.
    tlk:whitecheckmark::whitecheckmark:NWN TLK binary format
  • nwn-erf
  • Create, extract or view ERF files (hak, erf, mod, pwc) in a reproducible manner (same content => same checksum).
  • Pros
    • By default sets the ERF buildDate field to a 0 value, to create reproducible erf files.
    • Memory efficient (files are streamed, not copied into memory)
  • nwn-trn
  • TRN/TRX experimental tool:
    • trrn-export: Export the terrain mesh, textures and grass
    • trrn-import: Import a terrain mesh, textures and grass into an existing TRN/TRX file
    • watr-import: Export water mesh
    • watr-import: Import a water mesh into an existing TRN/TRX file
    • aswm-strip: Reduce walkmesh data size by removing non-walkable triangle & related data. Can reduce LZMA-compressed files to 50% of their non-stripped size (depending on the amount of unused triangles of course).
    • aswm-export-fancy: Export custom walkmesh data into a colored wavefront obj
    • aswm-export: Export walkable walkmesh into a wavefront obj
    • aswm-import: Import a wavefront obj as the walkmesh of an existing TRX file
    • bake: Bake an area (prototype, placeables and walkmesh cutters are not supported)
  • nwn-srv
  • Interact with NWN2 server:
    • Measure latency (ping)
    • Query server info and status
  • nwn-bdb
  • View/search Bioware/foxpro database content (dbf + ctx + fpt) using regular expressions.

D Library

[API reference](https://cromfr.github.io/nwn-lib-d/docs)

  • Supported files:
  • GFF (ifo, are, bic, uti, ...)
  • TLK
  • 2DA
  • TRN (trn, trx)
  • Foxpro databases (dbf + ctx + fpt)
  • DDS (limited support)
  • MDB (limited support)
  • Other features:
  • NWN2Server querying
  • Several NWScript functions re-implementations

Tips & tricks

Generate git diff from GFF & TLK files

  1. Configure Git to use the tools
  • Using git command line:
  git config --global diff.gff.textconv "$PATH_TO_NWNLIBD_TOOLS/nwn-gff -i \$1"
  git config --global diff.tlk.textconv "$PATH_TO_NWNLIBD_TOOLS/nwn-tlk -i \$1"
  • Or by editing .gitconfig:
  [diff "gff"]
    textconv = 'C:\\Program Files\\nwn-lib-d\\nwn-gff' -i $1
  [diff "tlk"]
    textconv = 'C:\\Program Files\\nwn-lib-d\\nwn-tlk' -i $1
  1. Configure your git repository to use GFF / TLK diff by creating .gitattributes file:
*.[aA][rR][eE] diff=gff
*.[gG][iI][cC] diff=gff
*.[gG][iI][tT] diff=gff

*.[dD][lL][gG] diff=gff

*.[fF][aA][cC] diff=gff
*.[iI][fF][oO] diff=gff
*.[jJ][rR][lL] diff=gff

*.[uU][lL][tT] diff=gff
*.[uU][pP][eE] diff=gff
*.[uU][tT][cC] diff=gff
*.[uU][tT][dD] diff=gff
*.[uU][tT][eE] diff=gff
*.[uU][tT][iI] diff=gff
*.[uU][tT][mM] diff=gff
*.[uU][tT][pP] diff=gff
*.[uU][tT][rR] diff=gff
*.[uU][tT][tT] diff=gff
*.[uU][tT][wW] diff=gff

*.[pP][fF][bB] diff=gff
*.[tT][lL][kK] diff=tlk



  • dmd or ldc2 (D language compiler)
  • dub (D build system)


# Build library
dub build

# Build nwn-gff tool
cd tools/nwn-gff
dub build

# Eventually you can append --build=release
dub build --build=release
  • Thibaut CHARLES (CromFr)
Sub packages:
1.1.1 2024-Jan-08
1.1.0 2023-Oct-31
1.0.6 2023-Oct-12
1.0.5 2023-Sep-09
1.0.4 2022-Nov-28
Show all 29 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 1000 downloads total

Short URL: