Bsp file structure
docs/bspfilestructure
Last updated by F1F7Y on 2022-11-7
Respawn .bsp files are split into 128 lumps but only about half of them are used by a game.
All lumps are referenced by the header which holds their absolute offset, length and version.
struct Lump_t {
uint32_t offset;
uint32_t length;
uint32_t version;
uint32_t unused;
};
// Always at the begining of the file
struct Header_t {
char magic[4]; // "rBSP"
uint32_t version; // Dependent on game
uint32_t mapVersion;
uint32_t maxLump; // Always 127
Lump_t lumps[128];
};
uint32_t offset;
uint32_t length;
uint32_t version;
uint32_t unused;
};
// Always at the begining of the file
struct Header_t {
char magic[4]; // "rBSP"
uint32_t version; // Dependent on game
uint32_t mapVersion;
uint32_t maxLump; // Always 127
Lump_t lumps[128];
};