gbxmodel

The Gearbox model tag contains the marker points and render models for objects such as vehicles, scenery, and weapons among others. It is not collideable nor animated on its own, and objects may reference additional model_collision_geometry and model_animations tags. This tag supports LODs and permutations, and includes shader_model references.

Don't confuse this tag with the Xbox-only model, which Gearbox modified for the PC port. It is therefore used in all derivatives of that port, like Mac, Demo, and MCC. Unlike the Xbox version, the Gearbox model uses uncompressed vertices.

Shaders

Each part of a model can reference a different shader, like the Warthog's windscreen using a shader_transparent_glass while its body uses a shader_model. While a model can technically reference any kind of shader, referencing a shader_environment (used for BSPs) is not recommended because it renders incorrectly in Custom Edition.

Markers

Markers are simple named points with orientation attached to a model. Since they are parented by nodes, they can be animated. Markers can be used for a variety of purposes, such as attaching objects together with scripts (e.g. Pelicans carrying Warthogs), attaching widgets like antenna, or firing projectiles from in the case of weapons.

This tag only contains the marker data but other tags usually determine how they are used. However, certain marker names have special behaviour in-engine:

  • head:
    • Determines where AI look at when scripted to talk to another character.
    • Base location for the friendly indicator in multiplayer.
    • Used as a ray origin when testing if AI can see their enemy.
  • primary trigger: Where a weapon's primary trigger projectiles and effects come from. See also the projectiles use weapon origin field.
  • secondary trigger: As above, for secondary triggers (second trigger slot).
  • body
  • front: Possibly used to used to see if you're facing a device_control, if present.
  • ground point: Determines the resting point for items.
  • left hand: Used during the grenade throwing animation.
  • melee: Where melee damage comes from here. If not present, the engine picks an unknown default location.
  • hover thrusters:
    • When used on a vehicle with "alien scout" or "alien fighter" vehicle physics type, creates a dust cloud effect when the vehicle is hovering close to the ground. This can be seen at a piloted Banshee's wingtips when sitting on the ground.
    • When the vehicle physics type is "human plane", creates a similar dust effect if the marker is pointed at nearby ground. Used for the Pelican's thrusters.
  • jet thrusters: Can also be used for vehicles with "human plane" physics to create the Pelican's thruster dust effect.

Tool only includes markers from the superhigh LOD.

Regions

Regions are named sections of the model which can have multiple permutations. Region names are used by the engine to relate parts of the render model with the collision model. For example, a Flood combat form losing an arm. Some regions have special behaviour in-engine:

Regions render in the order they are stored in the tag. When naming regions, consider that they will be sorted by name when compiled into the .gbxmodel. This can be important for skyboxes and objects with multiple layers of alpha-blended transparent shaders which aren't z-culled and need a correct sorting order to be explicitly defined, assuming the object is viewed mostly from one direction.

Permutations

A permutation is a randomly selected variation of a region. They are often used to give bipeds visual variety. Some permutations have special behaviour in-engine:

Permutations are not network synchronized.

Level of detail

Low quality LODs shown for the Chief biped and Warthog. Note the reduced geometric detail.

Models can contain multiple levels of detail (LODs) which are rendered for the object depending on its on-screen size. An object which is very distant and small does not need a lot of geometric detail, so it can be rendered using a simplified mesh with fewer or simpler shaders in order to keep framerates high in busy scenes.

Halo CE supports 5 LODs whose pixel cutoffs can be configured in this tag. From best to worst quality:

  • super high
  • high
  • medium
  • low
  • super low

When rendering first person models, Halo always uses the lowest quality LOD instead of the highest. When creating FP arms or weapons create a separate FP model from your 3P model which only includes a single super high LOD.

LODs are created by using a special naming convention when compiling models with Tool.

Structure and fields

Field Type Comments
flags bitfield(32)
Flag Mask Comments
blend shared normals 0x1
parts have local nodes 0x2
ignore skinning 0x4
node list checksum i32
super high detail cutoff f32 (pixels)
high detail cutoff f32 (pixels)
medium detail cutoff f32 (pixels)
low detail cutoff f32 (pixels)
super low detail cutoff f32 (pixels)
super low detail node count u16 (nodes)
low detail node count u16 (nodes)
medium detail node count u16 (nodes)
high detail node count u16 (nodes)
super high detail node count u16 (nodes)
pad(2)
pad(8)
base map u scale f32
  • Default value: 1
base map v scale f32
  • Default value: 1
pad(116)
markers Block?
  • Internal to the tag and may be hidden in tools.
Field Type Comments
name char[32]
magic identifier i16
pad(2)
pad(16)
instances Block?
Field Type Comments
region index u8
permutation index u8
node index u8
pad(1)
translation
Point3D (3)
  • x: f32
  • y: f32
  • z: f32
