Modular Dungeon Survival Guide: Part 1
This tutorial will cover making a pretty basic dungeon using the Modular Dungeon Kit in Unity 3.5.5. After the initial creation of the basic dungeon I'll move on to using the MDK expansion 1: Stairs and MidWalls to give your dungeons a bit of depth.
Okay, so where to begin? Since I'm writing this as I'm creating it to make sure I dont forget something, let's begin with a clean slate. So create a new project and import your Dungeon asset package(s), and Save the scene as whatever you like.
Now we can start building. In the Project tab, find the Prefab_Pieces folder. This will contain most of what you're looking for as the prefabs have the colliders already attached so its just one less step for later. Grab a Floor_1_Prefab and drag it into the scene, and zero it on the x,y and z tranform position planes. (Image 1).
So lets get this looking like something. Drag out a Wall_1_Prefab and a Pillar_1_Prefab into the scene and zero them both up on the x,y,z as well. Zeroing out is a bit of a pain, but rest easy knowing that it'll be the last time you'll need to do it, as the rest of the building will be done via vertex snapping. So lets give that a shot. With select and move active, click on the pillar and hold down the V key, and position the cursor close to the bottom center vertex. When it snaps into position, left click and drag it towards the corner of floor tile.....ta dah!! In theory it should be snapped to the corner of the floor tile.....and honestly, thats as hard as it gets (image 2).
The Dungeon sets are all designed to make heavy use of the vertex snap as it allows you to build large intricate dungeons fast without having to type in a ton of xyz positions or even worse....doing math. Now with our pillar in position lets get that wall over there as well. While having the pillar still selected, copy the x transform postion and paste it to the x position for the wall. This snaps it beside the pillar and you have the basis for creating your whole dungeon now.
Lets take this one piece and make ourselves a 9 x 9 room. Select all 3 pieces and hit Ctrl+D to duplicate the selected objects. Hold down the V key and hover over the exposed corner of the floor 'til it snaps, hold down the left mouse and snap it to the far side of the floor tile. Repeat that to give yourself a 3 piece wall. One early tip for snapping and keeping your sanity, is to always grab for the most exposed vertex you can find that will be easily snapped to another exposed vertex. With a dungeon this simple, finding these vertices will be quite easy, but once we start getting into multi-level builds the vertices will be a bit trickier to snap to. (Image 3)
At this point, I'm just going to assume you'er a snapping and duplicating wizard. So just shift click to grab all 3 floor tiles and duplicate and snap then into position like so. (Image 4)
Now let's select that whole far wall and floor (not including the 3 new floor tiles we just put down). Disclaimer: This is my work around for not being able to figure how to rotate multiple objects in a selection without each individual object just rotating on it's own axis when I type in the rotation....and this "work around" takes all of 5 seconds and cleans up a bit o' clutter in the Hierarchy window :). In order to rotate this whole chunk, we want to parent this up and move it as a whole. With all pieces selected, go to the Hierarchy tab and left click any one of the highlighted, highlit....oh you know what I'm saying.....and just drag it slightly off to the left or right 'til you see a shortcut icon and release it. Viola, you just parented all that stuff together and made your Hierarchy tab way easier on the eyes. Duplicate it and rotate 180 and snap it into position. Now repeat that process with just the wall, parenting them together, duplicating, rotating 90 and snapping it into position. One more duplicate and rotate it -90 and you have yourself a 3 x 3 dungeon like so. (Image5)
There you have it. The perfect but incredibly boring dungeon. A lil' too perfect really, since you can't get in or out, so let's fix that next. Grab the Wall_Arch_Prefab from the prefab pieces folder and drop it into the scene. Now zero this up and pretend I didnt tell you earlier that you'll never have to do that again. With it now zeroed, go switch the scene view over to Wireframe and go to the top view. (image 6) Now just drag it into whatever wall you want to be your entrance/exit, and delete the wall that it's sitting on. It's not the most elegant solution, but it works so just do it. Once you have this arch set up, it's a good idea to parent it to either of the pillars that it sits next to. That way the next arch you need to drop, you can duplicate this and just use the snap point of the pillar.
And that's it really for the main dungeon portion. It's mostly just snapping, duplicating, and making use of parenting. Also included in the Modular Dungeon Kit are some prefab rooms, corners and hallways to make things even easier.