Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

Introduction to Hammer Editor and Mapping - A Tutorial for Counter-Strike 1.6

A must read before you try your luck in the mapping department.

Introduction to Mapping ======================= I hope you have downloaded and configured your Hammer Editor. If not, you may read [this](http://cs.gamebanana.com/tuts/11392 "Installing and configuring Hammer Editor") to ease up the things for yourself.
Terms a mapper use:- --------------------
  • Map/world:- The playable area of the game that consists of all the sounds, textures, geometries, interactive things (like doors and lights) etc.

  • brush:- Non interactive geometrical 3-D shapes with volume greater than zero are referred to as brushes. These are the main components of a map. Brushes could be blocks, wedges, cylinders, arches, spikes etc. Valid brushes are convex.
    A brush (or a group of brushes) can be tied to an entity to form brush entity that can interact.
    It is important to note that two or more faces/sides of the same brush can not lie in the same plane.
    Also Goldsrc Engine do not support brushes having more than 32 faces each. So, if you want to make a brush (lets say cylinder) with 34 faces, you may divide it along its diameter with the Clipping tool into 2 semi cylinders, so now they will be considered 2 different brushes with 17 sides each.

  • Entity:- These are the interactive bodies (exeption:- func_wall) that play a characteristic role in the map. For example, a door (func_door, func_door_rotating), lights (light, light_environment), water (func_water), a ladder (func_ladder) etc. Entities are of two types,
    1. Point entities:- like info_player_start, light, light_environment, ambient_generic (used to play sounds in map) etc. They are point sized and are not associated with any brush.
    2. Brush entities:- The entities that are associated to a brush (or a group of brushes) thereby making that brush(s) interactive. These entities are created by creating a brush (or more than one) of desired size and shape and then tying it to an entity. For example, doors could be of different shapes and sizes, so we create a desired shape of door and tie it to func_door (or func_door_rotating). Other examples are trigger_once, trigger_multiple, func_ladder, func_water, func_buyzone etc.

  • Leaf:- Leaves or Visleaves are convex 3D volumes created when BSP tree is built. These volumes are defined by, and lie in between static world brushes. At any given time when you move around your map, you are inside one or more of these BSP leaves. Knowing which leaves you're in, engine draws only those objects that are in your current Potential Visibility Set, PVS for short. PVS is made of all leaves that you are inside plus all other leaves that can be seen by them. This calculation of "which leaf can see which" is done by VIS compiler beforehand, and it can take hours if your map contains too many world brushes.

  • Prefab:- A brush or a group of brushes (and entities) with textures that is resembling to an object in a map, which is then stored as it is for being used in other maps or the same map later on. For example a computer, or a car, or a lamp post, staircase etc.

Difference between a brush and an entity. -----------------------------------------
BrushEntity
A brush is non interactive and non functioning.An entity is interactive. It plays a certain role in the map.
A brush cuts visleaves and forms shadows and thus requires more resources to get rendered. An entity does not cut vizleaves, nor does it form shadows (though it can be made to form shadows). Thus, it is rendered without much expenditure of resources.
Brushes seal the map. That is, they do not allow anything of the map to go out of the playable area. Hence, the outermost walls of the map must be made up of brushes and not of entity.Entities cannot seal the map. Thus they cause a leak if used as the outermost wall of the map.

Knowing your tools ------------------ Hammer Editor’s working screen is divided into 4 sections, as we can see in the [image](http://files.gamebanana.com/img/ss/tuts/52a0c646ef7a9.jpg "Hammer screen"), The first one is 3-D viewport. In this viewport, the map appears almost as it would appear in the game. The other three viewports display the 2-D appearance of the map in XY (top view), YZ (front view) and XZ (side view) plane. Now we will see what tools do we have in the hammer editor.
  • Selection tool:- Used to select brushes and entities in the map.
    1. Click on the select tool,
    2. then click on the brush or entity to be selected in any viewport (preferably 3-D viewport). We can select multiple objects by pressing and holding ctrl while clicking on the desired objects.
    3. Once we have selected the objects, we can right click on them in any of the 2-D viewport to get further options like cut, copy, group, ungroup, tie to entity etc

  • Magnify:- This tool is used to zoom-in or zoom-out a viewport.
    1. Left click on a viewport to zoom-in.
    2. Right click on a viewport to zoom-out.

    Alternatively, same thing can be done by mouse scroll button, and it is more convenient.

  • Camera:- Used to move in 3-D viewport.
    1. Hold left click and drag on the 3-D viewport to change the direction.
    2. Hold left click on 3-D viewport and press W,A,S and D to move forward, left, backward and right respectively.
    3. Hold right click and drag on the 3-D viewport to move in the same plane.

  • Entity tool:- Used to insert point entities like light, info_player_start etc.
    1. Select entity tool.
    2. Select the desired entity from object bar.
    3. Click on any of the viewports where you want to insert the entity.
    4. Press enter.
    5. Select this entity with selection tool, relocate it and change its properties.

  • Block tool:- Used to create brushes and insert prefabs.
    1. Click on block tool.
    2. Select the type of the brush (primitive shapes like a block, cylinder etc or a prefab) from the object bar.
    3. Hold left click and drag it to the desirable size in any of the 2-D viewports.
    4. Adjust its size in all the 2-D viewports.
    5. Press enter.

    The brush made can be used to create a brush entity. Just select the brush using selection tool, right click on it in 2-D viewport, click on "tie to entity" and select the desired entity in the "class" field.

  • Toggle texture application:- Used to apply texture to a particular surface of the brush.
    1. Click on Toggle texture application tool.
    2. Click on the desired surface (press and hold ctrl while clicking on multiple surfaces to select them).
    3. Browse the desired texture.
    4. Click on apply.
    5. Adjust texture's scale, Alignment, rotation etc.
    6. Click on apply.

  • Apply current texture:- Used to apply a texture to all the surfaces of a brush.
    1. Select a brush (or multiple brushes) using selection tool.
    2. Browse the desired texture in texture bar.
    3. Click on apply current texture tool.

  • Apply decals:- Used to apply a texture (a decal) over another base texture without making a new brush for it. For example, we see "A" and "B" written over the walls in the map, Those "A" and "B" are the decals that are placed over the base texture of the wall.
    1. Select the brush over which you want to place the decal using selection tool.
    2. Click on the Apply decal tool.
    3. Browse the desired decal texture from the texture bar.
    4. Click on the previously selected wall in 3-D viewport where you want to put the decal.
    5. Click again on the Apply decal tool to switch it off.

  • Clipping Tool:- Used to cut a brush.
    1. Select the desired brush using selection tool.
    2. Click on clipping tool.
    3. Hold left click and drag the cursor in 2-D viewport over selected brush to form a line where you want to cut that brush.
    4. The brush will be divided into two parts, one red, and one white. The white part will be left as the final result of the cut and the red part will get deleted. To interchange the red and white parts, click again on the clipping tool. And if you want both the parts to remain as two different brushes as the final result, click again on the clipping tool, this will turn both the parts as white.
    5. Once the desired part(s) is/are white and the undesired part is red, press enter.

  • Vertex Tool:- Used to alter the shape of the selected brush by changing the position of its vertices. For now, we won't discuss how to use it, as it may lead to formation of invalid solids if used by a less experienced mapper.

  • Path tool:- It is used to create paths for moving entities like func_train. Paths can also be made manually by placing path_corner entities. Each path_entity should be numbered in sequence. Path tool has been reported buggy by a lot of users.

  • Toggle grid:- Show/hide grids in 2-D viewports.

  • Toggle grid in 3-D view:- Show/hide grids in 3-D viewport.

  • Smaller grids:- Reducing the grid size to the half of the current size.

  • Larger grids:- Increasing the grid size to the double of the current size.

  • Group selected objects:- Used to group the selected objects.

  • Ungroup selected group:- Used to ungroup the selected group(s) of objects.

  • Texture lock:- Used to lock or fix the texture on the brush. It is recommended to keep it on. Switching it off causes the change in alignment of textures on a brush when the brush is moved to a new position.

  • Run map:- Used to compile the map and convert all the data into .bsp file which can be read by the game engine.
For all the keyboard shortcuts and other useful tips you may read [this](http://source.gamebanana.com/tuts/6607 "Starving Hobo's Keyboard Shortcuts").
Units ----- Units are used as the measurements in the hammer. They could be used as a scale or a reference to create brushes.
Some useful measurements:-
  • Player:-
    1. standing:- 73 units
    2. crouched:- 37 units
  • Width of a standard corridor:- 96 units
  • Standard wall height:- 128 units
  • Standard door dimensions:- 112*64 square units
  • Vent size:- 48*48 square units
  • Stair step height(rise):- 8 units (Maximum 16 units)
  • Stair step width(run):- 16 units

It is advisable to work on 16 unit grids for making maximum of your brushes. This keeps the map clean and easy to work with. Work with the reduced grid size only when you don't have an option, or when you are adding the final details.
That's all folks.
Keep Mapping :)
  • Akshit Saklani avatar
    Akshit Saklani Joined 9y ago
    Offline
    25,760 points Ranked 241st
    50 medals 3 legendary 9 rare
    • 15+ Entries! GameBanana’s Christmas Giveaway 2015 Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2016 Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2017 Medal icon
    • GameBanana’s Christmas Giveaway 2015 Day Seven Winner! Medal icon
    • GameBanana’s Christmas Giveaway 2015 Day Thirteen Winner! Medal icon
    • 25 posts awarded Exemplary Feedback Medal icon
    7y
    > **Posted by LH server** > > No problem, I've time and I looked path tool and use it and see this, and I post my test here. What I've > done, and you with 2-3 sentences you explain what's path tool!! whatever! Coz this is a general introduction to hammer.
    Fall 7 times, stand up 8! avatar
    Mantra
    Fall 7 times, stand up 8!
    URL to post:
  • GreenWallMapper avatar
    GreenWallMapper Joined 9y ago
    Offline
    Hammer Studio Flag Affiliation: Hammer Studio
    1,081 points Ranked 27,243rd
    8 medals 4 rare
    • Submitted 20 Maps Medal icon
    • Submitted 15 Mods Medal icon
    • Submitted 20 Mods Medal icon
    • Submitted 50 Mods Medal icon
    • Submitted 5 Maps Medal icon
    • Submitted 5 Castaways Medal icon
    GreenWallMapper Hammer Studio Flag
    Affiliation
    Hammer Studio
    7y
    > **Posted by Akshit Saklani** > > LH server thanks for reminding me that an update was required. I'm glad you found the tutorial helpful. :) No problem, I've time and I looked path tool and use it and see this, and I post my test here. What I've done, and you with 2-3 sentences you explain what's path tool!! whatever!
    Working on new logo! avatar
    Mantra
    Working on new logo!
    URL to post:
  • Akshit Saklani avatar
    Akshit Saklani Joined 9y ago
    Offline
    25,760 points Ranked 241st
    50 medals 3 legendary 9 rare
    • 15+ Entries! GameBanana’s Christmas Giveaway 2015 Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2016 Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2017 Medal icon
    • GameBanana’s Christmas Giveaway 2015 Day Seven Winner! Medal icon
    • GameBanana’s Christmas Giveaway 2015 Day Thirteen Winner! Medal icon
    • 25 posts awarded Exemplary Feedback Medal icon
    7y
    LH server thanks for reminding me that an update was required. I'm glad you found the tutorial helpful. :)
    Fall 7 times, stand up 8! avatar
    Mantra
    Fall 7 times, stand up 8!
    URL to post:
  • GreenWallMapper avatar
    GreenWallMapper Joined 9y ago
    Offline
    Hammer Studio Flag Affiliation: Hammer Studio
    1,081 points Ranked 27,243rd
    8 medals 4 rare
    • Submitted 20 Maps Medal icon
    • Submitted 15 Mods Medal icon
    • Submitted 20 Mods Medal icon
    • Submitted 50 Mods Medal icon
    • Submitted 5 Maps Medal icon
    • Submitted 5 Castaways Medal icon
    GreenWallMapper Hammer Studio Flag
    Affiliation
    Hammer Studio
    7y
    This tutorial is very helpfull, usefull and essential for the beginners and the guys like me don't know some options in valve harmmer. However, but can you explain for what is path tool for what things is using? Edit, i understand. I don't know how i just press SHIFT + P and then i just choose a entity and i click on ping pong and then ok and i see that when you make it ping pong in a position http://prikachi.com/images/649/7738649V.jpg, the terror come from the start(the first point and go down to the second point and then, he get to the ground :D). For the one way in the path tool, here he used the second point and then you go on the ground (this in valve harmer looks like this http://prikachi.com/images/689/7738689l.jpg). For the circular way, it used the first , second like the ping pong, but between ping pong way and this i don't know the difference, (http://prikachi.com/images/696/7738696E.jpg). In the test when i use one way i stayed with hp 100 or 85 when, i come from the first point (one way). When i use circular way, i was sometimes with 50 hp or up to 23 hp. I think that this is very usefull tool for knife servers, like 35hp knife or fun servers. How to put in the network ========================= 1. Click on SHIFT + F. 2. Now click shift then click on the place where you want to start then move then again click with right button of the mouse. I haven't read a tutorial. I haven't ask a friend or mapper how to use and for what is. I haven't watch, video tutorial for this. I just alone with luck and logic do this, it's strange, but this is the true.
    Working on new logo! avatar
    Mantra
    Working on new logo!
    URL to post:
  • Giani Georgian avatar
    Giani Georgian Joined 10y ago
    Offline
    183 points Ranked 74,100th
    12 medals 1 rare
    • 6 years a member Medal icon
    • Journey to the Center of the Earth Entrant Medal icon
    • Reached 1,000 Points Medal icon
    • One month a member Medal icon
    • 6 months a member Medal icon
    • 1 year a member Medal icon
    7y
    Seems to be very usefull... Hope it will help me to release my first map, I am a beginner :P
     avatar
    URL to post:
  • Akshit Saklani avatar
    Akshit Saklani Joined 9y ago
    Offline
    25,760 points Ranked 241st
    50 medals 3 legendary 9 rare
    • 15+ Entries! GameBanana’s Christmas Giveaway 2015 Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2016 Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2017 Medal icon
    • GameBanana’s Christmas Giveaway 2015 Day Seven Winner! Medal icon
    • GameBanana’s Christmas Giveaway 2015 Day Thirteen Winner! Medal icon
    • 25 posts awarded Exemplary Feedback Medal icon
    8y
    > **Posted by 404: User Not Found** > Isn't this like the 50th "Introduction to Mapping"-type tutorial on this site? It contains a lot of things that others did not have.
    Fall 7 times, stand up 8! avatar
    Mantra
    Fall 7 times, stand up 8!
    URL to post:
  • Ghost1229127 avatar
    Ghost1229127 Joined 11y ago
    Dave's Here
    5,150 points Ranked 1,804th
    23 medals 1 legendary 3 rare
    • Became a Ripe Supporter Medal icon
    • Reached 50 subscribers Medal icon
    • 6 years a member Medal icon
    • Returned 1000 times Medal icon
    • GAMEBANANA Spray Contest Entrant Medal icon
    • Tooler of the Month, January 2013 Medal icon
    8y
    Isn't this like the 50th "Introduction to Mapping"-type tutorial on this site? Hopefully all those tutorials don't become sentient and take over the site. I scared myself :(
    URL to post:
  • Akshit Saklani avatar
    Akshit Saklani Joined 9y ago
    Offline
    25,760 points Ranked 241st
    50 medals 3 legendary 9 rare
    • 15+ Entries! GameBanana’s Christmas Giveaway 2015 Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2016 Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2017 Medal icon
    • GameBanana’s Christmas Giveaway 2015 Day Seven Winner! Medal icon
    • GameBanana’s Christmas Giveaway 2015 Day Thirteen Winner! Medal icon
    • 25 posts awarded Exemplary Feedback Medal icon
    8y
    >**brush**: Valid brush is a convex 3D object of non-zero volume Lol, did I write "brushes can't be convex."? This is what happens when you write a tutorial in semi-slept state at 2 am in the morning. Surely, one of the silliest mistakes of mine. Thank you for taking time and updating me with the definitions. I'll fix it in a while. :)
    Fall 7 times, stand up 8! avatar
    Mantra
    Fall 7 times, stand up 8!
    URL to post:
  • Lord Canistra avatar
    Lord Canistra Joined 14y ago
    Offline
    14,434 points Ranked 530th
    23 medals 2 legendary 3 rare
    • 1st Place - 2016 Winter Mapping Contest Medal icon
    • 10 years a member Medal icon
    • 6 years a member Medal icon
    • 2nd Place - Beneath the Dust Mapping Contest Medal icon
    • Returned 1000 times Medal icon
    • Reached 1,000 Points Medal icon
    8y
    Even though I'm not a big fan of nitpicking, this introduction has several serious issues that have to be pointed out and taken care of, lest they create unavoidable confusion among newcomers who may use this guide. First off, definitions of entities are somewhat blurry. **Point entities**: You wouldn't want to say they "don't need alteration in size". Alteration of their size is, naturally, impossible, since they are point-sized entities. Better way of describing them would be saying just that - their size is that of infinitely small point and they are not associated with any brush body. **Brush entities**: To define them in a way similar to point entities, one could say that brush entities always have one or more brushes associated with them, and inside game these entities operate in some way on that group of brushes, putting them into interactive part of game world - as opposed to static part made of simple world brushes. Finally, **brush**: Valid brush is a convex 3D object of non-zero volume (that's kinda important, because it's easy to screw up with vertex manipulation and make it zero). Another important point is that two or more sides of brush cannot lie in the same plane. In GoldSrc engine brushes have limit of 32 sides each. Brushes can be either world brushes or entity brushes. Here comes one of big mistakes in your guide: All of brush faces contribute towards **wpoly** count, whether they're assigned to entity or not. What really makes up **epoly** are all the models (model polygons, to be precise) that are currently drawn by engine. These are weapon models, projectiles (grenades and such), player models, custom props placed on level by creator, etc. Then follows another serious mistake. BSP leaves (visleaf is essentialy an alias) are not surfaces of brushes. Leaves are convex 3D volumes created when BSP tree is built. These volumes are defined by, and lie _inbetween_ static world brushes. At any given time you move around your map, you are inside one or more of these BSP leaves. Knowing which leaves you're in, engine draws only those objects that are in your current _Potential Visibility Set_, PVS for short. PVS is made of all leaves that you are inside plus **all other leaves that can be seen by them**. This calculation of "which leaf can see which" is done by VIS compiler beforehand, and it can take hours if your map contains too many world brushes. Here are couple of links that might give you an insight into BSP tree theory, first and second. And another with a little bit more illustrations. Now speaking of smaller problems, it's worth noting that with modern RAD compilers, entity brushes can be forced to cast shadows as well. Naturally, this won't mean they gonna seal your map like world brushes do. And like I mentioned already, world brushes & entity brushes both create world polygons, **wpoly**. Their drawing costs are not that far off, with entity brushes still taking a bit of lead, seeing how they can have special surface rendering properties like transparency. With due fixing, I'm sure this guide might present a fair piece of help for new mappers. By the way, if you need to type some examples of entity classes, use backward slash before underscore, like that: light\_environment. Good luck!
    • Helpful x 1
    • Thanks x 1
    URL to post: