Flipcode - Quake 2 BSP File FormatQuake 2 BSP File Formatby (07 June 2000)IntroductionThe purpose of this document is to detail the structure of the BSP file formatused by Quake 2 to store maps; in particular, the focus is on rendering Quake 2worlds. Although there is other information contained in the BSP file used forother game elements (such as enemy AI, etc.), I don't have complete informationon them so I won't discuss these beyond mentioning them.

Quake

If you have anything tocontribute on these parts please feel free to e-mail at the address listedabove. Also, although I've tried my best to minimize errors, if you findanything that is incorrect please let me know.In addition to just a bare description of the BSP file format, this documentalso attempts explain the techniques which are at the core of the Quakerendering engine. In general it's assumed that the reader is familiar with thebasic principles of 3D graphics, including the BSP tree data structure.This document covers version 38 of the BSP file format which is the version usedby Quake 2. This is also the version of the BSP file format used by Kingpin(which was created using the Quake 2 engine) and therefore all of theinformation contained is relevant to those files as well. While Quake 1 andQuake 3: Arena use similar BSP formats the formats are not directly compatible.However, because of the similarity in the structure and techniques, thisdocument should be of some use to anyone interested in these formats as well.My information about the Quake 2 BSP format was all learned by a lot ofexperimentation in implementing my own Quake 2 BSP renderer along with examiningsource code for Quake-like engines generously released into the public domain bytheir authors. These engines were the Twister Engine by Stefano Lanza, theArnfold 2 Engine by Andrei Fortuna and the Poly Engine by Alexey Goloshubin. Thesource code for all three of these engines is freely available on the web; ifyou find something's missing out of this document, I recommend you check outthese engines.

Id Software has also released the source code for their Quake 2tools, including the QBSP map file compiler which outputs BSP files, although Ididn't find it to be particularly useful in my own exploration.LegalityUsing id Software file formats in a publicly distributed application alwaysseemed a little questionable to me in terms of legality. In preparation of thisdocument I contacted id Software to resolve the issue; John Carmack was kindenough to send along this response:'We do not legally protect the file formats, but you can't use any of thereleased tools, or tools derived from them (except the GPL'd Quake 1 tools) togenerate content for a commercial venture.

Quake 2 Mdl Converter For Sale

If you are writing everythingyourself, no problem.' ConventionsTo help make this document easier to read I've included C-syntax structures forall of the file structures (with the assumption that there no extra paddingbytes between the fields).

Gta sa japan texture minecraft. Popular files for Grand Theft Auto IVNameTypeSizeDateTotal7 dayspatch126 MB12/8/2016241.1K3Kmod4487.3 MB3/.1K1.2Kmod1819 MB9/.8K1.1Kmod4924.4 MB9/.7K550mod92.2 KB9/29/201321.4K378mod24.4 MB9/29/201396.9K354mod473.8 KB9/30/201391.4K310mod5.2 MB7/26/201476.4K253mod132.8 KB9/28/201317.9K230mod14.9 MB9/2/20185K191mod2.9 MB3/21/201468.9K159mod24.6 KB6.2K139mod461.5 MB9/28/201327.9K138mod1.6 MB1/23/201760.4K129mod266.6 KB14.2K129mod6.2 KB3/21/20149.7K106.

To simplify the notation and standardize themeaning, the abbreviations int32 and uint32 are used for signed and unsigned32-bit integers; similar abbreviations are used for 16-bit and 8-bit integers aswell. Also, the following two structures are used throughout the BSP fileformat to store vertices and vectors. U = x. uaxis.x + y. uaxis.y + z.

uaxis.z + uoffsetv = x. vaxis.x + y. vaxis.y + z. vaxis.z + voffsetMy own experience has shown that it is perfectly reasonable to generate thecoordinates in real-time rather than storing them.The texture name is stored with a path but without any extension. Typically, ifyou are loading a Quake 2 map you would append the extension 'wal' to the nameand then load it from the PAK file. If you're loading a Kingpin map you wouldappend the extension 'tga' and then load if from disk (Kingpin stires thetextures outside of the PAK file).

See the section on the WAL texture formatfor more details.Visibility LumpLeaves are grouped into clusters for the purpose of storing the visibilityinformation. This is to conserve space in the PVS since it's likely that nearbyleaves will have similar potentially visible areas. The first 4 bytes of thevisibility lump is a 32-bit unsigned integer indicating the number of clustersin the map, and after that is an array of bspvisoffset structures with thesame number of elements as there are clusters. The bspvisoffset structureformat is. Lightmapwidth = ceil(maxu / 16) - floor(minu / 16) + 1lightmapheight = ceil(maxv / 16) - floor(minv / 16) + 1For information on computing the texture coordinates for a face see the TextureInformation Lump section.WAL Image FormatQuake 2 stores textures in a proprietary 2D image format called WAL. While thisisn't actually part of the BSP file format, it's essential information forloading Quake 2 maps so I've decided to include it. Note that this doesn'tapply to Kingpin maps which use textures stored as TGA files.WAL textures are stored in a 8-bit indexed color format with a specific palettebeing used by all textures (this palette is stored in the PAK data file thatcomes with Quake 2).

Four mip-map levels are stored for each texture at sizesdecreasing by a factor of two. This is mostly for software rendering since most3D APIs will automatically generate the mip-map levels when you create atexture.

Each frame of an animated texture is stored as an individual WAL file,and the animation sequence is encoded by storing the name of the next texture inthe sequence for each frame; texture names are stored with paths and without anyextension.The format for the WAL file header is the walheader structure.

Quake 2 Mdl Converter Tool

This is an area designated for galleries of Custom.MDL Files. In, a.MDL file is the file containing the models and animations of the various entities in the game, plus the textures utilized. Essentially, this is where the cosmetic changes to models occur.MDL files control the appearance of. All 3d (2d are sprite files, or.SPR) effects and decorations can be found here, including things as simple as a torch. It is also responsible for the appearance of the various and, but not the which is treated as a.BSP file. This is because Ammo and the, and are simple boxes, which could lead to distortion effects if attempted to be made into a.MDL, and thus were treated as.BSP as those models can easily handle being textured while being boxes.This page is intended to catalog the various.MDL changes or additions out there.

This is not for new entities, all files here feature obituary/pickup message that remain unmodified and thus the illusion of it being a new thing is broken by Quake stating it is still the original entity.Note that these.MDL files may be compatible with only one port. For example, many of the 1996.MDL files were designed to run in DOS and thus might not work properly in a modern. Usually, the files will work if it is a reskin, but changes to the monster shape will result in the game crashing. Your mileage may vary; these are specifically designed for the original DOS executable.Also note that any files made prior to June of 1996 most likely will not work with Quake. Files are entirely incompatible with the final product and are thus not documented here. Instead, they can be found on the page.List.

Posted on