Basic Construction: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Nevermind. Fixed the pictures.)
m (Nesciuse moved page Basic Construction/en to Basic Construction without leaving a redirect: Move en subpage to basepage)
 
(68 intermediate revisions by 32 users not shown)
Line 1: Line 1:
[[Category:Level Design Tutorials]]
{{LanguageBar}}
 
{{first room menu}}
{{first room menu}}


=View Navigation=
Simple 3D solids (cubes, cylinders, etc.) are referred to as [[brush]]es inside the Hammer editor. These objects are the basic building blocks for all maps built for Source.
 
To get a proper 3D perspective of your work, you will need to control setting its view.
 
This can be done in two ways: You can either use the keyboard to navigate through your map, or you can rig up cameras.
 
==Keyboard Navigation==
Keyboard navigation will let you fly freely through the map. You will not collide with anything while doing this. Just make sure not to stray too far from your work, or you might not find your way back to it again.
 
The controls are simple: The W, A, S and D keys works like the default in-game steering, moving your position up, left, down and right, while the arrow keys will steer the direction you're facing.
 
As you haven't created any brushes yet, you can use the maps origin mark for something to move around.
 
==Creating a Camera==
[[Image:hammer_camera.jpg |thumb|left|100px| Select the Camera Tool.]]
[[Image:Hammer_top2dview2.jpg |thumb|right|400px| Create a camera by dragging its position.]]
 
To set up a camera, select the ''Camera Tool'' icon from the left side of the Hammer window. Then click and drag your mouse in a 2D view to create the Camera, as shown to the right.
 
The 3D view will change to the new camera, and the 2D windows will display blue circle with a line leading from it, which is your camera.
 
You can change the position of the camera by dragging this blue circle around, and where it will point by dragging the other end of the line around.
<br style="clear:both">
==Magnify==
 
[[Image:hammer_magnifytool.jpg|thumb|left|100px]]
 
You can use the ''Magnify Tool'' to zoom in and zoom out of the 2D viewports. First select the ''Magnify Tool'' from the icon bar. Now left-click in a 2D viewport to increase the magnification, and right-click to zoom back out.
 
If your mouse is equipped with a mouse wheel, you can use it instead to change the zoom level in all of the viewports: Forward will zoom in and backwards will zoom out.
 
<br style="clear:both">
=Basic Construction=
 
You are now ready to create the most basic geometry: The [[brush]] object. Brushes are the basic building block for all maps built in the Source engine. Floors, walls and ceilings, and all geometry that aren't models, consists of brushes.
 
==Creating a brush==
[[Image:hammer_blocktool.jpg |thumb|left|100px| Select the Block Tool.]]
[[Image:hammer_top2dview1.jpg |thumb|right|400px| Clicking and dragging to create a brush.]]
 
To build your first brush, select the white box from the list of icons on the left side of the Hammer window by clicking on it. This is the ''Block Tool''.
 
Specify the size of your brush by clicking and dragging your mouse in the Top 2D View (the upper-right window pane) to create a box, as shown to the right.


Now that you've set the shape and size of the brush, you can create it by pressing your <Return> key. You can also do this by clicking your right mouse-button inside the brush to open its menu. As it is not yet created, there is only one choice in it at the moment: "Create Object". Left-click this choice to create the brush.
Floors, walls and ceilings—in short all geometry other than [[model]]s—consist of brushes.
<br style="clear:left">
[[Image:hammer_createobject.jpg |thumb|left|400px| Creating the brush object.]]


The brush you just created has been textured with a default texture in the 3D window, but as this probably is the first time that you're using Hammer, you'll need to change your view to see these textures. Click on the 3D window to select it, then go to the ''View'' menu and choose ''3D Textured Polygons'' (or ''3D Shaded Textured Polygons'' for even fancier results).
== Creating brushes ==
#Select the {{hammer block}}.
#Specify the size of your brush by clicking and dragging your mouse in the Top 2D View (the upper-right window pane by default) to create a box, as shown in Figure 2.
#Create the object by pressing {{key|Enter}}. Alternatively, right-click inside the brush and choose '''Create Object'''.


<br style="clear:both">
{{tip|If your object does not appear textured already, click on the Camera view and go to '''View''' > '''3D Textured Polygons''' to view a textured version of your object.}}


