• Hammer Basics and Alien Swarm TileGen Creation Tutorial

    In this tutorial, I'll be showing off the basics of Hammer to help people with no experience in the tool to make tile sets for Alien Swarm. Hammer is the main editing tool used to make many of the Source based games out there.
    Questions Odawgg-hammer-jpg


    Hammer is a fairly simple tool to get started with. Think of it like this, if you can put together Lego's you can do Hammer. First thing you need to do is download the Alien Swarm SDK. After it finishes launching it up click the Hammer World Editor button. This will take you into hammer. Go to File\new and we'll begin our first room.

    The first thing you'll probably notice are the four squares on the screen. The top left square is the camera. This is where you'll see your map in all its glory. The top right square is the X\Y axis. The bottom left and right squares are the Y\Z and X\Z respectively. On the left bar, you'll see buttons that are used to manipulate the map blocks, but I'll get more into that later.

    The way that Hammer works is a fairly simple concept to grasp. It creates 3d maps out of 2d blueprints. Start by making a block by clicking on the block tool button Questions Odawgg-box-jpg, and make a square that's 512x512. Then, hit enter. Questions Odawgg-lineup-jpgThis will create a box in the camera window as well as in the other three squares. Put your mouse in the camera square to move it around. Move the camera with the WASD keys, and aim it using the arrow keys till you can see your box. What you need to do now is make sure that your box is directly on the origin line. All the grids have two green intersecting lines on them. Depending on where you grab the block, the corners will snap to the grid. Your block needs to be in line with the intersection as shown in the picture below.

    Now we have our base floor down for our room. Now you need to decide what type of room this will be. For the tutorial I'm going to make it a small, snowy fenced in area where our players need to hold up and survive an alien swarm. Click the texture button on the left Questions Odawgg-tex-jpg. Now click the top of our floor box. Next to the preview box is the Browse button. This will take you in to the SDK texture browser. You can type in any key words to find whatever you're looking for. I'm going to use a snowy ground texture to use. Apply your changes, and your floor is ready.

    Next, we'll need to add walls to our level. Use the grids to create some walls for your room. The wall size can be any size but for this I'll use 16. Your grid size should be set to 64 by default. On the top of your screen, you'll see four grid buttons. The last two, with the plus and minus signs on them, change the grid size by multiples of two. Click the negative button twice to change it to 16. Now the smallest box size you can make is 16. Use the grid to create 4 walls to block off the perimeter of your room so that your players wont fall off. Set any texture to your walls, and your pretty much done with them.

    Next you'll want to add things to the map for detail. I made a small platform in the center using blocks and added some boxes that are just laying around. To do this click on the Entity tool Questions Odawgg-entity-jpg. Click anywhere on the map, and a green man should appear. Go ahead and place four of these in your map. They are starting points and will be needed. Make a 5th starting point; then switch to the selector Questions Odawgg-selection-jpg. Double-click the 5th player to open the properties of the entity. Questions Odawgg-barrel-jpgUnder class type "prop_physics_multiplayer". The menu should automatically go to it when your typing; when it does, hit apply. Now click on World Model, then on browse. This opens up the model browser. It works the same way as the texture browser; just type in what you want, and things will pop up. Lets start by adding some boxes. Type in Crates and find something to add to your level. Repeat these steps to add more things. You can also copy anything you place in your room by clicking on it and holding shift then dragging it to where you want the copy.

    Now we need to add spawn points for the Aliens. Create a new entity, and open the properties. Type in "asw_spawner" in the class box. Here you can edit all the info as needed, or leave it as is. What I had to do was change the “allow spawn if marines are near” to yes. Then “Max Num. of live aliens”, “Num. Aliens we can create", and “spawn interval” to what ever number you like. Make as many spawners as you see fit, and your room is now complete.
    Questions Odawgg-tile-jpg
    Save your room as "2x2_roomname". The 2x2 will come in handy when you load the room into Alien Swarm; 2x2 is how many multiples of 256 there are, so 512 would have two 256 squares wide and tall. You'll want to save your room in “C:\Program Files\Steam\steamapps\common\alien swarm\swarm\tilegen\roomtemplates” When you get to the folder to save it, create a new folder, and call it New (or whatever name you want to give it). Save the room in that new folder. This will make it easier to find in Alien Swarm. Now we're ready to add it in the tilegen so load up Alien Swarm.

    When Alien Swarm (AS) has loaded, open your console with the ~ key, and type in “sv_cheats 1”, then “asw_tilegen.” This will load up the tilegen tool in AS. Open the themes window, and create a new theme for your room. Make the name of the theme the same as the folder you created. Now open the New room template, and under name hit the button next to the box. Your room should be the only thing in the browser box. Under tags, check the start box. There's no need to adjust the wide or tall sliders since we added the 2x2 in front of our room name. You can adjust the Spawn weight to determine how many aliens spawn, and then hit OK.



    You'll now see "start" in the tile window. Click on it, and place it on the grid somewhere. The rooms you add will not have thumbnails just yet. What you need to do is click on the tile that's where "start" is, and place it somewhere on the grid. You won't be able to see it, but it's there. Then go to file, and choose “Export .vmf.” A pop-up window should come up and say that it exported. Now go to tools, and choose create thumbnails. A loading bar will come up and process the tiles giving them thumbnails for you to see them. This will also launch the map. Choose your character and you can now play.
    Questions Odawgg-jpg

    You have just created your first one room map. In part two, I'll show you how to make hallways and the like to build your own maps, or allow others to build maps themselves with tilesets you've created.
    Comments 5 Comments
    1. SovietDooM's Avatar
      SovietDooM -
      Ah just what I was about to search the web for.
    1. drfroob's Avatar
      drfroob -
      It's interesting that you don't have to worry about leaks like in standard Hammer modeling.

      Excellent tutorial, maybe add how to do doors (and tech only doors) next?

      And I can't help but notice the motion scanner doesn't have a complete map.
    1. Adretheon's Avatar
      Adretheon -
      In the next one(which should be done by day's end) I'll talk more about triggers, spawns, doors, connecting rooms, lights, and such. I'll even have all the rooms I make zipped up for people to use.
    1. SovietDooM's Avatar
      SovietDooM -
      Thanks for the hands only help while I was actually making this room. I'll be sure to add you to the credits when I figure out how to add that...
    1. i8pptuakamonstercam's Avatar
      i8pptuakamonstercam -
      nice job