Working with Brushes


Geometry Brush Handling Tools
The geometry brushes are the basic map building blocks of the AnachroRadiant engine. These are the tools to make them work for you.

Creating, Moving, Resizing, and Scaling Brushes

Escape(ESC)
This is the all-purpose deselect key. Use it to back out of operations you don't want to complete or to stop working on a brush or group of brushes.

Create a New Brush(mb1+drag)
While mouse button 1 clicking over the main map window (or any open map window) drag the mouse pointer across the grid. A brush will be created that has the height of the current map grid size. If you have the "snap to grid" function set in your preferences, the brush will start and stop on gridlines. The texture will be either the default texture (if none has been selected) or the most recently used texture.

For all these functions, you will first need to select a brush in either the Map or Camera windows.

Moving Brushes(mb1+drag)
This command allows you to move brushes in any axis plane within any of the viewports. The Undo command will return the brush to its original position.

These keys move the brush around the map in discrete map grid increments.

Nudging the Brush
These keys move the brush around the map in discrete map grid increments. The movement is in terms of the selected window, not in terms of XYZ coordinates.

Resizing Brushes(mb1+drag)
Think of this as stretching or shrinking brushes. The Undo command will return the brushes to their original size.

Scale(Menu: Selection > Scale)
With Scale you can enlarge or reduce a brush, patch, or group of brushes and patches. You choose the axes to scale (X, Y, or Z) and the factor of the scale. The scaling factor can be different for each axis. Selecting this option brings up a tool window. The size of the brush or group of brushes is multiplied by the numbers in the boxes adjacent to the X, Y, or Z axes. Leave the value as 1 and no change occurs. If the value is a decimal less than one, the size of that axis shrinks. If the value is greater than 1, it grows. Hit OK to activate the scaling function with you chosen values. Undo functions with this effect.

Flipping and Rotating Brushes
A menu command and toolbar button controls each command. The six flip and rotate toolbar commands are the second grouping (from the left) on the toolbar. The rotate command for the same axis is always next to the flip command. Flipping will not change the facing on non-brush entities.

Flipping Brushes
There are three separate actions here that control flipping a brush along either X, Y, or Z-axes.

Flip X(Menu: Selection->flip->Flip X)
Flips the selected brushes along x-axis.
Flip Y(Menu: Selection->flip->flip y)
Flips the selected brushes along y-axis.
Flip Z(Menu: Selection->Flip->flip z)
Flips the selected brushes along z-axis.

Rotating Brushes
There are three separate actions here as well. They rotate selected brushes in 90 degree increments around the selected brushes X, Y, or Z axes. Both a menu command and toolbar button controls each action. The six flip and rotate toolbar commands are the second grouping (from the left) on the toolbar. The flip command for the same axis is always next to the rotate command for the same axis. The rotation will not change the facing direction on non-brush entities.

Arbitrary Rotation(Menu: Selection->Rotate->arbitary rotation )
The Rotate commands accessed from the toolbar all rotate affected map components 90 degrees; no more, no less. Arbitrary Rotation allows the user to set angles individually for the X, Y, and/or Z-axes. Enter a number value for each axis you want to rotate. Value can be positive or negative. After the values are entered, select OK. This rotates the object and closes the pop-up window. If you don't like the rotation, you can use Undo and the brush will return to its un-manipulated facing.

Free Rotate in Map Window(R)
Press the "R" key. The selected map component(s) turns lavender. The purple square at the center is the center of the selection and the axis around which it will rotate. Left Mouse clicking anywhere in the map or cam window and dragging will cause the selected brushes to rotate. SHIFT + MMB clicking on a 2D map window, will cause the axis square too relocate to the coordinates of the click. Deselecting and reselecting the component returns the center axis to its original position.

Manipulating Brushes
Manipulating brushes can be a time consuming and tedious task. But it is an essential task to even create a map.

Edges and Vertices
There are two "drag" functions that involve control points or "handles" on the brush. They allow you to fine tune the shape of your brush by manipulating edge or vertex points along the brush.

Design Note: Drag Vertices is a balky tool at best. It works well if the user is manipulating a triangular brush face, raising or lowering corners of the triangle. Work with care, it is quite easy to pull a brush out of useable (or recoverable) shape.

