Reshaping Solids

From Valve Developer Community
Revision as of 13:59, 14 January 2019 by Loudslappingsounds (talk | contribs) (Carving)
Jump to: navigation, search

Once you've created a simple, textured solid, you can use Hammer's tools for refining your work. These tools include vertex manipulation, face splitting, clip planes and carving. Each of these tools lets you customize your solids by modifying the basic shapes you started with. You will find that you can achieve the same or similar effect using different tools; some are just faster and easier than others when it comes to making the precise change you are trying to make.

Vertex Manipulation

Vertex manipulation allows you to move individual vertices and edges of a solid, easily creating irregular shapes. This lets you make shapes that are impossible with plane clipping, and extremely difficult to do with carving. Vertex manipulation is also useful for modifying specific pieces of a group of objects, where resizing would interfere with other objects in the group.

Note.png Note: While Vertex Manipulation makes the creation of new complex shapes easy, it also make the creation of invalid shapes easy. Remember that concave shapes are not valid within Hammer, also you must make sure all of your faces are perfectly flat planes, if they're bent (perhaps by moving one vertex irrespective of the others) then you'll get a nice malformed solid error.
Warning.png Warning: There are some important details about the tool not shown here. See the Hammer Vertex Tool article.

Vertices and Edges

A vertex (or plural, vertices) is a corner of a solid. Moving one vertex will not effect any other vertex, but it will change the position of any edges associated with it. An edge is a point between two vertices which, when moved, will change the position of its two associated vertices, as well as their associated edges (no other vertices are effected besides the first two).

Hammer vertexedit.jpg

To edit the vertices of an object:

  1. Select the object(s) you would like to use vertex manipulation on.
  2. Select the Vertex Tool from the Map Tools Toolbar. The selected solid will turn into a wireframe image with partial shading. Vertices will be marked as white dots, and edges as yellow dots.
  3. Click on the vertices/edges you want to move. They will be highlighted in red. Note that you can move both vertices and edges.
  4. You can either drag the selected vertices or edges with the mouse, or move them in the selected 2D view using the arrow keys.
Note.png Note: You can keep selecting the Vertex Tool, or press Shift+V, to cycle through the three vertex edit modes: vertices and edges (default), vertices only, and edges only.

Face Splitting

Face splitting allows you to add additional faces to a brush. This is a useful tool when you want to add complexity to an object in your level. Simply select two opposing edges (fig. 3) (Two opposing vertices on a flat plane work as well) and press Ctrl+F. This will turn the two edges into vertices, and place a new edge between them (fig.4).

Face splitting between opposing vertices can be extremely useful for fixing previously invalid solids with non-flat faces. A quadrilateral can be split into two triangles this way, but care must be taken that the resulting brush is not concave - the two new faces must not 'dip' in the middle.

Hammer facesplitting.jpg

While no longer as important since Source's introduction of displacements, vertex manipulation involving a great deal of face splitting used to be a very powerful, efficient way of building realistic terrain for the original Half-Life engine.

Vertex Scaling

Vertex scaling allows you to select a number of vertices and change their scale in relation to each other.

To scale a set a vertices on an object:

  1. Select the object(s) you would like to scale vertices on.
  2. Select the Vertex Tool from the Map Tools Toolbar. The selected solid will turn into a wireframe image with partial shading. Vertices will be marked as white dots, and edges as yellow dots.
  3. Click on the vertices/edges you want to scale. They will be highlighted in red.
  4. Press ALT+E to enter to bring up the Scale dialog box.
  5. Alter the center of the scale operation by clicking and dragging the white circle in the center of the vertex selection.
  6. Change the Scale value to alter the selected points. You can press the up or down arrows to move in 0.1 increments, or enter a scale value directly in the text area. The scale changes will automatically be reflected on the selected object.
  7. Press the Enter or ESC key when you are done scaling to close the Scale dialog box.

Hammer vertexscaling.jpg

Clip Planes

Clip planes let you make a precise cut in a solid, dividing it into two pieces. You then have the option of keeping one or both of the resulting two solids. You may find using Clip Planes quicker and more efficient than carving or vertex manipulation.

Hammer clipplanes.jpg

  1. Select the object to be clipped. (fig. 1)
  2. Select the Clip Plane button on the Map Tools toolbar.
    Note.png Note: You can cycle through the clip modes by clicking on the clip plane button, or by pressing Shift+X (fig.2, 3, 4). You can move both points of the clip line by holding CTRL and dragging one point of it.
  3. Drag a line across the selected object. (fig. 2) This is the clip line. The part of the object to be kept will be highlighted in thick white lines.
  4. When you are satisfied with the resulting object, press Enter to perform the clip. (fig. 5, 6)

Hammer has a feature to display the size of the solid area of the clipped brush. This is useful if you're trying to clip a brush to an exact size.

Hammer clipplanes2.jpg

To toggle this on and off, have a 2D view in focus and press the "o" (lowercase) hotkey.


Do not carve. Ever. The brushes will be permanently damaged and no amount of secondary vertex manipulation or keeping geometry simple can fix it. Even orthogonal solids perfectly on the grid will still take invisible damage in the form of having been carved (DMG_CARVE). It is very bad and it will break your map in all cases, and cause leaks.

This picture shows what is wrong with carve. The picture is from 2005, so it's a tad outdated -- In this specific case, the cuts are now vertical instead of horizontal, and the 3D renderer has been updated to correct the apparent floating point precision loss that is visible on the green block. This brush would still be broken because it was carved. Rest assured, a Valve employee produced the image to the community so even Valve knows that carve is broken in 2020.
Left: carving with "damage control" (impossible as all carved brushes are inherently broken). Right: carving as done by a maniac.

Because the Make Hollow tool uses the same base code as Carve, you should never use that tool either. Instead, you should make brushes hollow by making individual brushes for each side and Vertex Manipulating them to fit perfectly. This will be difficult for anything much more complex than a basic square room, but converting some brushes into models is an option.

Decimal Loss after Reload

A brush with severe decimal-loss issues.

Some brushes may have their vertices misaligned after reloading a map. However, These misaligned vertices are purely visual. The reason for this is that Hammer does not precisely read plane data, and suffers from decimal loss and rounding errors. The misalignments can be generally ignored, as VBSP does read plane data correctly and accurately. VBSP also has functions to snap misaligned vertices (to a margin of 0.15 units) back together.

Tip.png Tip: There is a modification to Hammer available that fixes this visual decimal loss issue, see HammerPatch. This does not affect the actual VMF which will be used!