Compiling Maps


Build commands
To turn a map file from editor code into game code, it must be processed or "compiled". In Quake engine gaming, this is often referred to by the name "BSP", as in "I need to BSP my map before you can play it." The word "BSP" is actually an abbreviation for "binary space partition", the type of data organization procedure John Carmack used when creating the graphic engine for "DOOM".

The primary BSP process (absp3.exe) builds the game spaces, establishes the position of entities, and builds a lighting map of the arena. Altogether, there are three distinct processes for Anachronox that can be run together or separately. The first, the bsp process (absp3.exe) establishes the data organization of the map. The second phase, the vis process(avis3.exe), builds the walls and internal spaces. The third process (RAD) lights the map, calculating brightness and shadow and the color of the light that falls on every map surface.

The size and complexity of a map and the computer's raw processing speed determine how long it will take a map to compile. Tiny one-room maps that lack detail or numerous lights will compile rapidly. As maps become larger, are broken up into more spaces and have more complex lighting, the speed of compiling drops.

Generally speaking, if you have an older, slower processor, you may want to make very small maps.

The BSP Menu
The bsp menu contains a number of compile options. The process you choose will depend on what you are doing with the map at the time you choose to compile.

The bsp menu in AnachroRadiant contains a number of compile options, which are configured in Menu: File > Project Settings->Build Commands . The process you choose will depend on what you are doing with the map at the time you choose to compile.

Default build commands
There are 4 default compile commands that come with AnachroRadiant. I have included with AnachroRadiant, 3 different versions of the RAD compiler. qrad.exe V2.01, arad.exe V1.26, and arghrad.exe V3.00T9. Arad.exe V1.26 is the original RAD compiler released with Anachronox by ION Storm. Qrad.exe V2.01 is the updated Anachronox RAD compiler by Tim Wright. Arghrad.exe V3.00T9 is the newest RAD compiler released by Tim Wright, and may not be fully supported by Anachronox.
There are 4 ways to compile:
BSP only: compiles the map only, no lighting, good for testing for leaks.
Fast: compiles the map quickly, simple lighting and a chop size of 1024.
Full: compiles everthing except extra lighting, chop size is 256
Final: Final compiles everything with extra lightng and chop size set to 64. ONLY use this when you are finished with the map! Compile times can be "excessively extremely" long.

