User:Wisdurm/Sandbox/1. A Room (Updated)

From Valve Developer Community
Jump to: navigation, search


[ Either there are no particularly important entities referenced in this tutorial,

or the entity list for this tutorial has not yet been setup.

E-mail me if you think this is a bug. ]



1. A Room (Updated)



All basic tutorials are exactly that: basic. They are step by step guides

through each operation, hopefully fully illustrated. Experienced mappers may find these tedious, but they are essentially designed for newbies :-)



This builds a BASIC ROOM takes you through making brushes, hollowing, placing the player, adding a light source and some basic texturing operations in Hammer. We will be using this room in later tutorials.

As with all tutorials, you can go through it and make it, or if you just want to get how to do it, then download the VMF load it up in Hammer, and use the tutorial as a reference point to see how things work.



  1. Open Hammer

  2. Click on file | new


  3. Click on the Block tool

    <img src="/web/20060625142302im_/blocktool.jpg" align="middle"> or press SHIFT+B

  4. On the right hand side of the screen under Objects in the drop down, make sure

    Block is showing

  5. With the cursor in the 2d Top (x/y)view hold down the LeftMouseButton (LMB),

    and drag out your room.


    <img src="/web/20060625142302im_/top2d.jpg">

    TIP...


    It is a good idea to keep to the 1024 grid lines on the grid as far as possible. This helps with performance of the game engine


  6. Note that the program shows you the size of the room (length and width) as you draw it.

    (512 x 512 is good)

  7. In the side view, click and hold the small white handle in the

    middle of the bottom line, pull it down to make the room 128 units high.



    <img src="/web/20060625142302im_/side2d.jpg">


  8. Click on Browse in the Texture Window (Top RHS of screen);

    here are all the textures available to you.

  9. In the Filter window type Nodraw



    <img src="/web/20060625142302im_/texwind.jpg">

    No Draw ...



    The Nodraw material helps increase performance for the Source engine by not rendering the surfaces that it is applied to. Any surface that the player will never see in the game can be textured with Nodraw, so it makes sense that if you use this as your default texture, and then only texture the surfaces which the player will see, you save some work, and maximise performance of the engine.

  10. Double-click on the Nodraw texture that comes up.



  11. The texture window closes and returns you to the editor. Nodraw

    is in the texture pane.



  12. Press enter.



  13. You have now made a solid cube in the editor: 512 x 512 x 128.



    THIS IS A BRUSH

  14. Click on the Selector Tool in the toolbar.

    <img src="/web/20060625142302im_/selector.jpg" align="middle">
    Your brush will be red and have 8 small white square handles, showing it is selected.

    <img src="/web/20060625142302im_/selectbrush.jpg" align="middle">



    So that you can walk around inside it, we need to hollow it.
    (See the [#end">end of this tutorial] for a note about hollowing vs making walls separately)

  15. Click on Tools on the menu bar, and then

    Make Hollow (CTRL+H).
    A window comes up.
    This asks how thick you want the walls, I always hollow outward as it retains the dimensions of the room (i.e. 512 x 512 x 512) so put a minus in front of the number. You can change the thickness, so change it to -16.


    <img src="/web/20060625142302im_/hollow.jpg" align="middle">


    Click OK.

  16. You now have a room, and you should be able to see it in the 3D window. (Click on

    Camera in the 3D screen and select 3d Textured.)
    Put your cursor in the camera window, and press Z on the keyboard. The cursor changes to a cross.


  17. If you move the mouse around in the 3D window your room will appear.

    To move towards it press 'W', back is 'S', right is 'D' and left is 'A', the same as in the game. You can use the mouse to look around and up and down. Press Z again, to come out of the camera.

    You see your big, very yellow room.

    CAMERA ...


    You can place a camera anywhere in the 2D views. Click on the camera icon <img src="/web/20060625142302im_/camera.jpg" align="middle">
    hold down SHIFT and drag out the camera in a 2D view. You get a red ball with a blue line, the line points in the direction of the camera. Check to see if it's where you intended in the other 2D windows. You can place as many as you like, and with Camera selected, when you click on one in the 2D view, the 3D view uses that camera.


    Let's texture the room

  18. Click on the green blue and red cube on the LHS toolbar.

    <img src="/web/20060625142302im_/faceedit.jpg" align="middle">

    This is called the Toggle Texture Application tool or, the Face Edit Sheet.
    With this tool you can pick, scale, rotate, shift in any axis and change the lightmap value of all your textures.

    <img src="/web/20060625142302im_/faceeditwin.jpg">


  19. Click on Browse and we are back in the textures browser.

    Clear the Filter which will still have Nodraw in it. Type in wall and pick a wall texture.

    TIP ...


    If you single click on a texture, you are able to scroll through with a wheel mouse.


  20. Double click on your fancy (for reference, I used plaster/wallpaper002a),

    then, in the Face Edit Sheet click on Mode: Lift and Select. From the drop down click on Apply Texture and Values.

  21. Press Z on the keyboard with the cursor in the camera

    window, and you will be able to left click the texture onto each wall in turn.

  22. Do the same thing, finding floor and ceiling textures.

    (Type floor or ceiling into the Filter ) I used concrete/concretefloor011a for the floor and concrete/concreteceiling003a for the ceiling.

    (I don't intend covering texturing in detail, that's for later tutorials, but textures are a particular size which can be changed,, but as the wall texture e.g. was 128 by 128 you will have noted that the wall texture fits exactly floor to ceiling.)


    Close the Face Edit Sheet

    Now let's put a player in the game.

  23. Click on the Entity Tool

    <img src="/web/20060625142302im_/enttool.jpg" align="middle">

    On the RHS of the editor you will see Categories and below it Entities. Then below that Objects and then Info_player_start.

    <img src="/web/20060625142302im_/entwindow.jpg">


    If Info_player_start is not displayed, simply click the arrow and pick it from the alphabetical list of entities.

    <img src="/web/20060625142302im_/entlist.jpg">


    Back in the 2D window, your cursor turns into an axe with a cross !!

  24. The easiest way to place entities on the floor is in the 3D window.

    So click it onto the floor. You can still move it (in a 2d window) if it is not in the right place, but it must not overlap the floor, or your player will be stuck in the floor, in the game.



    Time for your reward.

  25. Click on Run map on the menu bar

    <img src="/web/20060625142302im_/runmap.jpg" align="middle"> or press F9


    You will be asked to name the map. Name it master_room , or something, as we will use this basic room in later tutorials, and click OK.
    Then the Run Map window opens Normal should be selected in Run BSP, Run VIS and Run RAD.

    <img src="/web/20060625142302im_/runmapwin.jpg">



  26. Type in -dev -console , in the additional game parameters window,

    then click OK .
    If you are set up properly Hammer will compile your map and send it to HL2, and you should be in the game in your room.


  27. Before you leave the game press the keyboard key just below the ESC key,

    or the tilde ~ key.
    The console window comes up. (this is why we put -dev -console in the parameters).
    This is one of the places you should look for errors in your map, if you have a problem.


    <img src="/web/20060625142302im_/console.jpg">



  28. OK exit the game. You are dumped back into Hammer.


    You will see here the Compile Process Window , open it up and scroll through. This is another place you can find why there might be errors in your map.


    <img src="/web/20060625142302im_/compile.jpg">



    The map is fully lit in the game. That it because there are no lights in your map, so the compiler sends it fully lit to the game.

  29. Let's put some light in.


  30. Click on the Entity Tool

    <img src="/web/20060625142302im_/enttool.jpg" align="middle">

  31. Open the Objects drop down menu

    and find the Light entity


    <img src="/web/20060625142302im_/lightent.jpg">


  32. Put the Light entity in the middle of the room, roughly.


  33. Click on Run map on the menu bar

    <img src="/web/20060625142302im_/runmap.jpg" align="middle"> or press F9

  34. Click OK.



  35. You will be back in the game, with the room lit by the light entity you put in.







Hollowing vs Making Walls Separately.


There are some mappers who think you should never use hollow. This means making rooms wall by wall and adding a ceiling and a floor all as separate brushes. Further some believe that mitring (by means of vertex editing - see later tutorial) the joins makes for better map practice. This may be for reasons of compiling, FPS rates etc. I don't know, I am still learning and I don't have a view on this subject. What is true is that you can make many differently shaped rooms if you do it brush by brush, which avoids the square or rectangular options that hollowing with the block tool leaves you with.
Probably best to only use hollow where simple cube shapes are involved.(no doubt someone can comment on this, and the forums will give more discussion.



[tutorials/1/master_room.zip?PHPSESSID=d50bbc8e15612551d0eb10d5f6efb683 Download the File : master_room.zip (1.266kb)]