Welcome, Guest! Login | Register

Tutorial 2 [Print this Article]
Posted by: Hellbringer
Date posted: Mar 02 2003
User Rating: 5 out of 5.0
Number of views: 12577
Number of comments: 6
Description: Your First Room









(*Note:
This tutorial assumes you have both Half-Life AND Valve Hammer v3.4.
This tutorial is designed for those of you who are new to Level editing
and CSG (Constructive Solid Geometry) or Brush-type maps.

This tutorial covers:

  • Basic Worldcraft functions and toolbars

  • The four main views and 3-d axes

  • Texture selection and filtering

  • Brush creation

  • Selection

  • Stretching/resizing brushes

  • The Hollow function

  • Camera / 3-d view manipulation

  • Entity creation

  • Compiling/running a map




Welcome to Tutorial #2 - this is the first tutorial on this site where you'll be going into Worldcraft and making a level. We're gonna start small on these; and build in complexity, but this tutorial in particular has A TON OF INFORMATION about Worldcraft, the coordinate system, and all kinds of details that are fundamental to knowing how to edit well - so read carefully and slowly!! As always, feel free to email me (link at the bottom of the page) with any questions or comments; I know this baby here is chock full 'o' heavy reading, so don't be shy if something confuses you or raises any questions you want answered right away. But you came here for the tutorial -so without further ado, why don't you load up Worldcraft now. All tutorials are going to assume you have the latest version, and use the default setup with a 2-button mouse - you should also have all of the proper directories and tools configured before using this tutorial. Refer to the documentation, my WC Setup guide, and my Compile FAQ for details. I will be covering individual WorldCraft commands each time we execute a new command for the first time.


Once Worldcraft has been loaded, go up to the "File" menu item and click on "new". Note: Be sure the textures load up properly! In Half-Life, all textures are stored OUTSIDE of the map in .WAD files. These must be loaded by the map-editor so that you can apply them to various brushes. Without textures, your shapes and levels would be done in single colors; and who wants that?? Also, I personally like to have all of the menus and status bars turned on (you can select which ones are displayed from the "View | Screen Elements" menu). You may not want this if you have a small screen or are running at lower than 800x600 resolution; but at least note this: ALL Worldcraft menus and toolbars are DOCKABLE.

So I have mine arranged like this - it gives me a large main workspace for my maps, and an organized area for referring to textures, VISgroups, and some entity controls. Feel free to experiment around and find what's comfortable for you - as it is important that you have an arrangement that allows you to work freely and without frustration.

After choosing "New" from the menu, a window will open up in your workspace with the standard Worldcraft 4-view layout. Back to textures for a moment: you should see one of them appear in the "Texture group" box, wherever you placed that on the screen. To scroll through the available textures, click either the drop-down-box arrow or the "browse" button. Note that whatever texture is displayed in the "Texture group" box is the texture that will be used for new brushes, as well as for any "apply texture" operations you might perform (more on that later). Now, let's choose the texture we'll be starting with today... in the "Texture group" box, click the "browse" button. Right off the bat I'm going to introduce you to an advanced feature of Worldcraft - texture filtering. Say you know part of the name or description of a texture, but can't find it? Well, Worldcraft helps by providing a "filter" box. In this box you can type in characters, and ONLY those textures with matching names will be displayed. So let's find some textures by typing "stain" in the filter box (I personally know that in Half-Life, certain textures start with "stain" - this is not some special thing for Worldcraft). After a second or two's pause, the screen should flicker and you should notice that you have MUCH fewer textures to look through. Select the texture "stain_wall01" by double-clicking on it . Notice that double-clicking selects the texture AND closes the window. Next, let me explain a few things about brushes and the main view. Remember, a brush is a solid non-concave polygon in our map. And all of the items & objects in our map must be completely surrounded by them. Think of the "gray void" outside a level as the vacuum of space - you MUST seal off the interior of the level COMPLETELY from this, no matter what! I'll discuss the consequences of NOT doing this another time. As far as the view goes, Worldcraft's default is to have four views arranged in the following manner:










3-d View

Top (XY) View

Side (YZ) View

Front (XZ) View



To understand the axis-system in a 3-d world, try this simple experiment: Stand up tall and hold your arms down at your sides. Now, lift your arms straight out until they're level with your shoulders. Now, make your hands so that you're giving a "thumbs-up" symbol - But leave your arms where they are! Okay, if you've done all this correctly, here's how it works: you're standing up in the Z-axis. Your thumbs are also pointing up in the Z-axis. This is the axis that runs up and down (top to bottom). Your arms are pointing to your left and right, this is in the X-axis (think of it like east-to-west). Lastly, you're facing "north", with your back to the "south" in the Y-axis (think of it as north-to-south). So the main view is said to be the X-Y view because you can see changes in the X and Y axes; but not in the Z-axis. Finally, the axis of each view is displayed in the top left hand corrner of each view. You can also set the axes manually by clicking on box that displays the current axis; but I don't recommend it - for now stay with the defaults. You can also move the mouse to the intersection of all four views and drag (using the left mouse button) to resize the views. Most of these controls are also available under the "View" menu option.

Now, on to making brushes! The first thing we need to do is to switch to the Block creation mode user posted image (in case you didn't read the manual, there are basically 11 "modes" user posted image for editing with Worldcraft: Selection, Zoom, Camera, Entity creation, Block/brush creation, the Texture application tool, the Apply texture to whole-brush tool, the Decals tool, the Clipping tool, the Vertex Edit mode, and the Path tool). Move the cursor onto the "top-down" (XY) window and find the coordinates: X: -128 Y: 128 (you can see these coordinates down on the status bar next to the @ symbol - as well as the current grid spacing and whether "Snap to grid" is on.). Don't worry if you can't get them exactly, the objects you create and move will automatically jump (or "snap") to the nearest grid line (if you have "snap to grid" on), so things will always be aligned. When you get close to these coordinates, hold down the left mouse button and drag the mouse down and to the right until you get a reading of X: 128 Y: -128, or thereabouts. You should see now a white dashed-line square in the Top (XY) view, and also dashed-line rectangles in the side and front views. Note how the new brush we are creating defaults to being 1 grid-square in height. Also notice the white boxes at certain points around the exterior - these are called "handles", and are used to manipulate the brush we are creating. By moving over one, holding down the left button, and dragging around the handle, we can change the shape or size of the proposed brush. Go ahead and try that now - if you can't get it back to the shape we started with, hit the ESC key and draw the brush again. If you DO play with these handles right now, here are some things to notice: A) Moving the handles in one view can change the shape in another; since you're affecting the overall 3d shape of the brush. The relationships are simple to see with a cube like this; and get used to seeing this and understanding the relationships between the different views. user posted image In the status bar, next to the @ symbol with the current coordinates you may notice a display with more numbers. When you are dragging around a handle, you will be shown the current total dimensions of the brush - with respect to the two axes in the view you are modifying; thus if you stretch the brush in the XZ view, it will show you the X dimension of the brush, followed by the Z dimension. When you release the button, the status bar tells you the total dimensions of the object in all three axes (width, length, and height). Our brush should be 256 by 256 by 64 in this readout. In Worldcraft, brushes don't get created automatically - you can play with shape and size during the creation phase without having to worry about screwing up your existing work. If you run into problems, you can always cancel the new brush by pressing the ESC key. By the same token, to CONFIRM placement of our new brush, we have to hit the ENTER key, so go ahead and do that now, making sure your brush is 256 x 256 x 64 units.



I won't get into manipulating the camera here - you can do that after the tutorial is completed, but for now, if you look at the 3-D window, you can at least see the textured surface of the brush from above. We now have a room that's 256 x 256 units, but if you look in the windows that show the Z-axis, you'll notice it's kinda thin compared to the width and height. For a sense of scale, remember that the player is roughly 32 units wide & long, and 64 units tall. Right now our new brush is only 64 units tall (check the status bar, it will show the current grid-spacing). Let's change that, shall we? Change back to the selection tool, and go to the YZ window. To move or resize our brush, we will need to select it. There are MANY ways to select objects and/or brushes in Worldcraft - I'll go over a few basic ones here (BTW, selected brushes are highlighted in RED in the views). First off, you may notice an "X" in the middle of the brush - this is called the "center handle", and is used to reference the middle (or "center-point") of each brush; its purely an editing tool, and doesn't affect the brush itself at all. Clicking on this center handle will select the brush though. To deselect the brush, click once somewhere out in an empty area of the map. Another way to select the brush is to click along one of its corners or edges in the 2-d views. Once again. click on an empty portion of the map to deselect it. Finally, the third way to select a brush (or several brushes) is to click and drag the mouse button out like we're making a new brush. We manipulate the dashed-line-box just the same as before; and press ENTER when we have the shape we want. HOWEVER, instead of creating a new brush, all objects touching or inside of this dashed-line box are selected. Deselection is the same as before. One more thing before we get back to editing: Clicking on the selected brush changes the handles around it. Each set of handles is used differently - but for now we just want the standard set of handles that comes up when you first select a brush. If you happen to change this by accidentally clicking again on the brush, simply deselect and re-select our brush. With whatever method you prefer, go ahead and select our brush now.

Let's stretch our brush UP so that it is 128 units tall. When you are resizing, watch the status bar and note the different things that change. Make sure you're back in the YZ view, and that the brush is selected. Now "grab" one of the handles along the top of the brush with the left mouse button and drag upwards until the brush is 128 units tall. The easiest way to tell this is to use the grid lines and the status bar readout. When it is 128 units tall, go ahead and let go of the mouse button. Notice that the brush stays selected.



Now, we have a brush that is big enough to fit a player - but it is SOLID throughout!! If we were to stick a player in it now, he'd be immobile in a solid block of metal! So, we need to hollow out this brush to make it a room. The quickest way to do this is with the "Make hollow" feature. When you use this with a brush selected, the brush will become hollow, with "walls" as thick as you specify in a dialog box that pops up. For now, 16-units is thick enough for our purposes, so make sure the brush is still selected and go to "Tools | Make Hollow" (as a shortcut, you can always select the brush and then hit CTRL-H). When the dialog box pops up, enter "16" (without the quotes) - this will tell Worldcraft to make walls that are 16 units thick heading INWARD from the starting point towards the center of the original brush. As the dialog box says, you CAN use negative numbers to hollow OUTWARD as well - but we won't be doing that this time. Once you hit ENTER to confirm the thickness, you should notice quite a number of changes in the 2-d and 3-d views. Our brush has now become 6 thinner brushes, one for each side. Notice how everything gets deselected when we do this. Another curious thing to notice is how ALL 6 new brushes get selected whenever we try to select 1 of them. NOTE: This is because ALL brushes that are "hollow"ed in Worldcraft are also grouped together by default. If we want to work with each one individually, we need to un-group them. So, go back and click on the group of brushes so that they're selected (highlighted in red). Now to ungroup objects, we have 3 methods: First, you can go to "Tools | Ungroup". Second, you can use CTRL-U as a keyboard shortcut. And third, we have the Group/Ungroup buttons user posted image . Use whichever one you want, but do so ONCE (further uses shouldn't do anything). I know its hard to tell what exactly is going on from the 2-d views; so I'll now show you a basic way to control the camera. Go ahead and add a new camera byhitting the camera button user posted image and moving the cursor over the XY (top) view. Start in the lower-left corner (coordinates -128, -128) of our room, HOLD SHIFT, and drag with the left mouse button diagonally from one corner of the room to the other (and then release both the mouse button and the SHIFT key). You should see a shaded circle (probably light-blue in color) and a line extending out from it like this:


