I originally posted this on tf2maps.net. Because I'm sure a lot of people here don't like that site, I'm bringing it over here as well.
Hi! This is a mapper's 101 guide. While it's not going to show you have to make a full 5CP map, because hammer sucks, I'm going to go over what I think the important basics are, when it comes to making TF2 maps. I don't know everything, though, so there might be something useful to know that I don't mention. Well, I'm bad at this, so let's get started.
If you can't read any image, use the context menu to open it directly.
The first thing we want to do is locate Hammer, the map editor for TF2. It's distributed with TF2 now, so you're going to have to install the game if you want to map for it (how would you test without it...?). Right now, it gets downloaded to "steamapps/common/Team Fortress 2/bin", as hammer.exe and hammer.bat. You'll probably want to run hammer.bat, because it sets up important environment variables for hammer to function properly.
https://dl.dropboxusercontent.com/u/1811521/hammer1.png
(This is how hammer should look when you first run it. If it doesn't, enable everything under View -> Screen Elements.)
So, you go run hammer, and... What's all this interface? Well, I guess it would be easier to explain if you make a new empty map first. Do that from the file menu, and I'll highlight the important tools for you:
https://dl.dropboxusercontent.com/u/1811521/hammer2.png
It's a lot to take in at once, but you can ignore it for now. We're going to go through the basics and make a very rudimentary TF2 map.
Let's start with some geometry. We don't want to do anything special, so we're just going to make a box (there's a reason for that). Start by hitting "browse" on the right side of the screen, right next to the texture icon.
https://dl.dropboxusercontent.com/u/1811521/hammer3.png
You should see something like this. Don't worry if things are different sizes, or you have different textures. Now, type "tf" into the Keywords (first) and "concrete floor" into the Filter (second).
https://dl.dropboxusercontent.com/u/1811521/hammer4.png
You should see something like this. Don't worry if the icons are different or you don't see something that I do. Pick one of the plain ones and double click it. The browser will close, but notice that the texture icon on the right side of the screen changed (if you didn't pick the one that was there). That's the active texture, that the texture tools are using, and that "brushes" will use when you create them. I'm going to explain that next.
Click the Block Tool on the left side of the screen. It's the gray shaded cube. Then, drag it across one of the grids you see on the screen.
https://dl.dropboxusercontent.com/u/1811521/hammer5.png
You should see something like this. If you see two wide ones and one rectangular one like I did, you picked the right grid. Otherwise, pick a different grid until you get it. Also, don't worry if it's not the same size as mine. The size isn't important, as long as it's fairly large. Hit enter.
https://dl.dropboxusercontent.com/u/1811521/hammer6.png
You just created a brush! But you can't really see it yet, because the camera might be inside of it. If it is, like in my screenshot right there, you have to move the camera out of it. Click whichever view says "camera", and wasd around until you're outside of it. You can also use the Camera tool to change your view angle, or hit "z" to toggle an FPS-style mouse lock.
https://dl.dropboxusercontent.com/u/1811521/hammer7.png
I made a brush! So... Now what? You need to make the walls. Do that texture browser thing from earlier, but choose a wall texture instead of a floor one. It doesn't matter that much what you pick, though. Finally, in one of the grid views that seems to be looking at the side of your floor brush, do something like this with the block tool:
https://dl.dropboxusercontent.com/u/1811521/hammer8.png
You're making a wall! And it's the same size as the floor, at least in the views that you didn't drag on. That's one of hammer's subtler features, you're going to have to get the hang of it yourself. Anyway, hit enter to make this brush, and do it for the other four walls too.
https://dl.dropboxusercontent.com/u/1811521/hammer9.png
I made a box! I can get it ingame now, right? Well, no, there are some important things that the map needs to compile and run correctly. First of all, you need lighting. The best way to make sure you have lighting is to add a skybox, and an entity that tells the skybox how to make the sun shine on the map. Select the skybox texture by searching for "sky tool" in the texture browser (if it doesn't show up, try removing the "tf" keyword). Then, do something like this for the sides and top of the map.
https://dl.dropboxusercontent.com/u/1811521/hammer10.png
This is great, because it kills two birds with one stone! First of all, anywhere that's "inside" the map needs to be entirely "sealed off" from the "void" outside of the map. We're going to put a player spawning point on the floor, which makes that the "inside", because anywhere that there's an entity is an "inside". Not like we could put it anywhere else, because that would be in the void. Anyway, we have a couple of entities to place.
Click that little knob on the left side of the screen, right above the gray shaded cube. Better late than never, notice the section in the lower right part of hammer that says "Categories" and "Objects". After clicking the knob, it should say something like "Entities" and "info_player_teamspawn". If it doesn't, select those or type them in. Autocomplete can finish for you, if you want. Finally, click on the floor in the 3d view.
https://dl.dropboxusercontent.com/u/1811521/hammer11.png
Don't worry if you don't see a cute multicolored engineer with a beard, like I do. The important part is that you typed everything in correctly.
We're done, right? We have a skybox and player spawns and the spawns are sealed off from the void. Well, we have to define how the light comes out of the sky, too. Make a light_environment entity, and set its pitch to something negative. Preferably something between -45 and -90. This makes the sun shine down, instead of appearing from the horizon. Hit Apply, and we're finally done. How do we get this map in the game?
https://dl.dropboxusercontent.com/u/1811521/hammer12.png
There's a little icon in the top right of the screen, to the left of the green leaf, that looks like a controller. I'll click it, give it a big red circle to point it out, then explain what everything does.
https://dl.dropboxusercontent.com/u/1811521/hammer13.png
So, when you want to play a map you made in TF2, it has to be compiled. This is a process that takes the map source that you can save and load (a "vmf") and turns it into a file that the game loads up and makes the actual ingame map out of (a bsp). There's a ton of stuff that the compiling process needs to do, because the game uses a lot of data straight out of the map instead of figuring it out while it's running.
(CONTINUED)
[i]I originally posted this on tf2maps.net. Because I'm sure a lot of people here don't like that site, I'm bringing it over here as well.[/i]
Hi! This is a mapper's 101 guide. While it's not going to show you have to make a full 5CP map, because hammer sucks, I'm going to go over what I think the important basics are, when it comes to making TF2 maps. I don't know everything, though, so there might be something useful to know that I don't mention. Well, I'm bad at this, so let's get started.
If you can't read any image, use the context menu to open it directly.
The first thing we want to do is locate Hammer, the map editor for TF2. It's distributed with TF2 now, so you're going to have to install the game if you want to map for it (how would you test without it...?). Right now, it gets downloaded to "steamapps/common/Team Fortress 2/bin", as hammer.exe and hammer.bat. You'll probably want to run hammer.bat, because it sets up important environment variables for hammer to function properly.
[img]https://dl.dropboxusercontent.com/u/1811521/hammer1.png[/img]
(This is how hammer should look when you first run it. If it doesn't, enable everything under View -> Screen Elements.)
So, you go run hammer, and... What's all this interface? Well, I guess it would be easier to explain if you make a new empty map first. Do that from the file menu, and I'll highlight the important tools for you:
[img]https://dl.dropboxusercontent.com/u/1811521/hammer2.png[/img]
It's a lot to take in at once, but you can ignore it for now. We're going to go through the basics and make a very rudimentary TF2 map.
Let's start with some geometry. We don't want to do anything special, so we're just going to make a box (there's a reason for that). Start by hitting "browse" on the right side of the screen, right next to the texture icon.
[img]https://dl.dropboxusercontent.com/u/1811521/hammer3.png[/img]
You should see something like this. Don't worry if things are different sizes, or you have different textures. Now, type "tf" into the Keywords (first) and "concrete floor" into the Filter (second).
[img]https://dl.dropboxusercontent.com/u/1811521/hammer4.png[/img]
You should see something like this. Don't worry if the icons are different or you don't see something that I do. Pick one of the plain ones and double click it. The browser will close, but notice that the texture icon on the right side of the screen changed (if you didn't pick the one that was there). That's the active texture, that the texture tools are using, and that "brushes" will use when you create them. I'm going to explain that next.
Click the Block Tool on the left side of the screen. It's the gray shaded cube. Then, drag it across one of the grids you see on the screen.
[img]https://dl.dropboxusercontent.com/u/1811521/hammer5.png[/img]
You should see something like this. If you see two wide ones and one rectangular one like I did, you picked the right grid. Otherwise, pick a different grid until you get it. Also, don't worry if it's not the same size as mine. The size isn't important, as long as it's fairly large. Hit enter.
[img]https://dl.dropboxusercontent.com/u/1811521/hammer6.png[/img]
You just created a brush! But you can't really see it yet, because the camera might be inside of it. If it is, like in my screenshot right there, you have to move the camera out of it. Click whichever view says "camera", and wasd around until you're outside of it. You can also use the Camera tool to change your view angle, or hit "z" to toggle an FPS-style mouse lock.
[img]https://dl.dropboxusercontent.com/u/1811521/hammer7.png[/img]
I made a brush! So... Now what? You need to make the walls. Do that texture browser thing from earlier, but choose a wall texture instead of a floor one. It doesn't matter that much what you pick, though. Finally, in one of the grid views that seems to be looking at the side of your floor brush, do something like this with the block tool:
[img]https://dl.dropboxusercontent.com/u/1811521/hammer8.png[/img]
You're making a wall! And it's the same size as the floor, at least in the views that you didn't drag on. That's one of hammer's subtler features, you're going to have to get the hang of it yourself. Anyway, hit enter to make this brush, and do it for the other four walls too.
[img]https://dl.dropboxusercontent.com/u/1811521/hammer9.png[/img]
I made a box! I can get it ingame now, right? Well, no, there are some important things that the map needs to compile and run correctly. First of all, you need lighting. The best way to make sure you have lighting is to add a skybox, and an entity that tells the skybox how to make the sun shine on the map. Select the skybox texture by searching for "sky tool" in the texture browser (if it doesn't show up, try removing the "tf" keyword). Then, do something like this for the sides and top of the map.
[img]https://dl.dropboxusercontent.com/u/1811521/hammer10.png[/img]
This is great, because it kills two birds with one stone! First of all, anywhere that's "inside" the map needs to be entirely "sealed off" from the "void" outside of the map. We're going to put a player spawning point on the floor, which makes that the "inside", because anywhere that there's an entity is an "inside". Not like we could put it anywhere else, because that would be in the void. Anyway, we have a couple of entities to place.
Click that little knob on the left side of the screen, right above the gray shaded cube. Better late than never, notice the section in the lower right part of hammer that says "Categories" and "Objects". After clicking the knob, it should say something like "Entities" and "info_player_teamspawn". If it doesn't, select those or type them in. Autocomplete can finish for you, if you want. Finally, click on the floor in the 3d view.
[img]https://dl.dropboxusercontent.com/u/1811521/hammer11.png[/img]
Don't worry if you don't see a cute multicolored engineer with a beard, like I do. The important part is that you typed everything in correctly.
We're done, right? We have a skybox and player spawns and the spawns are sealed off from the void. Well, we have to define how the light comes out of the sky, too. Make a light_environment entity, and set its pitch to something negative. Preferably something between -45 and -90. This makes the sun shine down, instead of appearing from the horizon. Hit Apply, and we're finally done. How do we get this map in the game?
[img]https://dl.dropboxusercontent.com/u/1811521/hammer12.png[/img]
There's a little icon in the top right of the screen, to the left of the green leaf, that looks like a controller. I'll click it, give it a big red circle to point it out, then explain what everything does.
[img]https://dl.dropboxusercontent.com/u/1811521/hammer13.png[/img]
So, when you want to play a map you made in TF2, it has to be compiled. This is a process that takes the map source that you can save and load (a "vmf") and turns it into a file that the game loads up and makes the actual ingame map out of (a bsp). There's a ton of stuff that the compiling process needs to do, because the game uses a lot of data straight out of the map instead of figuring it out while it's running.
(CONTINUED)
First, there's a program called "vbsp". This is the backbone of the compiling process. It converts all the level geometry into a data structure called a "binary space partition", and assigns different entities and pieces of geometry to parts of that data structure. I'll spare you the details, but it sets up everything that the game engine needs to actually run the map. The data structure is the reason that the map needs to be hollow geometry that's totally sealed from the outside. This makes almost everything that the game does incredibly cheap to calculate.
Second, there's a program called "vvis". To put it simply, it decides which parts of the map can see which other parts. If it weren't for this, every map in the game would render everything all at the same time no matter where you are. Isn't that terrible?
Third, there's a program called "vrad". It figured out how everything and every area in the level is lit. It's the difference between a map with shadows and indoor lighting and walls that look different from eachother, and a fullbright map.
Finally, the compiliation process copies the finished bsp file into TF2's maps folder.
Sorry for the long-winded explanation, but it's good to have a general idea of how these things work earlier rather than later. Anyway, let's run the compilation process and play our new map, right? Just hit "OK", and watch the compile log run by and TF2 start up with our new map!
https://dl.dropboxusercontent.com/u/1811521/hammer14.png
If you didn't make any mistakes, your map should look something like this. If something is totally wrong, like the lights missing, or being too strong, copy the compilation log into this online utility (everyone does it): http://www.interlopers.net/errors/
That's the first new image in a while! Doesn't it look nice? There's not much to it, and I wouldn't play on it for very long, but it's a basic map that works right, and you can take what you learned here, and learning other things that are much more TF2 specific (like "How do I make a map be a KotH map?"), make really good maps.
THINGS YOU'LL NEED TO KNOW LATER:
Download and install this immediately: http://forums.tf2maps.net/showthread.php?t=4674
It's also a useful prefab for gamemodes, so that you don't need to make the entities every time.
For mathematical reasons, brushes absolutely always need to be convex pieces of geometry. If they're not, hammer will throw a hissy fit and break things.
Go look up what a func_detail is and how it's used. This is necessary.
Read a basic tutorial on entity input/output logic.
First, there's a program called "vbsp". This is the backbone of the compiling process. It converts all the level geometry into a data structure called a "binary space partition", and assigns different entities and pieces of geometry to parts of that data structure. I'll spare you the details, but it sets up everything that the game engine needs to actually run the map. The data structure is the reason that the map needs to be hollow geometry that's totally sealed from the outside. This makes almost everything that the game does incredibly cheap to calculate.
Second, there's a program called "vvis". To put it simply, it decides which parts of the map can see which other parts. If it weren't for this, every map in the game would render everything all at the same time no matter where you are. Isn't that terrible?
Third, there's a program called "vrad". It figured out how everything and every area in the level is lit. It's the difference between a map with shadows and indoor lighting and walls that look different from eachother, and a [url=http://imageshack.us/a/img386/7949/csmilitia0000tb8.jpg]fullbright map.[/url]
Finally, the compiliation process copies the finished bsp file into TF2's maps folder.
Sorry for the long-winded explanation, but it's good to have a general idea of how these things work earlier rather than later. Anyway, let's run the compilation process and play our new map, right? Just hit "OK", and watch the compile log run by and TF2 start up with our new map!
[img]https://dl.dropboxusercontent.com/u/1811521/hammer14.png[/img]
If you didn't make any mistakes, your map should look something like this. If something is totally wrong, like the lights missing, or being too strong, copy the compilation log into this online utility (everyone does it): [url]http://www.interlopers.net/errors/[/url]
That's the first new image in a while! Doesn't it look nice? There's not much to it, and I wouldn't play on it for very long, but it's a basic map that works right, and you can take what you learned here, and learning other things that are much more TF2 specific (like "How do I make a map be a KotH map?"), make really good maps.
THINGS YOU'LL NEED TO KNOW LATER:
Download and install this immediately: [url]http://forums.tf2maps.net/showthread.php?t=4674[/url]
It's also a useful prefab for gamemodes, so that you don't need to make the entities every time.
For mathematical reasons, brushes absolutely always need to be convex pieces of geometry. If they're not, hammer will throw a hissy fit and break things.
Go look up what a func_detail is and how it's used. [i]This is necessary[/i].
Read a basic tutorial on entity input/output logic.
Thanks, gonna be really useful!
Thanks, gonna be really useful!
Awesome guide! I felt adding onto this thread instead for making a new one would work out better. This guy has some of the best guides ive found on youtube: http://www.youtube.com/user/MrJohnzee/videos
Awesome guide! I felt adding onto this thread instead for making a new one would work out better. This guy has some of the best guides ive found on youtube: http://www.youtube.com/user/MrJohnzee/videos
I think sharing some video tutorials is a great idea for all the people that have trouble paying attention to long text guides.
I think sharing some video tutorials is a great idea for all the people that have trouble paying attention to long text guides.
A prolific community mapper, Crash (think koth_wubwubwub) started a good video tutorial series that works similarly to my text tutorial here. He's going to be going further than this text tutorial goes, so give him some eyes!
http://forums.tf2maps.net/showthread.php?t=24429
A prolific community mapper, Crash (think koth_wubwubwub) started a good video tutorial series that works similarly to my text tutorial here. He's going to be going further than this text tutorial goes, so give him some eyes!
http://forums.tf2maps.net/showthread.php?t=24429