Creating A Basic Dota-style Map [Calibas Tutorials #2]

edited March 2016 in Tutorials

This tutorial will show you how to create a basic single-lane map that uses the standard "defense of the ancient"(dota) rules. I'll go over how to place the essential structures, such as shops, towers and ancients, I'll show you how to place unit spawners, create pathing for the units, and also how to make the ancient invulnerable until a tower is destroyed. This tutorial assumes you have at least basic knowledge of creating Dota2 mods, if not, consider beginning with this tutorial.

enter image description here

Update: As of Reborn Beta, this was changed and the pvp example maps have been removed. You can still open dota.vmap if you want to see how the base game map works.

From the Asset Browser, click the Hammer button, then go to File -> New or press Ctrl-N. It will create a completely blank map, so first we'll generate a tile grid so we can at least see some ground.

In the left toolbar, at the very bottom, there's the Tile Editor, and you can also select it by pressing Shift-C. It will prompt you if you want to create a tile grid, so select Yes. Give it a few seconds, and you should see grass covering the whole map. The Tile Editor is an extremely useful tool, and I'll go over how to use it in the next tutorial, but for now you'll want to switch back to the Selection Tool.

So the idea here is to create two bases, a radiant (goodguys) and a dire (badguys), have creeps spawn in the bases, and then go attack the other base's ancient. Let's place the ancients first, so go to the prefabs tab in the asset pane, then scroll down to structure_ancient_dire.vmap and structure_ancient_radiant.vmap. You'll want to place them on opposite sides of the map, but not too close to the map's edges so there's room for structures behind them. Here's what my map looks like now:

enter image description here

Now to place some creep spawners, select the Entity Tool(Shift-E) from the left toolbar, it looks like a light bulb. Where it says Entity Class, scroll down and select npc_dota_spawner_bad_mid. This is the creep spawner for dire's middle lane. In the 3d viewport, place it in front of the dire ancient by simply clicking on the map where you want to place it. After placing it, go to the Object Properties pane and enter spawner_bad_mid in the Name field. The name is how other entities and scripts can reference this entity, which will come in handy in a sec. I should also mention that I had to use the name spawner_bad_mid to get the npc_dota_spawner_bad_mid entity to work. If I used another name, no creeps would spawn.

Now we need to create a path for the dire creeps to tell them how to get to the radiant ancient. Using the Entity Tool, choose the path_corner entity class and place it right next to the spawner. Then make sure to give it a name like you just did with the spawner, I'm calling mine dire_path_1. Now place another path_corner entity right next to the radiant ancient, and name that one dire_path_2.

Next is connecting the spawner and the two path_corners together so we've got a full path. First select the spawner, then in Object Properties pane scroll down to the First Waypoint field. In that field, you can either type in dire_path_1 or click the little down arrow for a list of entities and select dire_path_1 from there. Then select the path_corner entity named dire_path_1, and set the Next stop target field in the Object Properties to dire_path_2. You should now see a line connecting the two path entities, and if you don't make sure "Show Helpers" is active (Ctrl-Shift-H). Here's what my 3d viewport looks like now:

enter image description here

Now you'll want to do the exact same thing again, except this time with for the radiant side. Place a npc_dota_spawner_good_mid entity by the radiant ancient, a path_corner entity near that spawner, then another path_corner entity near the dire ancient. Give them the names spawner_good_mid, radiant_path_1, and radiant_path_2 respectively. Just like before, set the First Waypoint field in the spawner to radiant_path_1, then select radiant_path_1 and set the Next stop target to radiant_path_2. You should now see two lines running side by side, one path for the radiant creeps, and one for the dire creeps.

Next we'll add a defensive tower on each side. In the Prefabs tab, down at the the bottom, you'll find structure_tower_radiant.vmap. Place the tower near the radiant ancient, along the creep path, and then do the same with a dire tower near the dire ancient. Your map should now look something like this:

enter image description here

Probably a good moment to save your map, which can be done with Ctrl-S.

Now the dire and radiant ancients are set to be invulnerable by default, and we'll need to make them vulnerable so the map can actually be won. In a normal Dota2 game, all the towers in a lane need to be destroyed before the ancient can be attacked, and we'll now set up our custom game the same way. Update: This was changed in Reborn Beta, and ancients are now vulnerable on creep spawn. In the Object Properties for the two ancients, set Invulnerability Link Count to 1 so we can make them invulnerable until their tower is destroyed.

We'll want to give our ancients names, so we can reference them from the towers. Select the dire ancient, then enter dire_ancient in the Target Name field, and do the same with the radiant ancient, naming it radiant_ancient. Select the dire tower, set the Target Name to dire_tower_1, and then press Alt-Enter to open the Object Properties window. If you only remember one keyboard shortcut, make sure it's Alt-Enter, that's the only way I know of to open the object properties window. It looks pretty much the same as the Object Properties pane, except for one big difference, the Outputs, Inputs and Map Variables tabs.

With the dire tower selected, and the Object Properties window open, go to the Outputs tab and click Add. Then in the "My output named" field select OnTowerKilled, in the "Target entities named" field select dire_ancient, and in the "Via this input" field select ReduceInvulnCount. Now select the radiant tower, name it radiant_tower_1 and go through the same process I described for the dire tower, except that you'll want to put in radiant_ancient for the "Target entities named" field. What you just did was make it so the ancients are no longer invulnerable when a tower is killed, and you can select an ancient, hit Alt-Enter, then go to the Inputs tab to make sure you entered everything correctly.

That's it for the tricky parts and we're almost finished. We just need to place spawn points, shops and fountains now. You'll likely want to put all three of those things close together behind the ancient to make a safe spawn point. Just try not to put the fountain too close to the ancient, at least if you want a fair map. In the Prefabs tab, you want to use structure_fountain_dire.vmap, shop_blacksmith_dire.vmap, and basic_entities_dire.vmap for the dire side of the map. The dire base should look something like this:

enter image description here

Over on the radiant side of the map, behind the ancient, place structure_fountain_radiant.vmap, shop_blacksmith_radiant.vmap, and basic_entities_radiant.vmap all close together, just like we did with the dire base. You may have noticed that suddenly fog appears on the map when you place the radiant basic entities, which can be a little annoying when working in Hammer. Simply press F5 (Fullbright) to turn it off, and F6 (All Lighting) to turn it back on again.

That should be everything you need for a really basic Dota2 custom map, so press F9 to build the map. Make sure you're on the Full Compile preset and have "Create minimap on load" selected, then hit Build. After a minute or two, your map will load up in the Dota2 client, and I recommend playing a full game solo to make sure everything works right.

If you have any problems or if you want to see an example of another map, you can load dota.vmap to see how everything is set up there. There's also a tutorial (covers alpha version of Workshop Tools) on Valve's site you can check out that covers some things I haven't gone over yet. It also recommends placing staging nodes on the map, though I personally don't see any performance difference whether I place them or not.

Also, if your map's not working correctly, check all the names you've entered in the Object Properties for things like typos. Make sure you've got the correct spawner names, for example the npc_dota_spawner_good_mid entity should be named spawner_good_mid.

That's it for this tutorial, you should now understand the basics of creating a Dota-style map. In the next tutorial I'll go over how to "paint" the terrain onto the map using the Tile Editor tool.

This part of a series of 7 tutorials that are designed to help the beginner get familiar with the Workshop Tools and they end with showing how to write a very simple script.

1. Getting Started, Your First Dota 2 Addon

2. Creating A Basic Dota-style Map

3. Level Design - Adding Terrain & Decorations

4. Level Design - Tilesets, Material Sets & Transitions

5. Level Design - Meshes & Materials

6. Material Editor - Creating New Materials and Overlays

7. Scripting - Basics