user posted image


Now, the camera (3-d) view probably looks kind of odd at the moment; but that's because we haven't aligned the camera completely yet. We still need to set it up in the Z axis. The shaded circle represents the camera eye, and the red line is the direction that the camera is facing. To change this, you can drag (with the left mouse button) either the end of the red line or the circle itself to reposition the camera. Try this now in the YZ or XZ views until you get something that looks like this (YZ view):

user posted image


Now that you can see inside our room, its pretty boring; but it will do for now. You probably also have noticed that having everything the same texture makes it pretty ugly and the textures themselves may be mis-aligned; but those are subjects best left for more advanced tutorials. Your 3-d (camera) view should now look something like this:

user posted image


If we want to be able to play this level, we need to add a player start point, so let's go ahead and do this now. We're going to have to switch to the Entity tool user posted image first. Now move the cursor "inside" our room on the XY view so that it is near the upper-right corner (coordinates 64, 64) and click with the left mouse button. A green box should appear with some lines radiating from it (the lines are purely for alignment and reference). Let's go to the XZ or YZ views and make sure that it is completely "inside" our room by moving the cursor over it (the cursor will become a crosshair), and dragging it (using the left mouse button) until the YZ view looks something like this:

user posted image


This green box is a temporary entity placeholder. Entities are any objects that don't make up the walls and architecture of the level. Doors, monsters, weapons, and ammo are all examples of entities. A player start point is also an entity. But before we add it, let's make sure we're going to add the proper entity type. Look to the object box and double-check to make sure that "info_player_start" is selected (this is the standard entity for adding a single-player starting point):

