Team Fortress 2

Team Fortress 2

68 ratings
How To Create a MvM Map in Source Hammer
By Khorps and 1 collaborators
This is a guide on how to make Mann vs Machine maps since I haven't seen any tutorials and I have been taught I will share the information.
   
Award
Favorite
Favorited
Unfavorite
1: Basic, the Hatch and the Bomb
To start off we first need to create a map that you want to use for mvm_map.
I assume you know the basics of Source Hammer so I won't teach you how to create a room. Once your room is done you need a few required things a blue spawn for the robots, a red spawn for the defenders, a hatch, a bomb an upgrade station (optional) and finally a tf_logic_man_vs_machine

To create the hatch you need a prop_dynamic, the model for the hatch should be in props_mvm.

Next you need a trigger texture for the capturezone create this block above the hole or the robots will be jumping into the floor. Turn this block into a func_capturezone by selecting it and pressing Ctrl+T.
Select func_capturezone give it a name for this tutorial I will name it cp1 and set the team to blue.

Next you need a bomb, just drop an item_teamflag around the robots spawn, name it (I will be using the name bomb for this tutorial). Change the bomb's game type to Attack/Defend, team to blue and its model to atom_bomb which is in props_td.

If you want an upgrade station (which I'm sure most people do). Create a prop_dynamic at the defender's spawn and set a model for it (usually upgrade station in props_mvm). Next create a trigger texture again next to the model it will be a func_upgradestation.

Now place a game_round_win somewhere. Set the outputs in the func_capturezone to OnCapture (Name of the game_round_win) RoundWin. I don't have any idea where I placed my game_round_win so if there's a team variable set it to blue.

Finally just place a tf_logic_mann_vs_machine anywhere in your level.
2: Waves and spawnrooms
We don't want the player to go into the robots spawn so we need a spawnroom and a spawnroom visualizer. I'm not sure if nodraw breaks the level because of no skybox but just in case encase the level in skybox texture. Create a trigger texture block around the bots spawn turn it into a func_respawnroom, give it a name and set the team to blue. Now you need to create a respawnroomvisualizer to keep the defenders out of the robots spawn create a nodraw texture as a wall between the respawnroom and the map, set the front texture (the face that the players will see) to overlay/no_entry_nocull. Turn this into a func_respawnroomvisualizer. Set the Associated respawn room to the bluerespawnrooms name.
You can do this with the defenders room too.

Now to create the waves you can create a text file and rename its extension to pop but you have to figure out how to create waves and stuff like that with lots of brackets. So we're going to use old.mvm.tf or mvm.tf. Create you waves, squads and bots then click generate it will give you a pop file. Now put the pop file in your team fortress 2\tf\scripts\population folder if you don't have a population folder make one. Once that file's in there rename it to the name of your map.

If you put a tank, engineer or sniper in there theres a few things you'll need in your map. To make a path for the tank create an entity where your path begins called path_track name it boss_path_1 and set the next stop to boss_path_2. Next step is to create another one called boss_path_2 at a corner or where it turns or something and keep making another one until you get to the hatch once there DO NOT MAKE ANOTHER ONE the last stop will be where the tank deploys.

To give engineers a place to build place a bot_hint_engineer_nest where you want engis to build. Name it engineer_nest_1 and set the team to blue. To add a sentry hint and a teleporter hint place them where they're to be built and give them the same name as the nest they belong to.

Now all you need for snipers is to place a sniper hint where you want and set the team to blue.
3: Advanced mvm (improve your current setup)
Now I understand you learnt everything above and are ready to get a bit more advanced.

1. Advanced Hatch
Want to make your hatch look like how it does in valve mvm? It's easy (kinda)

First make sure you give your hatch a name such as, hatch_prop1.

Next make another hatch prop directly where the normal hatch is and make it into the broken version of your current hatch, this shouldn't be hard to find and may need to be rotated, name it hatch_prop2.
Make this 2nd hatch start disabled

Now make a info_particle_system and make the particle system name and name it cinefx_goldrush or mvm_hatch_destroy. Name it hatch_particle and put it under the hatch a tiny lil bit.
Make sure this stays start disabled
If you choose cinefx_goldrush be sure to set the pitch, roll and yaw to -90 270 0

Make a trigger_hurt and name it hatch_hurt, put it as a box around the hatch, make it surround the center of the hatch.
Make it start disabled

Finally make an ambient_generic and name it hatch_sound, set the Sound name to MVM.BombExplodes




Goto your capture zone and goto outputs, give it:
OnCapture; hatch_prop1; disable (with a preferable delay of 5)
OnCapture; hatch_prop2; enable (with a preferable delay of 5)
OnCapture; hatch_particle; start (with a preferable delay of 5)
OnCapture; hatch_hurt; enable (with a preferable delay of 5)
OnCapture; hatch_sound; PlaySound (with a preferable delay of 5)

2. Random/Alternative bot paths

This section will teach you how to create different bot paths and have bots choose between one or the other at the end of a wave.

First create a "logic_auto" and "logic_relay". Then name your logic_relay "bombpath_choose_relay". This will go into the logic_auto's outputs:

OnMapSpawn, bombpath_choose_relay, Trigger.

Now create 6 more logic_relays and one logic_case.
Name one relay: "bombpath_clearall_relay"
Name one relay: "bombpath_holograms_clear_relay"
Name one relay: "wave_start_relay"
Name one relay: "wave_finished_relay"
Name one relay: "bombpath_2_relay"
Name one relay: "bombpath_1_relay"
Then name the logic_case: "bombpath_choose_1_case"

You will now need some funch_nav_avoid brushes. The minimum is 2 (otherwise you don't need this system).
These trigger brushes are where bots will not go. They will avoid these func_nav_avoids.

Step 1, Insert these outputs into the wave_start_relay:

OnTrigger, bombpath_holograms_clear_relay, Trigger

Step 2, Insert these outputs into the bombpath_choose_relay:

OnTrigger, bombpath_choose_relay, Disable (It's disabling itself FYI)
OnTrigger, bombpath_clearall_relay, Trigger, 0.10
OnTrigger, bombpath_choose_1_case, PickRandom, 0.50
OnTrigger, bombpath_choose_relay, Enable, 0.60

Step 3, Insert this output into your "wave_finished_relay".

OnTrigger, bombpath_choose_relay, Trigger

Step 4, Now create some prop_dynamics. One will be "models/props_mvm/robot_hologram.mdl"
the other will be "models/props_mvm/hologram_projector.mdl". Create these whereever you need to and name one of the holograms "bombpath_hologram_1". Another "bombpath_hologram_2".

Step 5, Go into the outputs of your logic_case and add these:

OnCase01, bombpath_1_relay, Trigger
OnCase02, bombpath_2_relay, Trigger

Step 6, Name the func_nav_avoid brushes you made earlier "bombpath_1_nav_avoid" and "bombpath_2_nav_avoid".

Step 7, Go into your bombpath_holograms_clear_relay. Set these outputs:

OnTrigger, bombpath_hologram_1, Disable
OnTrigger, bombpath_hologram_2, Disable

Step 8, Insert these exact outputs into bombpath_2_relay:

OnTrigger, bombpath_1_nav_avoid, Enable
OnTrigger, bombpath_hologram_2, Enable

We enable the first nav_avoid because we want to stop them from going to the area of the first nav_avoid.

Step 9, Insert these outputs into your bombpath_1_relay:

OnTrigger, bombpath_2_nav_avoid, Enable
OnTrigger, bombpath_hologram_1, Enable

Step 10, Insert these outputs into the bombpath_clearall_relay:

OnTrigger, bombpath_1_nav_avoid, Disable
OnTrigger, bombpath_2_nav_avoid, Disable

Step 11, Make sure all func_nav_avoids have their team set to blue (so only robots obey them).

Step 12, Optional create a func_flagdetectionzone near the bomb hatch and set it's team to blue with these outputs:

OnStartTouchFlag, bombpath_clearall_relay, Trigger

If you test it and you find it doesn't work post the error in the comments. This is a very confusing part of mvm mapmaking I wouldn't be surprised if I missed something.

Note: Make sure there is a wall seperating the func_nav_avoids or else the bots might not obey it.
4: Last stuff
One last thing READ IF YOU WILL HAVE TANKS IN YOUR MAP.
There is a problem where it will look like the tank deploys the bomb but the round won't end. This part will fix that. Create a logic_relay named "boss_deploy_relay". Make it blow up the hatch through the outputs and also make blue team win.

Now once you have all previous stuff done you can add decoration to your map other stuff you might find you want to add. But most importantly create a nav file for your map without a nav file waves won't work and bots will idle. To do this play your map and open the console, type sv_cheats 1 then nav_generate and you're done!

If you have questions feel free to ask and I will respond or if its common I will add it to the guide. I would also recommend asking tf2maps.net for any problems with .pop files and robot pathfinding and spawning.

Thank you Mr. Conga for teaching me how to create MvM maps and lots of other stuff.

As this guide is no longer supported (and for some reason I haven't been able to comment on the guide for awhile). If any mapper wants to contribute (or potentially update, I have no idea what kind of changes valve has made to MvM if any) then I can add you as a creator.
243 Comments
LukasRainbow Aug 17, 2023 @ 4:27pm 
I have problems with the Bots choosing a different path. Without a pop file, it works, but as soon as i load a file, the hologram arrows permanently dissapear and never come back. Additionally, the Bots choose the shortest Path to the Bomb, instead of avoiding the "func_nav_avoid"s.
Any help to this?
Wacev Apr 29, 2023 @ 12:27pm 
Can't find blue spawn room nav areas. No legal bomb drop areas are marked
I also tried nav_generate several times
Ceres Aug 25, 2022 @ 12:27pm 
I need help:
Can't find blue spawn room nav areas. No legal bomb drop areas are marked
Herba Jan 29, 2022 @ 2:36pm 
I am making a MVM map in Hammer but I don't know what I'm doing wrong with the Tank's spawning. I set up a custom set of waves made specifically for this map and on the second wave, a Tank is supposed to appear but when the wave starts, no tank appears
the depressed medic Oct 26, 2021 @ 5:08pm 
wtf I had to learn what .pop files are on my own and you never even bothered to mention that it required a notepad app.
I just assumed that was some other function of hammer and got stuck for three goddamn hours.
Tacplayz Aug 27, 2021 @ 8:37am 
Thank you!
xShoot4WarAmpsx Mar 21, 2020 @ 7:32pm 
I appreciate the thought however this guide makes too many assumptions on ones knowledge. I do have a room created but Im struggling with Step 1 as I have no idea where I am to find props_mvm nor do I understand what you are doing creating all the other aspects in the room.

For example: "Turn this block into a func_capturezone by selecting it and pressing Ctrl+T.
Select func_capturezone give it a name for this tutorial I will name it cp1 and set the team to blue."

I have no idea how to do this. The guide just assumes you do. This guide appears to be created for those with the same level of knowledge as the author which makes it useless because if I had this knowledge I would just do it without the guide.
Asafe Aug 28, 2019 @ 5:33am 
Need help, where i put or use the boss_dead_relay
₊˚.✩ Lushana ✩.˚ Jul 25, 2019 @ 5:28am 
Doesnt say how to make the mvm map Start With a Wave....
All it does is starts wave 0 And when i do my own wave it just does nothing
Dr00 Jan 24, 2019 @ 6:45pm 
Hey, do you still support this guide? If so, I'm having a problem with my bots spawning and all that. I've gotten a proper spawnroom trigger, nav and spawns ready-to-go, but they just don't appear when the timer hits zero. Now, I don't have a wave_start_relay and such, it's just the spawns and than some. Do I need those for robots to exist, or am I making another mistake?