Skip to content

Etymology: Lump Names & Iteration on the `.bsp` Format

Jared Ketterer edited this page Dec 10, 2022 · 2 revisions

Each iteration on the .bsp format has often used it's own naming conventions.
However, bsp_tool attempts to unify understanding of how each format builds on those that came before.
As a result, naming conventions within bsp_tool do not always line up with source code, where it is available.

Branch Scripts

When branch scripts import the structure mappings (BASIC_LUMP_CLASSES, LUMP_CLASSES & SPECIAL_LUMP_CLASSES), they are matched by lump name
This is why lump names vary somewhat from source code, since it makes inheritance easier
Keeping concepts, systems & lump connections clear between different implementations is a huge bonus

Lump Name Etymology

NOTE: some of these terms are either broader than their initial name, or may overlap with other systems

First name bsp_tool name Description / Use / Context
MARKSURFACES LEAF_FACES indices into FACES; (start, len) indexed by LEAVES
SURFACES FACES rendered groups of triangles, somewhat tied to VIS
FOGS EFFECTS Quake 3 applied fog to surfaces w/ vertex colour

Other

The following lump are all tied to textures & loading them in-memory:

  • MIP_TEXTURES: Quake
    A small .wad, storing all textures directly in the .bsp (uses Quake Palette)
  • MIP_TEXTURES: Half-Life
    Similar to Quake, but each texture comes with it's own palette
  • TEXTURES: Quake 3 & Derivatives
    Stores texture path (in external files) & Surface + Contents flags
  • TEXTURE_INFO, TEXTURE_DATA, TEXTURE_DATA_STRING_DATA & SURFACE_NAMES: Source Engine & Derivatives
    Texture vector, view sizes & names; level of detail / complexity varies with each implementation
  • MESHES: Titanfall Engines
    Built on FACES but quickly skews toward Quake 3 & Call of Duty mesh-based rendered geo (triangle soup)
    Source faces already used triangles occasionally, but only to fix up T-Junctions
    Titanfall Engine maps skew much more mesh based with each iteration, Apex Legends even splits VIS with static props

NOTE: TEXTURE_INFO has been around since Quake
NOTE: MIP_TEXTURES in GoldSrc don't pack textures, they just give texture names to index the .wad

LumpClass member names

When naming LumpClass members, try to communicate use as efficiently as possible, utilising context (e.g. Plane.type > Plane.plane_type)
For (start, len) type indices into other lumps, use the following naming convention:

struct LumpA(base.MappedArray):  # LUMP ?
    first_lump_b: int  # index of the first LumpB in this LumpA
    num_lump_bs: int  # number of LumpBs in this LumpA after first_lump_b

For single indices, use the lump name & communicate purpose and/or origin:

struct LumpB(base.MappedArray):  # LUMP ?
    lump_c: int  # index of LumpC this LumpB is aimed at