Snap Selection To Grid(CTRL+G)
If you are using the map grid to keep brushes in alignment, this is a great tool. Rotated brushes and brushes that have had their vertices tweaked can have vertices that no longer lie on map grid intersections. This snaps the vertices to align with the grid. Be warned that snapping to large grids may be hazardous to the health of your brush (Snap and it's gone! But that's what UNDO is for).

CSG Operations
CSG stands for "Computed Solid Geometry". The two functions, CSG Subtract and Make Hollow, calculate the removing of sections from that geometry and breaking solid brushes (not curve patches) into smaller pieces. Although they are convenient to use for some operations, they often do things that the user may not care for. These "side effects" can include breaking brushes into inconvenient parts, cutting up adjacent brushes, and creating hard to find and remove micro brushes.

Subtract(Menu: Selection->CSG->subtract) (shift+U) image022.png

When you select this, the selected brush or brushes subtract its volume from all the geometry that contacts it. The cutting brush or brushes are not removed. Region off together the brushes that will be cut and the brushes which will be used for cutting. This keeps other brushes in the map from being affected by the action.

Hollow(Menu: Selection->CSG->Hollow)
image024.pngWhen the user selects this, the sides of the highlighted brush are turned into separate brushes. The thickness of these brushes is equal to the grid size. This works best with rectangular brushes. The edges of the created brushes overlap each other. The most common use for this function is to hollow out a box for use as a room.

Merge(Menu: Selection > CSG > Merge) (ctrl+u)image026.png

When the user selects this, the highlighted brushes are turned into a single, convex brush. If the result of the merge would not create a convex brush, the following message appears in the editor console: " Cannot add a set of brushes with a concave hull."

Examples: Example "A" shows two brushes can be merged together. Example "B" shows two brushes that cannot merge.

image028.png

Clipping
If you think of this tool as being near the same as the miter box that a carpenter uses to cut wood or moldings, then you are not far from the truth. This tools allows you to cut off sections of a brush.

Placing Clip Points
Clip points are placed in the map views by two methods: (Mb1 after Clipper has been toggled on),or (CTRL+Mb2 at any time). Undo does not remove clip points, use the all escape key or untoggle the clipper to remove any placed clip points.

The figure below shows a square brush that has been "clipped" from the lower left (point 1) to the upper right (point 2). The editor creates a line between the first point and the second point. The piece to be kept when the brush is cut is always in yellow, and created in a clockwise direction from the line (assuming that the first point is the center of the "clock")

In a two-point clip (shown here), the cut occurs perpendicular (at a 90 degree angle) from the plane of the map view. Adding a third point, and adjusting its position in a different map view can change the angle of the cutting plane. This will take practice to master.

Make Detail(Menu: Selection->Make Detail) (CTRL+M)
As of 08-25-06 Detail brushes either as a content flag or used on the brush itself does not appear to work. Need to run more tests to see if detail brushes should be completly removed from AnachroRadiant.
In Quake 2, this was a surface flag. In Anachronox, it is used on the brush itself. Detail makes a brush non-structural. This means that it cannot be used to seal the hull of the map world. Don't use it for wall, floors, or ceilings. If it is used as a hull, the map will "leak" when compiled. But it can be used on things that jut out away from the walls (as long as there is a structural brush behind it).

Detail has two beneficial effects:

1. Detail brushes are less likely to cause additional cuts to occur in non-detail brushes that they touch ... thus reducing triangle counts. This can help reduce frame rate.

2. When the compiler does Vis, it breaks the world up into many small volumes. Any break in the surface of the box that forms a room creates additional volumes that must be. Detail brushes don't create these breaks. Therefore, using them speeds up compiling.