The following information describes the default build commands for AnachriRadiant what each command is and what it does.
bsp_Fast (anoxarghrad V 2.01 (qrad.exe))
@title WARNING: AnachroRadiant map compilation in progress. Expect Major Delays. &&__QERPATH/Compiletools/absp3 -nodetail -chop 1024 $&&__QERPATH/Compiletools/avis3 -threads 1 -fast -level 0 $&&__QERPATH/Compiletools/qrad3 -threads 1 -fast -bounce 0 -chop 1024 -gamedir __Q2PATH\anoxdata\ $
Compiles map using the updated Anachronox compiler by Tim Wright in fast mode.
bsp_Fast (anoxrad V 1.26 (arad.exe))
@title WARNING: AnachroRadiant map compilation in progress. Expect Major Delays. &&__QERPATH/Compiletools/absp3 -nodetail -chop 1024 $&&__QERPATH/Compiletools/avis3 -threads 1 -fast -level 0 $&&__QERPATH/Compiletools/arad3 -chop 1024 -bounce 0 -threads 1 -fast $
Compiles map using the original IONStorm map compiler in fast mode.
bsp_Fast (arghrad V 3.00T9 (arghrad.exe))
@title WARNING: AnachroRadiant map compilation in progress. Expect Major Delays. &&__QERPATH/Compiletools/absp3 -nodetail -chop 1024 $&&__QERPATH/Compiletools/avis3 -fast -threads 1 -level 0 $&&__QERPATH/Compiletools/arghrad -threads 1 -bounce 0 -chop 1024 -gamedir __Q2PATH\anoxdata\ $
Compiles map using the newest Arghrad compiler by Tim Wright in fast mode.
bsp_Full (anoxarghrad V 2.01 (qrad.exe))
@title WARNING: AnachroRadiant map compilation in progress. Expect Major Delays. &&__QERPATH/Compiletools/absp3 -chop 256 -fulldetail $&&__QERPATH/Compiletools/avis3 -threads 1 -level 2 $&&__QERPATH/Compiletools/qrad3 -threads 1 -chop 256 -bounce 3 -gamedir __Q2PATH\anoxdata\ $
Compiles map using the updated Anachronox compiler by Tim Wright in full mode.
bsp_Full (anoxrad V 1.26 (arad.exe))
@title WARNING: AnachroRadiant map compilation in progress. Expect Major Delays. &&__QERPATH/Compiletools/absp3 -chop 256 -fulldetail $&&__QERPATH/Compiletools/avis3 -threads 1 -level 2 $&&__QERPATH/Compiletools/arad3 -threads 1 -chop 256 -bounce 3 $
Compiles map using the original IONStorm map compiler in full mode.
bsp_Full (arghrad V 3.00T9 (arghrad.exe))
@title WARNING: AnachroRadiant map compilation in progress. Expect Major Delays. &&__QERPATH/Compiletools/absp3 -chop 256 -fulldetail $&&__QERPATH/Compiletools/avis3 -threads 1 -level 2 $&&__QERPATH/Compiletools/arghrad -threads 1 -chop 256 -bounce 3 -gamedir __Q2PATH\anoxdata $
Compiles map using the newest Arghrad compiler by Tim Wright in full mode.
bsp_Final (anoxarghrad V 2.01 (qrad.exe))
@title WARNING: AnachroRadiant map compilation in progress. Expect Major Delays. &&__QERPATH/Compiletools/absp3 -chop 64 -fulldetail -draw $&&__QERPATH/Compiletools/avis3 -threads 1 -level 4 $&&__QERPATH/Compiletools/qrad3 -threads 1 -chop 64 -bounce 3 -extra -gamedir __Q2PATH\anoxdata\ $
Compiles map using the updated Anachronox compiler by Tim Wright in final mode.
bsp_Final (anoxrad V1.26 (arad3.exe))
@title WARNING: AnachroRadiant map compilation in progress. Expect Major Delays. &&__QERPATH/Compiletools/absp3 -chop 64 -fulldetail -draw $&&__QERPATH/Compiletools/avis3 -threads 1 -level 4 $&&__QERPATH/Compiletools/arad3 -extra -chop 64 -bounce 3 -threads 1 $
Compiles map using the original IONStorm map compiler in final mode.
bsp_Final (arghrad V3.00T9 (arghrad.exe))
@title WARNING: AnachroRadiant map compilation in progress. Expect Major Delays. &&__QERPATH/Compiletools/absp3 -chop 64 -draw -fulldetail $&&__QERPATH/Compiletools/avis3 -threads 1 -level 4 $&&__QERPATH/Compiletools/arghrad -threads 1 -chop 64 -bounce 3 -extra -gamedir __Q2PATH\anoxdata\ $
Compiles map using the newest Arghrad compiler by Tim Wright in final mode.
bsp_BSPOnly
@title WARNING: AnachroRadiant map compilation in progress. Expect Major Delays. &&__QERPATH/Compiletools/absp3 -chop 64 -fulldetail -draw $
Compiles just the map, no lighting. Good for checking for leaks and alignment.


Misc settings (Unsupported as of AnachroRadiant 1.6)
Use brush primitives in MAP files.
Once this is set for a map, the program converts the texture mapping to this format. Once chosen, there is no going back to the old format. Brush primitives are described in detail under the Working with Textures section.

Creating your own _BSP Build Commands
You can create your own Compile commands by adding, or changing a compile commands on the Menu: File->Project Settings->Build commands Menu.