user posted image


Clicking on the drop-down box will allow you to scroll through the various choices if "info_player_start" isn't selected already. Finally, to PLACE this entity into our map, we need to once again confirm our entity placement by pressing ENTER. The shape of the green box should change to reflect the relative size of our new object (in this case, the size of the standard player), AND you should see the green player-start box show up in the 3-d view. All entities are represented by colored boxes in Worldcraft, but will be replaced by the proper model or object when the game is run.



Notice that the start-point is a little bit above the floor. A small fall probably won't be noticeable when you start the level, and so it isn't worth worrying about in this tutorial - as long as the entity is entirely INSIDE of our room.

Now that we have a (very tiny) level, we need
to convert it into something that Half-Life can use... So, we need to run the HLCSG, HLBSP, HLVIS, and HLRAD processes on it. First, though, let's save the map just for safety! Go to "File | Save" and name it "tutor2" (it will default to the .RMF file format - which Worldcraft uses to save groupings and other advanced information). The four processes that we run on the map file do the following: HLCSG and HLBSP convert everything into geometry that the engine can use. HLVIS then breaks up the level into sections so that the engine doesn't have to draw the entire level at once (why draw a room if the player can't see it?) - this process is the most intensive, since VIS has to look at almost EVERY point within a level, and compare it to EVERY OTHER point in that level. For small levels, this is okay; but full-fledged levels can take up to 6-12 hours to VIS - even on a fast system! The last step is to light the level and determine the shadows, etc. This is done with the RAD process. We don't have any lights in our level; so a default lighting will be applied to everything. Lighting will be covered more in later tutorials. Worldcraft makes all this easy with the "File | Run" menu option, OR the Run Map buttonuser posted image you can also hit "F9"). This will bring up the "Run Map" dialog box. You should see some options for the four processes. Make sure you set the following:
  • Run CSG: Normal

  • Run BSP: Normal

  • Run VIS: Normal

  • Run RAD: No

