Level Design - Meshes & Materials [Calibas Tutorials #5]
This tutorial will go over some of the more complicated parts of making a custom map. I'll show you how to create meshes, transform meshes and also how to apply textures to them with materials.
Next I'll go over how a mesh works, which is a way of constructing a 3d shape using vertices, edges and faces. If you don't know what those terms mean, you can learn about them here.
To start, I'm going to go with a very basic mesh, a block, and luckily there's the Block Tool (Shift-B) which makes creating them very easy. After selecting the tool, click and drag in the 3d viewport to set the length and width of the block, then click and drag the little blue balls to set the height. When it's the size you want, press Enter to complete the geometry.
Also, the Block Tool is not just for blocks, you can create things like spheres and cones with it too. If you switch back to the tool, you can see a full list of geometry types within the tool properties pane.
Now I can make this box into just about anything through Hammer, it's a decent 3d modeling program. For a quick demonstration, I'm gonna use the Translate Tool in the Edges select mode (2) to turn part of the block into a ramp.
The edge that's highlighted in yellow is the one I have selected above, and I'm going to drag the red arrow to the left to move the whole edge (and the two vertices at either end).
You can move around individual vertices, or whole faces the same way. To add more vertices, edges and faces, you can use the Edge Cut Tool located within the Tool Properties. If you want a more in depth guide to all of this, check out Valve's series on mesh editing.
Chances are you want a different texture on your mesh than that default grey one, and to change that we'll set the mesh to use a different material. Materials are much more than just textures, though for the moment a texture is all we need. In the bottom left is the Active Material pane, hit the Browse button to see a list of all materials. For me the list is over 7,000 items long, so I'll narrow that down some by typing "tile stone" into the Name Filter. I'm going to use tile_stone_000_75.vmat and I select it by double clicking.
Simply drag the material from the Active Material pane onto the mesh itself to apply it.
Let's say you want to edit a part of the map you created with the Tile Editor tool. You can't select the tiles directly in the same way you can with an object or the mesh we created above. First you'll have to "collapse" the tiles, which will convert them into a mesh you can edit.
First switch to the Tile Editor tool (Shift-C), then choose the Select mode (I), which will allow you to select the tiles, props, trees and plants that you placed with the Tile Editor tool. I'm going to select a single tile of plain green grass, the click the Collapse button to turn it into an editable mesh.
Now I'm going to use the Selection tool (Shift-S) using the Faces mode (3) and I'll select the 4 faces in the middle of the mesh. After I've got them selected, I'll switch over to the Translate tool, to move them around.
Now I'll drag the blue arrow down one step, and voilà, I've made a hole in the ground! For finer control, you can hold the Ctrl key while dragging and it wont snap things to the grid anymore.
You can also directly edit the meshes of any models you've placed, and that's done by selecting the model, right-clicking on it, going to Selected Props, and then clicking Convert To Editable Mesh (Ctrl-Shift-T).
Materials and meshes can also be used to create things like triggers (something I'll save for a later tutorial) and they can be used to set clipping, which blocks unit movement. The main Dota 2 map uses clipping meshes all around the edge of the map, here's what it looks like:
Creating your own clipping mesh is very simple. To make things easy, first select toolsskip.vmat in the Active Material pane and you can also see more of the tool materials by typing "tools" into the name filter of the material browser. Then switch to the Block Tool (Shift-B) and draw a new mesh directly over the stone mesh we drew earlier.
Units will no longer be able to move into the blue box. For more on unit navigation and clip materials, refer to the Navigation Mesh page on Valve's site.
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.