rotation
Quaternion (4)
  • i: f32
  • j: f32
  • k: f32
  • w: f32
nodes Block?
  • Maximum: 255
Field Type Comments
name char[32]
next sibling node index Index (nodes)
first child node index Index (nodes)
parent node index Index (nodes)
pad(2)
default translation
Point3D (3)
  • x: f32
  • y: f32
  • z: f32
default rotation
Quaternion (4)
  • i: f32
  • j: f32
  • k: f32
  • w: f32
node distance from parent f32
pad(32)
scale f32 (little endian?)
  • Only set when the tag is compiled into a map cache.
rotation
Matrix3x3 (little endian?) (1)
  • elements (9): f32
  • Only set when the tag is compiled into a map cache.
translation
Point3D (little endian?) (3)
  • x: f32
  • y: f32
  • z: f32
  • Only set when the tag is compiled into a map cache.
regions Block?
  • Maximum: 255
Field Type Comments
name char[32]
pad(32)
permutations Block?
  • Maximum: 255
Field Type Comments
name char[32]
flags bitfield(32)
Flag Mask Comments
cannot be chosen randomly 0x1
permutation number u16 (Index endian?)
  • Only set when the tag is compiled into a map cache.
pad(2)
pad(24)
super low Index (geometries)
low Index (geometries)
medium Index (geometries)
high Index (geometries)
super high Index (geometries)
pad(2)
markers Block?
Field Type Comments
name char[32]
node index Index (nodes)
pad(2)
rotation
Quaternion (4)
  • i: f32
  • j: f32
  • k: f32
  • w: f32
translation
Point3D (3)
  • x: f32
  • y: f32
  • z: f32
pad(16)
geometries Block?
  • Maximum: 65535
Field Type Comments
flags bitfield(32)
Flag Mask Comments
unused 0x1
pad(32)
parts Block?
Field Type Comments
flags bitfield(32)
Flag Mask Comments
stripped internal 0x1
zoner 0x2
shader index Index (shaders)
prev filthy part index u8
  • Only set when the tag is compiled into a map cache.
next filthy part index u8
  • Only set when the tag is compiled into a map cache.
centroid primary node Index: u16
  • Only set when the tag is compiled into a map cache.
centroid secondary node Index: u16
  • Only set when the tag is compiled into a map cache.
centroid primary weight Fraction: f32
  • Only set when the tag is compiled into a map cache.
centroid secondary weight Fraction: f32
  • Only set when the tag is compiled into a map cache.
centroid
Point3D (3)
  • x: f32
  • y: f32
  • z: f32
uncompressed vertices Block?
  • Not included when the tag is compiled into a map cache.
Field Type Comments
position
Point3D (3)
  • x: f32
  • y: f32
  • z: f32
normal
Vector3D (3)
  • i: f32
  • j: f32
  • k: f32
binormal
Vector3D (3)
  • i: f32
  • j: f32
  • k: f32
tangent
Vector3D (3)
  • i: f32
  • j: f32
  • k: f32
texture coords
Point2D (2)
  • x: f32
  • y: f32
node0 index Index (nodes)
node1 index Index (nodes)
node0 weight f32
node1 weight f32
compressed vertices Block?
  • Not included when the tag is compiled into a map cache.
Field Type Comments
position
Point3D (3)
  • x: f32
  • y: f32
  • z: f32
normal u32
binormal u32
tangent u32
texture coordinate u i16
texture coordinate v i16
node0 index i8
node1 index i8
node0 weight u16
triangles Block?
  • Not included when the tag is compiled into a map cache.
Field Type Comments
vertex0 index Index (uncompressed vertices)
vertex1 index Index (uncompressed vertices)
vertex2 index Index (uncompressed vertices)
do not crash the game u32 (little endian?)
  • Only set when the tag is compiled into a map cache.
triangle count u32 (little endian?)
  • Only set when the tag is compiled into a map cache.
triangle offset u32 (little endian?)
  • Only set when the tag is compiled into a map cache.
triangle offset 2 u32 (little endian?)
  • Only set when the tag is compiled into a map cache.
do not screw up the model u32 (little endian?)
  • Only set when the tag is compiled into a map cache.
vertex count u32 (little endian?)
  • Only set when the tag is compiled into a map cache.
pad(4)
bullshit u32 (little endian?)
  • Only set when the tag is compiled into a map cache.
vertex offset u32
pad(1)
pad(1)
pad(1)
num nodes u8
local node indices u8 x24
shaders Block?
Field Type Comments
permutation Index: u16
pad(2)
pad(12)

This information was partially generated using Invader tag definitions.

Acknowledgements

Thanks to the following individuals for their research or contributions to this topic:

  • Fubih (Regions render order tip)
  • Kavawuvi (Invader tag definitions)
  • MosesOfEgypt (Tag structure research)