The dialog box should look something like this:

user posted image



Go ahead and hit "OK" - After a few moments, the level should finish and H-L should start up. When it does, feel free to explore around your new level! If you have problems compiling, please refer to my Compile Configuration FAQ. Alright, so its pretty boring, but we'll be changing that in future tutorials. For now, we're done though. So go ahead and quit Half-Life when you're done. Then go ahead and shut down Worldcraft.

The next tutorial will cover making a second room, connecting them with a hallway and a door, and applying / changing textures on various parts of a brush (the different faces can each contain a different texture). As always, feel free to email me any comments, questions, or problems!

Rate This Article
This article is currently rated: 5 out of 5.0 (3 Votes)

You have to register to rate this article.
User Comments Showing comments 1-6

Posted By: Noitamina on Aug 17 2004 at 09:46:07
This helped me alot...

Posted By: Deus on Sep 07 2004 at 23:49:38
Yo Hellbringer, This is by far the easiest tutorial to follow! Thanks man!!

Posted By: MagicBobert on Dec 07 2004 at 04:56:29
Very nice tutorial for the mapping newbie. I've tried following other tutorials and just got lost. This was by far the best and the easiest to learn the foundation of Hammer. Good job!

Posted By: Unknown on Jan 06 2005 at 23:01:15
Where can I find those files listed? "HLCSG, HLBSP, etc...."

Posted By: LadyGhostrider on Jun 25 2005 at 05:44:02
I cannot seem to figure out why I can only get one "player start" to work in my map..........Anyone have any ideas??I would greatly appreciate it.........
thanks
LG

Posted By: punk_adict on Jan 27 2006 at 22:19:44
i would need help on the player start position,when i do an intity it doesnt have the option to make a player starting position,thanks for the help
best regards
dany


You must register to post a comment. If you have already registered, you must login.

Latest Articles
3rd person View in Multiplayer
Half-Life 2 | Coding | Client Side Tutorials
How to enable it in HL2DM

By: cct | Nov 13 2006

Making a Camera
Half-Life 2 | Level Design
This camera is good for when you join a map, it gives you a view of the map before you join a team

By: slackiller | Mar 05 2006

Making a camera , Part 2
Half-Life 2 | Level Design
these cameras are working monitors that turn on when a button is pushed.

By: slackiller | Mar 04 2006

Storing weapons on ladder
Half-Life 2 | Coding | Snippets
like Raven Sheild or BF2

By: British_Bomber | Dec 24 2005

Implementation of a string lookup table
Half-Life 2 | Coding | Snippets
A string lookup table is a set of functions that is used to convert strings to pre-defined values

By: deathz0rz | Nov 13 2005


Latest Comments
knock knock
General | News
By: MIFUNE | Dec 31 2017
 
knock knock
General | News
By: omega | Dec 22 2016
 
knock knock
General | News
By: MIFUNE | Oct 10 2015
 
New HL HUD Message System
Half-Life | Coding | Shared Tutorials
By: chbrules | Dec 31 2011
 
knock knock
General | News
By: Whistler | Nov 05 2011
 
Particle Engine tutorial part 4
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 18 2010
 
Particle Engine tutorial part 2
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 11 2010
 
Particle Engine tutorial part 3
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 11 2010
 
Game Movement Series #2: Analog Jumping and Floating
Half-Life 2 | Coding | Shared Tutorials
By: mars3554 | Oct 26 2009
 
Particle Engine tutorial part 5
Half-Life | Coding | Client Side Tutorials
By: Deadpool | Aug 02 2009
 

Site Info
297 Approved Articless
8 Pending Articles
3940 Registered Members
0 People Online (17 guests)
About - Credits - Contact Us

Wavelength version: 3.0.0.9
Valid XHTML 1.0! Valid CSS!