[Tutorial] Basic Hammer Tutorials

Discussion in 'Tutorials & Resources' started by Elec0, Aug 24, 2011.

  1. Elec0

    Elec0 L1: Registered

    Messages:
    15
    Positive Ratings:
    3
    So, I like making tutorials. I'm working on a series of tutorials on the basics of Hammer, for beginners. I'm sure there are quite a few of these on here, but I figured I'd post mine as well, it can't hurt.
    I'm actually writing these for my blog, so some formatting might be off. Probably not, but you never know.
    If these are read at all, I'll keep posting them here, if not, I'll stop.
    Also, I'm sure there are some things that I don't do correctly. Feel free to correct me, and I'll try to fix it in the tutorial.

    ---

    I like doing tutorials. I've done some video tutorials on Source's world editor Hammer. But they're in video format, which some people (myself included) don't prefer. So I figured that since I have a blog that I'm not using for much else at this point I might as well convert the tutorials over to text as well as video.
    So, let's get started.

    Open up Hammer through the Source SDK under Tools in Steam. You have to have at least one Source game, of course.
    When Hammer opens, push CTRL-N and you'll see this.



    [​IMG]

    I've marked some of the options in the screenshot, but I'll detail them more in depth later.
    For now, click on the white cube on the options. Or hit Shift-B. This is your brush tool. Brushes are all the things that you see in source games that aren't models. Essentially all the boxes and everything are called brushes.
    Now, draw a square like this.


    [​IMG]


    Before you hit enter, click on the browse button on the texture browser on the right side of the screen. Then type in 'grass', or whatever you want. Find a texture and double click it.


    [​IMG]


    Now hit enter. You should see something like this.


    [​IMG]


    If you hover over the textured 3d view and hit Z you can fly around with WASD and the mouse.
    Now, draw another square, but in a different view, so you won't be drawing from the top. Like so.


    [​IMG]


    Hit enter and you'll have your vertical brush.
    Let's make a basic room. The only other thing you need to know to make a room is the Shift-S tool. It's also the red pointer on the options menu. This is the selector tool, it allows you to move brushes around and to resize them and stuff.
    Take our previous vertical brush and stretch it out so it covers one side of the floor.


    [​IMG]


    Pretty simple, no? Hopefully it is, otherwise...well, yeah.
    Anyway, let's make the other walls for our room. Being a programmer, I like shortcuts, so I tend to use keyboard shortcuts a lot, which is why I recommend using the hotkeys for the tools, like Shift-B and whatnot.

    You can duplicate an existing brush very easily. To do it, just select the brush with the selection tool (Shift-S) and hold down Shift and drag the brush somewhere else.


    [​IMG]


    Use this to make the rest of your walls, it makes everything really easy.
    Now that you've made your walls, you should have something that looks something like this.


    [​IMG]


    Okay. Now for the fun stuff, let's make the floor a different texture than the walls. Having everything be one texture is boring as hell. It's really simple to change the texture of a brush, just open up the texture browser by clicking Browse, find a new texture, try 'floor'. Then select the brush you want to change the texture of, and click this option.


    [​IMG]


    Your floor should now be a different texture than your walls.


    [​IMG]


    Now, copy the floor up to the top of the walls to make a ceiling. On your maps, make sure that, from inside the map, you can NEVER see the blackness of outside the map. If you can, it's called a leak. It will prevent optimization calculations from running, and your map will run badly.
    Oh, you can move the wireframe side views around my hovering over it and pushing the arrow keys, or hovering over it, hold space and left-click dragging. Either way will work.

    After you've made your roof, it's time to make a place for your players to spawn. For this, you need an entity. To place entities, hit Shift-E or the little white marker-looking thing. You'll then see this panel light up.


    [​IMG]


    By default, the entity used to spawn players is always the first one to come up. So info_player_teamspawn is what you use to spawn players in TF2.
    To place the entity, use the textured view to fly into your room, and click somewhere on the ground. This will create the entity where you clicked.


    [​IMG]


    If you want to customize the options of any entity, make sure it's selected, then double click on it in the textured view, or hit Alt-Enter. This will bring up the properties menu.


    [​IMG]


    Most options are pretty self-explanatory, so feel free to mess around with them.

    Now, how to compile your map. It's really very simple, hit F9. You'll see this.


    [​IMG]


    You can use my settings to test your maps, but if you want to release a map, make sure that Run VIS and Run RAD are both on Normal, not fast. It's slower, but it increases performance in-game. Also make sure that the 'Don't run game after compiling' checkbox is ticked, unless you want the game to run after you compile; in that case, leave it unticked.
    Then hit OK and your map will compile. You'll see this window pop up and text will appear. It'll look like this when it's done.


    [​IMG]


    Then just load up your game and click 'Create Server' and find your map. Oh, you'll have to save it before you compile it, but that's as easy as entering a name and hitting enter.


    That's it for now, hope you learned something. If you've got any questions, post a comment, message me on Steam, whatever.

    ~Elec0
     
    • Thanks Thanks x 2
  2. Terwonick

    Terwonick L6: Sharp Member

    Messages:
    278
    Positive Ratings:
    89
    pretty good, it's something that a beginner could follow

    one mistake I see, before you go into making brushes and choosing textures and such, you should show them how to get the "Shaded Textured Polygon" window operational, I believe the default is just a wireframe.
     
    • Thanks Thanks x 1
  3. godofdefeat

    godofdefeat L1: Registered

    Messages:
    1
    Positive Ratings:
    0
    well thank you very much for this toturial
    :D