Skip to content

Field File Section 3: Model Loader

Niema Moshiri edited this page May 14, 2019 · 1 revision

The Model Loader contains model and animation information. This wiki is a useful reference for the Model Loader section.

4 bytes: Section Length

  • This is a 4-byte unsigned integer denoting the total length (in bytes) of this section

Section Header

2 bytes: Blank

  • This is always just <NULL><NULL> (i.e., 0x0 0x0)

2 bytes: Number of Models

  • This is a 2-byte unsigned integer denoting the number of models

2 bytes: Scale

Model Data

For each model (see Number of Models):

2 bytes: Size of Model Name String

  • This is a 2-byte unsigned integer denoting the size of the model's name string

Model Name

  • This is a variable-length string (see Size of Model Name String) denoting the name of this model
  • There do not seem to be any <NULL> bytes padding it: its length is exact.

2 bytes: Unknown Attribute

  • This is a 2-byte unsigned integer denoting an attribute of this model that has unknown use
  • It seems to sometimes be 0 if the model is playable, 1 otherwise.

8 bytes: HRC Name

  • This is an 8-byte string denoting this model's HRC file
  • It does not seem to be padded with any <NULL> bytes: it seems like all HRC filenames are exactly 8 bytes

4 bytes: Model Scale

  • This is the string representation of a number (e.g. the number 1234 is represented as the string "1234")
  • This is a "left-aligned" string: strings shorter than 8 characters (i.e., numbers with fewer than 4 digits) are right-padded with <NULL> (i.e., 0x0)

2 bytes: Number of Animations

  • This is a 2-byte unsigned integer denoting the number of animations for this model

3 bytes: Light 1 Color

  • This is three 1-byte unsigned integers representing a color (RGB)

6 bytes: Light 1 Coordinates

  • This is three 2-byte signed integers representing coordinates (x, y, z)

3 bytes: Light 2 Color

  • This is three 1-byte unsigned integers representing a color (RGB)

6 bytes: Light 2 Coordinates

  • This is three 2-byte signed integers representing coordinates (x, y, z)

3 bytes: Light 3 Color

  • This is three 1-byte unsigned integers representing a color (RGB)

6 bytes: Light 3 Coordinates

  • This is three 2-byte signed integers representing coordinates (x, y, z)

3 bytes: Global Light Color

  • This is three 1-byte unsigned integers representing a color (RGB)

Animations

For each animation (see Number of Animations):

2 bytes: Size of Animation Name String

  • This is a 2-byte unsigned integer denoting the size of the animation's name string

Animation Name

  • This is a variable-length string (see Size of Animation Name String) denoting the name of this animation
  • There do not seem to be any <NULL> bytes padding it: its length is exact.

2 Bytes: Unknown Attribute

  • This is some attribute with unknown use
  • It seems like the first byte varies and the second byte is always 0x0, so perhaps it's an unsigned 2-byte integer?