Make Structural(Menu: Selection->Make Structural) (ctrl+shift+s)
Structural is the default State for brushes. Textures that are not manipulated by shader scripts to be transparent or non-solid) do not change this. Essentially, this is a change-it-back command for Make Detail. It removes the detail flag from the brush. This surface WILL block Vis when the map is compiled (so long as there isn't shader content that says otherwise).

Grouping Brushes
You can group brushes together for easier selection or manipulation of multiple brushes. Currently the only way to group brushes together is by selecting the brushes you wish to group then selecting func->func_group entity in the entity dropdown box. More funtionality is being added to this for more ease in creating groups.

Func_Group(Entity Window->Func_Group->Enter) (Dropdown menu->Func->Func_group)
Technically, this is a b_model (brush model) entity. However, it's a great way to manage and handle related groups of map components for ease of selection. To use, select the brushes and patches you want to group and then open the Entity window (press "N"). Click on the entity list sub-window and type in "F" to move to the top of the "funcs". Double-click on Func_Group and all the brushes and patches selected are bound together into a group. Select one and you select them all.

Thumbing through Group Components(TAB)
When you have a Func_Group b_model entity selected, press the TAB key to "thumb" through the component pieces, hi-lighting them individually, one at a time. This allows you to work on part of a multi-piece group without having to work on all pieces

Ungrouping Groups(Menu: Selection->Ungroup Entity)
You can easliy disband a group by either selecting a group or a member of a group and selecting ungroup entity from the Selection menu. More functionality is to be added to this allowing you to remove a single brush or multiple brushes from a group without disbanding the whole group, unless disired.

Find Brush(Menu: Misc->Find Brush)
Find brush allows you to locate a brush in the map by its identifying number. As the map is built, the editor assigns identification numbers to each map component. For brushes (and patches) these include an Entity number and a brush number. For any brush that is not part of a brush model (b_model), the entity number is zero (0). Each b_model will have it's own number.

When the compiler outputs error messages in the console and junk.text file, an identification number will call out brushes with problems. Be prepared for them. Even when you do things right, you will get error messages.

Selecting Find brush pops up a dialogue window with two fields. The first field is the entity number. For most brushes, this will be zero. The second number is the brush's individual number. Selecting "OK," jumps the 2D map window(s) to the selected component and hi-lights it.

Brush scripts…(Menu: Edit > Brush scripts)
The command allows you to perform multiple step operations that manipulate a single selected brush. Currently, only two of the list scripts function.

BuildSpiral This walks you through the steps of building a spiral staircase. Select a brush, then click on the map to locate the spiral origin. Click again to bring up a dialogue window that prompts you to enter the number of steps, the angle of rotation, and the height of each step.
BuildStep This clones the selected brush and moves it +X 16 units and +Z 8 units.

You can create your own brush scripts by text editing the scripts.ini file located in the AnachroRadiant root directory. Instructions and a list of brush script commands are located in the file as well.

Brush Menu Commands
The Brush menu lets the mapmaker convert a selected brush into a brush of a different shape. Most of the commands change the number of sides that the brush possesses. It will also change the brush to a single color. There are individual commands for three through nine sides. The brush will be given the number of sides indicated by the command (Plus top and bottom). The "top" facing is always relative to the view in which it is created. The sides are always at right angles to the view facing.

Poly-Sided Brushes
3 sided (Menu: Brush->3 sided) (CTRL+3)
4 sided (Menu: Brush->4 sided) (CTRL+4)
5 sided (Menu: Brush->5 sided) (CTRL+5)
6 sided (Menu: Brush->6 sided) (CTRL+6)
7 sided (Menu: Brush->7 sided) (CTRL+7)
8 sided (Menu: Brush->8 sided) (CTRL+8)
9 sided (Menu: Brush->9 sided) (CTRL+9)

Arbitrary sided(Menu: Brush->Arbitrary sided)
This command opens a dialogue window that allows you to manually set the number of sides a brush has. You can enter a number of sides in the field from 3 to 64.

Primitives
Primitives are pre-made shapes other than squares or the polygonal multisided boxes made by the "number" sided brush commands.

Cone(Menu: Brush->Primitives->Cone)
This opens a pop-up dialogue window that lets you enter an arbitrary number of sides. The height of the cone is equal to the Z height of the brush. The cone is always made with its axis along the Z-axis. At first, the radius of the base of the cone appears to be unrelated, or at least unevenly related to the XY dimensions of the brush from which it is transformed. However, if you make a four sided brush, the point to point "diameter" of the resulting pyramid is equal to the longest XY dimension of the brush. Starting the same size brush as you used for the four-side cone, an eight-sided cone fits neatly within the volume of the four-sided cone, four of its sides congruent with the side planes of the four-sided cone. Do the same for a 16 sided cone, and the same again for both a 32 sided cone. However, the number of sides seems to max out at 56.

Sphere(Menu: Brush->Primitives->Sphere)
This opens a pop-up dialogue window that lets you enter an arbitrary number of sides. The maximum number of sides, which the editor seems willing to handle is 32.The diameter of the sphere, is roughly equal to the length of the longest XY side of the brush from which it is transformed. Attempts to create spheres with more faces than 32 may result in the brush disappearing and becoming infinitely tall. Use Undo to back up from this or hit backspace to discard the brush.

Efficient Brush Building Techniques
Developed from a Quake 3 World online posting by Astrocreep

Compiling a map is a necessary evil. It takes time, it ties up your processor, and in the early phases of map construction, comes up with construction errors as often as not. Nothing you can do about that … except the time thing. It is possible, through more careful construction (or perhaps reconstruction) to significantly reduce both map and bot compile times, and reduce map and .bsp file sizes (the latter being important for downloads). The following is based on reports written by Astrocreep that documents his extensive work to streamline the compile time on one of the id sample maps.

Brush Construction
It cannot be overstressed. If you want shorter compile times and small file sizes, efficient brush construction is "critical" in building your map. There is one rule that stands above all:

DO NOT OVERLAP BRUSHES AT ANYTIME.

No matter what you have to do to build your map, do not overlap brushes. Overlapping means that all or parts of two or more brushes share the same physical space. If brushes overlap, you can expect to add time to your compiling, and add size to your .map, .bsp and, .aas file sizes.

Efficient map construction means that all brushes butt up against each other, but never intersect.

Brush Counts
The sample map to be reworked on had 1,100 brushes in it. Without changing the layout or appearance of the map, Astrocreep was able to remove 110, or 10% of the total brush count.

Learn how to do more with a single brush than with multiple brushes. Evaluate your map after you complete initial construction phases on all or part of it. Pick a part of the map, look at the layout and ask yourself if you could do that with fewer brushes. In all likelihood, nine times out of 10, the answer will be yes.

If you make a structure out of three brushes (or whatever) and have the same floor height and ceiling height (in some cases heights can be different), look at it in the "top view". Can you draw a line from each vertex and not cross out side of those three brushes? If you can, then that grouping of three can become one brush instead of three.

Example: here's how the engine might look at this.

Using 3 square brushes, you have 18 faces (with a texture mapped on each side) to be calculated. This doesn't take into consideration the number of in-game triangle faces that those brushes may generate. Even if two-thirds of those faces are not being drawn, they are still being calculated by both the compile process and the bot navigation compile process.

As compared to:

Using one brush (filling the same area), you have only 6 faces to be calculated. Here, you are compiling only a third of the total geometry. It should go faster.

Efficient map construction means using fewer brushes to build the world.

Caulking
It is possible to even further reduce the number of brush faces being calculated by applying a special non-drawing, but "solid" texture called "caulk" (common/caulk) to surfaces that cannot be seen in the game. When seen in the editor, this texture is a bright garish pink. In the game, it does not draw at all. Apply caulk to any brush face that either doesn't form the "shell" of the world or can't be seen by a player during play. Doing this may not improve your map's frame rate, but since you are telling the compiler that as many as five of the six faces on a square brush don't have to be calculated, it should have some significant effects on compile times. As long as you do not have any brushes that "share" the same space, caulking brushes should help reduce compile times. However, if you use caulk on a brush that "shares" the space of another, your compile time and all file sizes will actually increase.

Astrocreep compiled the test level nearly 200 times, many of those times were when he moved just a single brush, just to see what would change. Caulking seems to help the -light phase of compiling the most.

Efficient map construction means caulking all unseen brush faces.

Miscellaneous Tips
Lights: You can further improve compile times by careful use of lights. Entity lights, especially LOTS of entity lights can reduce compile time. If you need to reduce compiling time even more look to this.

Clip brushes: Clip brushes that have more than two sides not touching another brush appear to increase compile times.

Hint brushes: Use these only if you need to resolve a vis problem. Using them can significantly add to compile times.