Map - Version 510
From NFBSP
Contents |
General
There are two data types in this file, Entities and Brushes. A Brush is always contained in an Entity, even those brushes which belong to the world. Both of these are enclosed in their own set of curly braces { and }.
World Entity
The World Entity is always the first entity, and contains all the map properties information and world brushes. The world entity is essentially one giant brush-based entity.
Example:
{
"classname" "worldspawn"
"mapversion" "510"
"skydome" "sky_dome_romania"
"skycloudlow" "sky_lower_afghanistan"
"skyterrain" "sky_terrain_afghanistan"
"skycloudlow_speed" "0.025 -0.0019"
"skycloudlow_height" "2000"
"skycloudhigh_speed" "0.035 0.0029"
"skycloudhigh_height" "1500"
"sounds" "1"
"MaxRange" "2986"
"skycloudlow_lightning" "1"
"skycloudhigh_lightning" "1"
"skycloudhigh" "none"
"defaultctf" "1"
{
...(Brushes)...
}
}
Entity
Entities form the functional parts of the map file. Brush-based entities contain brushes which are to be manipulated by the entity, while point-based entities are usually self-sufficient. All entities have a 'classname' attribute which determines their type.
Point-based Entities
All point-based entities have an 'origin' attribute, which is the position of the entity on the 3 axes of the world graph. If 'origin' does not exist then the entity is automatically placed at (0,0,0).
Another common attribute is 'angles,' which determines the pitch, yaw and roll of the entity, or in other words its rotation on each of the axes.
Example:
...
{
"classname" "info_player_deathmatch"
"angles" "0 0 0"
"origin" "-545 -313 -366"
...(other attributes)...
}
...
Brush-based Entities
Brush-based entities contain the entity information as well as one or more brushes (which are described in more detail in the brushes section). This type of entity usually has no 'origin' attribute as its position is dictated by that of the brushes (though one may be used to move it post-compile). However, it may have an 'angles' attribute to describe rotation of the brushes about the center of the brush group or that of an Origin Brush.
Example:
...
{
"classname" "func_button"
"speed" "5"
"wait" "5"
"zhlt_lightflags" "2"
"Spawnflags" "33"
"target" "MyTargetEntity"
{
...(Brushes)...
}
}
...
Brush
Brushes form the main visual part of the map file and are essentially solid objects described in terms of Planes but also require a texture, material and other face-specific visual information. Brushes are made up of many planes which act as sides, and when planes intersect each other they define an edge of the brush and the boundary of the face.
- Brushes - Visible objects defined in this file structure.
- Sides - Have 3 vertices (3D points) which define an infinitely-extending face. In this file format there is always 1 plane per line.
- Vertices - Are used in sets of 3 to define a plane, this file format requires that vertex coordinates be enclosed within ( ) brackets.
Example vertex:
( XCoord YCoord ZCoord )
Side(s):
| Name | Datatype | Comments |
|---|---|---|
| Plane A | float3 | First vertex used to define the plane. |
| Plane B | float3 | Second vertex used to define the plane. |
| Plane C | float3 | Third vertex used to define the plane. |
| Texture Name | string | Texture used on the plane. |
| Texture S X | float | X-component of the S vector. |
| Texture S Y | float | Y-component of the S vector. |
| Texture S Z | float | Z-component of the S vector. |
| Texture S Shift | float | Texture shift along the S vector. |
| Texture T X | float | X-component of the T vector. |
| Texture T Y | float | Y-component of the T vector. |
| Texture V Z | float | Z-component of the T vector. |
| Texture T Shift | float | Texture shift along the T vector. |
| Texture Rotation | float | Rotates the texture. Obsolete in Version 510 (updates S and T instead, forcing value to 0). |
| Texture Scale Width | float | X-axis texture scale. |
| Texture Scale Height | float | Y-axis texture scale. |
| Surface Flags | SurfaceFlags | Adds a NODRAW, KEEP, NODECALS, and/or NOIMPACTS attribute to the surface. |
| Material Name | string | Material effect applied to the face. |
| Lightmap Scale | float | Lightmap scale (possibly disgarded on compile). |
| Lightmap Rotation | float | Lightmap rotation (possibly disgarded on compile). |
The texture application plane and shifts are together in two sets of square brackets, one for each axis. The vectors must be perpendicular (their dot product must be zero), and the length of the vector component (first 3 values in each set of brackets) determines the texture scale along that vector.
Example:
... [ -1 0 0 32 ] [ 0 0 -1 -48 ] ...
The Lightmap information is also enclosed in square brackets.
Example:
... [ 16 0 ]
Altogether, several of these planes are put together to form a single brush.
Example:
...
{
( 648.000000 -767.000000 -350.000000 ) ( 644.000000 -767.000000 -350.000000 ) ( 644.000000 -768.000000 -350.000000 ) texdir/mytex [ -1 0 0 32 ] [ 0 -1 0 -64 ] 0 0.125 0.015625 0 wld_lightmap [ 16 0 ]
( 644.000000 -767.000000 -342.000000 ) ( 648.000000 -767.000000 -342.000000 ) ( 648.000000 -768.000000 -342.000000 ) texdir/mytex [ 1 0 0 -32 ] [ 0 -1 0 -64 ] 0 0.125 0.015625 0 wld_lightmap [ 16 0 ]
( 644.000000 -767.000000 -350.000000 ) ( 648.000000 -767.000000 -350.000000 ) ( 648.000000 -767.000000 -342.000000 ) texdir/mytex [ -1 0 0 32 ] [ 0 0 -1 -48 ] 0 0.125 0.125 0 wld_lightmap [ 16 0 ]
( 648.000000 -767.000000 -350.000000 ) ( 648.000000 -768.000000 -350.000000 ) ( 648.000000 -768.000000 -342.000000 ) texdir/mytex [ -0.707107 0.707107 0 0.932739 ] [ 0 0 -1 -48 ] 0 0.0220966 0.125 0 wld_lightmap [ 16 0 ]
( 648.000000 -768.000000 -350.000000 ) ( 644.000000 -768.000000 -350.000000 ) ( 644.000000 -768.000000 -342.000000 ) texdir/mytex [ 1 0 0 -32 ] [ 0 0 -1 -48 ] 0 0.125 0.125 0 wld_lightmap [ 16 0 ]
( 644.000000 -768.000000 -350.000000 ) ( 644.000000 -767.000000 -350.000000 ) ( 644.000000 -767.000000 -342.000000 ) texdir/mytex [ -0.707107 -0.707107 0 0.00500488 ] [ 0 0 -1 -48 ] 0 0.0220971 0.125 0 wld_lightmap [ 16 0 ]
}
...
When contained in an entity, the is brush simply inserted in the entity information.
Example:
...
{
"classname" "func_button"
"speed" "5"
"wait" "5"
"zhlt_lightflags" "2"
"Spawnflags" "33"
"target" "MyTargetEntity"
{
( 648.000000 -767.000000 -350.000000 ) ( 644.000000 -767.000000 -350.000000 ) ( 644.000000 -768.000000 -350.000000 ) texdir/mytex [ -1 0 0 32 ] [ 0 -1 0 -64 ] 0 0.125 0.015625 0 wld_lightmap [ 16 0 ]
( 644.000000 -767.000000 -342.000000 ) ( 648.000000 -767.000000 -342.000000 ) ( 648.000000 -768.000000 -342.000000 ) texdir/mytex [ 1 0 0 -32 ] [ 0 -1 0 -64 ] 0 0.125 0.015625 0 wld_lightmap [ 16 0 ]
( 644.000000 -767.000000 -350.000000 ) ( 648.000000 -767.000000 -350.000000 ) ( 648.000000 -767.000000 -342.000000 ) texdir/mytex [ -1 0 0 32 ] [ 0 0 -1 -48 ] 0 0.125 0.125 0 wld_lightmap [ 16 0 ]
( 648.000000 -767.000000 -350.000000 ) ( 648.000000 -768.000000 -350.000000 ) ( 648.000000 -768.000000 -342.000000 ) texdir/mytex [ -0.707107 0.707107 0 0.932739 ] [ 0 0 -1 -48 ] 0 0.0220966 0.125 0 wld_lightmap [ 16 0 ]
( 648.000000 -768.000000 -350.000000 ) ( 644.000000 -768.000000 -350.000000 ) ( 644.000000 -768.000000 -342.000000 ) texdir/mytex [ 1 0 0 -32 ] [ 0 0 -1 -48 ] 0 0.125 0.125 0 wld_lightmap [ 16 0 ]
( 644.000000 -768.000000 -350.000000 ) ( 644.000000 -767.000000 -350.000000 ) ( 644.000000 -767.000000 -342.000000 ) texdir/mytex [ -0.707107 -0.707107 0 0.00500488 ] [ 0 0 -1 -48 ] 0 0.0220971 0.125 0 wld_lightmap [ 16 0 ]
}
}
...
Note how both the entity and the brush have their own set of curly braces { and } and the brush is nested within the entity, including its own curly braces.
