Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

Quake Map Format

From Quake Wiki

Revision as of 18:12, 26 March 2013 by Scampie (talk | contribs)

The Quake .map Format is a plain text file which contains definitions of brushes and entities to be used by QBSP and it's related compiling tools to create a .bsp file used by Quake as levels. They are generally created by level editing software.

A simple map

{
"spawnflags" "0"
"classname" "worldspawn"
"wad" "E:\q1maps\Q.wad"
{
( 256 64 16 ) ( 256 64 0 ) ( 256 0 16 ) mmetal1_2 0 0 0 1 1
( 0 0 0 ) ( 0 64 0 ) ( 0 0 16 ) mmetal1_2 0 0 0 1 1
( 64 256 16 ) ( 0 256 16 ) ( 64 256 0 ) mmetal1_2 0 0 0 1 1
( 0 0 0 ) ( 0 0 16 ) ( 64 0 0 ) mmetal1_2 0 0 0 1 1
( 64 64 0 ) ( 64 0 0 ) ( 0 64 0 ) mmetal1_2 0 0 0 1 1
( 0 0 -64 ) ( 64 0 -64 ) ( 0 64 -64 ) mmetal1_2 0 0 0 1 1
}
}
{
"spawnflags" "0"
"classname" "info_player_start"
"origin" "32 32 24"
}

This is an example of a simple map. There is a Worldspawn entity, a special entity which contains all of a map's solid geometry as well as some map properties, with a single brush defined, and an info_player_start entity.

Structure

{
entity
{
 brush (optional)
}
}

The general structure of a .map file is to contain entity objects between { }, and to nest brush objects between them.


Entity definition

{
"spawnflags" "0"
"classname" "info_player_start"
"origin" "32 32 24"
}

An entity is simply defined by it's classname, it's origin, and it's various keys. An entity may also contain a brush, if it's of a type which uses a brush.


Brush definition

{
( 256 64 16 ) ( 256 64 0 ) ( 256 0 16 ) mmetal1_2 0 0 0 1 1
( 0 0 0 ) ( 0 64 0 ) ( 0 0 16 ) mmetal1_2 0 0 0 1 1
( 64 256 16 ) ( 0 256 16 ) ( 64 256 0 ) mmetal1_2 0 0 0 1 1
( 0 0 0 ) ( 0 0 16 ) ( 64 0 0 ) mmetal1_2 0 0 0 1 1
( 64 64 0 ) ( 64 0 0 ) ( 0 64 0 ) mmetal1_2 0 0 0 1 1
( 0 0 -64 ) ( 64 0 -64 ) ( 0 64 -64 ) mmetal1_2 0 0 0 1 1
}

A brush is defined by several planes, at minimum 4, which must form a convex polyhedron. It is NOT defined by vertices, the actual vertices are determined by QBSP be determining the intersections of these planes. In the example shown here, this brush is a 6 sided cuboid. It's first plane is defined by 3 points, ( 256 64 16 ) ( 256 64 0 ) ( 256 0 16 ).

The other information supplied is the texture used by this plane. "mmetal1_2" is the name of the texture. "0 0 0 1 1" are how the texture is display, and are respectively "X offset" "Y offset" "Rotation" "X scale" and "Y scale".