BSP command Add/Change Box
bThe BSP Add/Change dialog box allows you to edit or add a BSP compile command. The Menu text: line is the name of your BSP compile command and MUST be preceeded by bsp_. The Command: line is a list of commands to execute. Everything listed in the Command: line is actually written to a DOS batch file then excecuted within a DOS environment box. This gives you the ability to use any DOS commands within your BSP compile command. Also there are a few special Command tokens you can use on the Command: line. All Command tokens are expanded to thier full values when the DOS batch file is written. You may combine multiple commands on the Command line by seperating each command with the '&&' Command token. This allows you to execute multiple DOS commands just by selecting a single BSP compile command.

Command tokens:
!
The exclamation mark is replaced by the contents of the rshcmd field. In the project settings dialog/
$
The full path and filename without extention of the current map
&&
The double ampersand is the command terminator (end of command)
_QERPATH
Full directory path to AnachroRadiant
_Q2PATH
Full directory path to Anachronox installation
@
Is changed to a quote(in case you need one in the command line)

Compile program command line options
Each compile program has it's own command line options you can pass to it from a BSP Compile Command. The following is a list of each programs command line options and what each one does.

WARNING: Do not use the -verbose option with any RAD compile command. An known bug causes AnachroRadiant to crash(possibly placing LFs(0x000a) in the detailed output at incorrect locations). This should be fixed with later versions of AnachroRadiant.

ABSP3.exe command line Options
-chop #
sets the subdivide size to the given float
-verboseentities
enable entity verbose mode
-leaktest
perform a leak test
-micro #
sets the micro volume to the given float
-onlyents
only compile entities don't re-bsp
-fulldetail
enables full detail
-nodetail
disables detail brushes
-nosubdiv
disables subdeviding
-nofill
 
-noprune
disables node prunes
-noopt
no optimisation
-nowater
disables water brushes
-notjunc
disables juncs
-nocsg
don't carve intersecting brushes
-noweld
disables weld
-draw
enables drawing
-log
sets verbose and logs output
-verbose
sets output in verbose (extra) mode
-glview
output a GL view
-threads #
specify # of processors

avis3.exe command line Options
-log
sets verbose and logs output to <bspfile>.vlg
-verbose
sets output in verbose (extra) mode
-fast
super-fast VIS, lowest quality
-level #
# is 0-4, 0=fastest, 4=best
-threads #
specify # of processors

arad3.exe command line Options
-maxlight #
sets the maximum light applied to any surface
-ambient #
sets the minimum light applied to all surfaces
-chop #
set the coarseness of light sampling
-extra
extra sampling, slower but better (final)
-fast
fastest, worst quality (sets -chop 1024)
-bounce #
number of surface-bounces lights make (default=1)
-log
sets verbose and logs output to <bspfile>.rlg
-verbose
sets output in verbose (extra) mode
-threads #
specify # of processors

qrad3.exe command line Options
-nostopbleed
disables fix that prevents light bleeds through walls
-nosplotchfix
disables fix that prevents "splotchy" lighting
-nocurve
disables Phong-shading
-nobmodlight
disables brush model entities emitting light
-maxlighta #
sets the maximum light applied to any surface (0-255) (default=196)
-ambienta #
sets the minimum light applied to all surfaces (0-255) (default=0)
-chopwarp #
sets the chop for light-emitting warping surfaces (default=chop)
-chopsky #
sets the chop for light-emitting sky surfaces (default=chop)
-choplight #
sets the chop for light-emitting surfaces (default=chop)
-chopcurve #
sets the chop for Phong-shaded surfaces (default=32)
-chop #
set the coarseness of radiosity sampling (default=64)
-entity #
scales brightness of point lights by # (default=1.0)
-direct #
scales brightness of surface lights by # (default=1.0)
-scale #
scales brightness of all lighting by # (default=1.0)
-bounce #
number of surface-bounces lights make (default=1)
-fast
fastest, worst quality (sets -chop 1024)
-extra
extra sampling, slower but better (final)
-threads #
specify # of processors (default=1)
-log
sets verbose and logs output to <bspfile>.rlg
-verbose
sets output in verbose (extra) mode. Bug in verbose corrupts output
-help
help text

