Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The TRN file format is quite similar to MDB format.

Source: https://neverwintervault.org/project/nwn2/other/trn-fileformat

Header struct (12 bytes)

TypeNameDescription
char[4]file_typeAlways NWN2
uint16_tversion_major
uint16_tversion_minor
uint32_tpacket_countNumber of packets

PacketKeyTable struct (8 bytes)

TypeNameDescription
char[4]typePacket type name
uint32_toffsetByte offset of the packet from the beginning of the file

Packet struct (variable length)

TypeNameDescription
char[4]typePacket type name
uint32_tsizePacket data size in bytes
uint8_t[size]dataPacket data

Each packet contains different data depending on their type

Packet types

There are 4 types of packets:

  • TRWH: Terrain Width Height info
  • TRRN: Terrain geometry info
  • ASWM: Walkmesh geometry & pathfinding data
  • WATR: Water geometry info

Source: https://neverwintervault.org/project/nwn2/other/trn-fileformat