==Selecting brushes==
{|
| [[File:Hammer blocktool.png|thumb|left|300px| '''Fig. 1''' The Block Tool.]]
| [[File:Hammer top2dview1.png|thumb|left|380px| '''Fig. 2''' Clicking and dragging to create a brush.]]
|}


[[Image:hammer_selectiontool.jpg |thumb|left|100px| Select the Selection Tool.]]
== Selecting brushes ==
[[File:hammer_selectiontool.png|thumb|left|300px|link=Hammer Selection Tool|The Selection Tool.]]


Select the red arrow on top of the list of icons. This is the ''Selection Tool''. It is used to select different objects in the map. With the ''Selection Tool'' selected, select your brush by clicking on it in one of the windows. (In the 2D windows you will need to click on the edges or center of the brush. It is easier to select a brush on the 3D window.)
Click on the {{hammer select}}. It is used to isolate an object or group of objects you wish to manipulate. With the '''Selection Tool''' active, highlight your brush by clicking on it in one of the windows. (In a 2D window click on the edges or center of the brush. In the Camera view, click anywhere on the object.)


You will notice that the selected brush will be marked red, and get eight little white square handles in the 2D panes.
You will notice that the selected brush will be highlighted with red and will get eight little white square handles in the 2D views. These handles allow you to rotate and transform the selection ([[#Resize,_Rotate,_& Skew|see below]]).


<br style="clear:both">
Note that the brush looks like a 3D wireframe box. Flatten the box so that it looks like a thin slab and move it so that the camera is above it. Think of the brush as a 3D chunk of ceiling or floor or wall, not a room all by itself. It takes 6 brushes to make a room.


==Resizing brushes==
{{tip|Hold {{key|Ctrl}} to select multiple objects.}}


[[Image:hammer_brushheightediting.jpg|thumb|400px| Changing the height of the brush.]]
{{clr}}


Now we'll increase the height of the brush we've made.
== The Grid ==
(Need to set the grid first.)
A grid is displayed in all the 2D views. By default, all objects snap to the grid. Although you can turn this off by pressing {{key|Shift|W}}, it is considered good practice to leave it on because it prevents [[leak]]s and other errors in your map.


Click and drag the square edge handle in the Side 2D View (the lower-right window pane).
The default grid size is 64 units, which means that each line is 64 units apart. You can change the grid size by:


The cursor should change to the move handle cursor when you have the correct handle.
* Pressing {{key|[}} or {{key|Alt|A}} or clicking the '''Smaller Grid''' icon [[File:hammer_SmallerGrid.png|link=]]. This will make the grid half as small as before, allowing finer adjustments.
* Pressing {{key|]}} or {{key|Alt|S}} or clicking the '''Larger Grid''' icon [[File:hammer_LargerGrid.png|link=]]. This will make the grid twice as big, for larger adjustments.


Drag the height so that it is 128, as shown in this image. If you make a mistake, simply grab the handle and try again.
To help determine the appropriate scales needed for a playable map, please see the article on [[Dimensions]].


<br style="clear:both">
== Resize, Rotate, & Skew ==
{{important|All three of the following operations ''can'' cause vertices to land '''off grid''' which normally is to be avoided, especially for [[world brush]]es. Resizing and skewing single axis-aligned cuboids for example is never problematic whereas rotating any brush by any angle other than 0, 90, 180, ... degrees always results in vertices off grid. Sometimes the {{hammer vertex}} is what you are actually looking for.}}
==== Resize ====
:Scales the selection. Select a brush using the {{hammer select}} and mouse over one of its eight white handles. The cursor should change to arrows, indicating along which axis you can move that handle. To resize, simply click and drag one of these handles.
:{|
| [[File:Hammer resize1.png|frame|none|White squares on each corner mean the brush can be resized.]]
| [[File:Hammer resize2.png|frame|none|Click and drag the edge up or down in any 2D view to resize.]]
|}
==== Rotate ====
:Spins the selection. Select the object you wish to rotate using the {{hammer select}}, then click on the object once again. You should see the squares surrounding the object at the corners turn into circles.
:{|
| [[File:Hammer rotate1.png|frame|none|Circles on each corner mean the brush can be rotated.]]
| [[File:Hammer rotate2.png|frame|none|Click and drag in a circle in any 2D view to rotate.]]
|}
==== Skew ====
:Distorts the selection along an axis. Select the object you wish to skew using the {{hammer select}}, then click twice on the object. You should see small white squares at the center of each edge of the object.
:{|
| [[File:Hammer skew1.png|frame|none|White squares at the center of each edge mean the brush can be skewed.]]
| [[File:Hammer skew2.png|frame|none|Click & drag a white square in any 2D view to skew.]]
|}


Now onto [[Creating a Room]]!
{{Navbar|View Navigation|Your First Map|Creating a Room}}
[[Category:Level Design]]
[[Category:Tutorials]]

Latest revision as of 05:06, 12 July 2024

English (en)Deutsch (de)Français (fr)Magyar (hu)日本語 (ja)한국어 (ko)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)中文 (zh)Translate (Translate)

Simple 3D solids (cubes, cylinders, etc.) are referred to as brushes inside the Hammer editor. These objects are the basic building blocks for all maps built for Source.

Floors, walls and ceilings—in short all geometry other than models—consist of brushes.

Creating brushes

  1. Select the Block tool Hammer block.png.
  2. Specify the size of your brush by clicking and dragging your mouse in the Top 2D View (the upper-right window pane by default) to create a box, as shown in Figure 2.
  3. Create the object by pressing Enter. Alternatively, right-click inside the brush and choose Create Object.
Tip.pngTip:If your object does not appear textured already, click on the Camera view and go to View > 3D Textured Polygons to view a textured version of your object.
Fig. 1 The Block Tool.
Fig. 2 Clicking and dragging to create a brush.

Selecting brushes

The Selection Tool.

Click on the Selection tool Hammer select.png. It is used to isolate an object or group of objects you wish to manipulate. With the Selection Tool active, highlight your brush by clicking on it in one of the windows. (In a 2D window click on the edges or center of the brush. In the Camera view, click anywhere on the object.)

You will notice that the selected brush will be highlighted with red and will get eight little white square handles in the 2D views. These handles allow you to rotate and transform the selection (see below).

Note that the brush looks like a 3D wireframe box. Flatten the box so that it looks like a thin slab and move it so that the camera is above it. Think of the brush as a 3D chunk of ceiling or floor or wall, not a room all by itself. It takes 6 brushes to make a room.

Tip.pngTip:Hold Ctrl to select multiple objects.

The Grid

A grid is displayed in all the 2D views. By default, all objects snap to the grid. Although you can turn this off by pressing Shift+W, it is considered good practice to leave it on because it prevents leaks and other errors in your map.

The default grid size is 64 units, which means that each line is 64 units apart. You can change the grid size by:

  • Pressing [ or Alt+A or clicking the Smaller Grid icon Hammer SmallerGrid.png. This will make the grid half as small as before, allowing finer adjustments.
  • Pressing ] or Alt+S or clicking the Larger Grid icon Hammer LargerGrid.png. This will make the grid twice as big, for larger adjustments.

To help determine the appropriate scales needed for a playable map, please see the article on Dimensions.

Resize, Rotate, & Skew

Icon-Important.pngImportant:All three of the following operations can cause vertices to land off grid which normally is to be avoided, especially for world brushes. Resizing and skewing single axis-aligned cuboids for example is never problematic whereas rotating any brush by any angle other than 0, 90, 180, ... degrees always results in vertices off grid. Sometimes the Vertex tool Mt-vertex.png is what you are actually looking for.

Resize

Scales the selection. Select a brush using the Selection tool Hammer select.png and mouse over one of its eight white handles. The cursor should change to arrows, indicating along which axis you can move that handle. To resize, simply click and drag one of these handles.
White squares on each corner mean the brush can be resized.
Click and drag the edge up or down in any 2D view to resize.

Rotate

Spins the selection. Select the object you wish to rotate using the Selection tool Hammer select.png, then click on the object once again. You should see the squares surrounding the object at the corners turn into circles.
Circles on each corner mean the brush can be rotated.
Click and drag in a circle in any 2D view to rotate.

Skew

Distorts the selection along an axis. Select the object you wish to skew using the Selection tool Hammer select.png, then click twice on the object. You should see small white squares at the center of each edge of the object.
White squares at the center of each edge mean the brush can be skewed.
Click & drag a white square in any 2D view to skew.