araghrad.exe command line Options
-verbose
more detailed output
-onlybounce
only bounced light saved
-moddir $
mod pak dir. Ignore for Anachronox
-gamedir $
game pak dir. Set to Ananchronox data directory.
-game $
heritic2|quake2|kingpin. Ignore for Anachronox.
-noshadowface
shadowfaces disabled
-noshadowfilter
projected shadows not filtered
-noweightcurve
Phong calculations ignore face size
-lightwarp
calculate lighting on warp surfaces
-nonudgefix
uses old method for nudging edge samples
-noinvisfix
light bounces off nodraw faces
-noradorigin
bmodels with origin brushes not lit by radiosity
-nosplotchfix
anti-splotch fix disabled for plain face lights
-nocurve
Phong shading disabled
-nostopbleed
bleeding light correction disabled
-nobrightsurf
surface light face brightening disabled
-nobouncefix
brush model bounced light fix disabled
-nobmodlight
brush model lighting disabled
-radmin #
radiosity minimum cutoff
-stylemin #
min brightness for special lightstyles
-gamma #
gamma compensation
-maxlighta #
maximum lighting brightness
-minlighta #
minimum lighting brightness
-ambienta #
global ambient brightness
-saturation #
colored light saturation
-nocoloru
lighting converted to greyscale, unweighted
-nocolor
lighting converted to greyscale, RGB weighted
-nopvs
stop pvs checking
-glview
 
-oldtexscale
old texture brightening method
-texscale #
texture brightness scale
-entity #
entity lighting brightness scale
-direct #
surface lighting brightness scale
-scale #
lighting brightness scale
-chopcurve #
curve surface patch size
-choplight #
normal light patch size
-chopwarp #
warping patch size
-chopsky #
sky patch size
-chop #
surface patch size
-threads #
multiple CPU processes
-update
only update existing lightmaps
-extra
extra quality light sampling
-bounce #
radiosity bounces
-dump
patch info dump
-argh
display argh! emblem
-help
displays commandline list

 

novis - Only the bsp function is performed. Checks for map leaks. No light information is created, so the map is seen at "fullbright". Because there are no shadows to get in the way, this mode is also good for looking for overlapping brushes, and texture misalignment.
fastvis - Performs a bsp and a quick version of the vis process. The entire world is made into a single bsp partition. It's fast, but when you look in a particular direction, you see every single detail in that direction. Nothing is blocked. A light map is created. This mode was used for space maps.
fullvis - the world is subdivided and broken up into smaller chunks so you can see only what is logically in your view. A light map is created. This is what is used to check polygon-in-view counts. Combined with light extra, it is the final compile for all maps.
entities only - When you add or subtract non-brush model entities from a map, use this compiler. It's very quick. If you change the brush components of a brush model entity (like a trigger or a door), you must do a compile that includes a vis stage (fast or full). If you are only changing the properties, an entities-only will do. However,, if a brush model entity also has a md3 model component, the map must be at least fastvis'd for that entity to appear in the map.
relight - Use only if no geometry (or light emitting textures) have been changed. It will rebuild the light map with the new information.
(nocurves) - This function is always a modifier to another bsp command. It does (or doesn't do) what it says. The map is compiled without curves.
(nowater) - This function is always a modifier to another bsp command. The map is compiled without water, lava, or slime.
(no light) - This function is always a modifier to another bsp command. No light map is generated. A fast way to check polycounts. Most often used in conjunction with the novis bsp command.
(-light extra) - This function is always a modifier to another bsp command. A finer degree of subdivision is used to create a more detailed light map. This is generally only done when the lighting is going through a final fine-tuning because it takes a long time. Instead of being calculated in 16 unit increments, the light is calculated in 8 unit increments. This has no effect on final map size, only on the time needed to compile.