Export to *.bsp
Previous  Next

Compiling Map Files

To make your map ready to run in a game, it must first be compiled. Compiling a map requires three steps in the following order:

QBSP - This creates the initial .bsp file and determines the map's geometry and structure. The output from this program can be run in Quake, but it will be fullbright and not optimized.

LIGHT / RAD - This program builds lightmaps for each brush face in your map. Light placement in your map, and even the options you specify to the light program can have a major effect on output of your level.

VIS - This program determines visibility in your level and tries to reduce the number of polygons that need to be rendered in game. Before releasing a map to the public, it is a good idea to VIS it with the highest quality setting possible. It is not uncommon that a high quality VIS pass will take hours or even days to complete.

There are a number of different versions of these programs made by various people, each one offering different features. Because of this, I can't list the available options for each program. Instead, read the readme file or run the program in a command window without arguments to see which options are provided.

Build Errors

Unfortunately, build errors are generally pretty vague or useless. If you can't make sense of the error, here are some things you can try:

QBSP errors are generally attributed to invalid entities or invalid texture settings. Make sure your map contains an info_player_start. For Quake 1, make sure your .wad files are specified in the worldspawn entity.

LIGHT - Try reducing or moving lights in your map. Try lowering the quality argument passed to Light.

VIS - Make sure your map has no leaks. Try reducing complexity of brushes.


Leaks are bad, mmmkay. If you get them, FIX THEM! Do not ignore them. A leak means there is an error in the architecture of your map. Leaks will prevent you from VIS'ing your level, which you MUST do before releasing a final version.

Leak files can be loaded in BSP from the File->Leak Check menu. When a leak file is loaded, it will draw a series of lines (or dots) through where it found a leak. This line will be visible in the 2D and 3D windows. If you cannot find the line, try hiding all groups.

Note about "boxing" your map: boxing is when you create a huge box around the perimeter of your map to seal leaks. This is BAD, please do not do it. It is not only bad design but it will increase build times and r_speeds. Just fix your leaks! :)

Batch File Basics

Note: The current directory where Exporter batch files start is set in the map_directory game option.

Batch files are simply a set of saved commands that get processed in a command window. Batch files are saved with the extension ".bat" and can be edited in notepad. Right-clicking a batch file in Windows Explorer should give you the option "Edit" which will open the file in notepad.

Testing input in a console window is a good way to get familiar with batch commands. To open a console window, go to your Start menu, select "Run" and in the box type "cmd" and press enter.

Common batch commands:

c:                 - change to letter C drive
cd quake           - change the directory to a subdir named "quake"
cd ..              - change up a directory
dir                - list contents of the current directory
[appname]          - execute a program named [appname]
pause              - wait for a keypress before continuing
notepad filename   - edit a file in notepad

When creating a batch file, it is important to know where your current directory is. The current directory starts where the batch is run from, but can be changed using the command cd [directory] . Here is an example of how to run quake from a batch file:

cd c:\quake
quake +map test.bsp

The directory name ".." is a special name meaning "up one directory". It can be used as a shortcut to navigate through your directories. For example, when batch files run from BSP, they will generally start with a current directory such as "bsp\game_dir\bat". If your maps are saved in "bsp\game_dir\maps", you can access this directory by specifying simply "..\maps".

The token value "%1" is a special value for batch files. It is the placeholder for parameters passed to the batch. When BSP executes a batch file, it passes the name of the map as the first parameter, thus %1 can be used to make a generic batch file that can process any map file.

This is the batch file I use to compile my Quake maps:

qbsp %1
tyrlite %1
rvis -fast %1
copy %1.bsp c:\quake\ID1\maps
cd \quake
fuhquake-gl.exe -cheats +map %1

The "pause" command is very important to have in your build scripts. Without it, build errors can go unnoticed and the command window will close automatically. Pausing provides a chance to read the build output. Also, it is pointless to run your map when it doesn't build, so you can simply close the command window and not bother running the game.