Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Unreal Development Kit Beginner's Guide

You're reading from  Unreal Development Kit Beginner's Guide

Product type Book
Published in Aug 2011
Publisher Packt
ISBN-13 9781849690522
Pages 244 pages
Edition 1st Edition
Languages
Author (1):
Richard Moore Richard Moore
Profile icon Richard Moore

Table of Contents (17) Chapters

Unreal Development Kit 3
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Pop Quiz Answers
1. Level Design HQ 2. Hello UDK 3. Applying Lighting Effects 4. Battling the Elements 5. Movement with Movers 6. Terrain 7. Adding Gameplay Elements into your Map 8. Complex Event Sequences 9. Materials Index

Chapter 2. Hello UDK

UDK basics covers the most essential tools and functions you need to know to get started with UDK. You'll be able to quickly jump into UDK and begin feeling comfortable using the most commonly used functions.

In this chapter, we will learn the following:

  • Setup, where to save the file, what to name it

  • The builder brush and our first cube

  • Geometry editing tool

  • Building our first room

  • Placing lights and a player start

  • Creating a hallway and a second room

  • Applying materials to CSG surfaces

  • Test map and add bots

This is where the fun really starts. We will begin the first stages of creating our map by creating a small room, and then move onto adding features like lighting, materials, textures, and static meshes. This will be followed by adding a player start and testing our map with bots.

Your first map


You will build your first level using the unreal in-editor modeling system, Constructive Solid Geometry (CSG), also referred to as BSP.

Time for action – setup, where to save the file, what to name it


  1. Go to File | New, a window will pop up asking what geometry style you want, select Additive. Not only is it more appropriate for most level designs, but also I've seen some weird bugs with Subtractive mode in UDK.

  2. Before we begin working, let's pick a name and save our file. For the purposes of this test, we'll use DM-CSGTest01.udk. Unreal figures out what game type you're making based on the map name. So by choosing DM-, we'll get a Deathmatch map, and all of the associated gameplay that comes with it as default lead-out. Go to File | Save. Unreal works best if you put your map in a specific folder, which you may have to create as follows:

    C:\UDK\UDK-VersionRelease\UDKGame\Content\Maps and name it DM-CSGTest01.udk.

  3. Let's also do some viewport configuration to make editing easier. Click on View | Viewport Configuration | 1x2 Split. This will put your perspective view on the left and your top, and side 2D views on the right.

  4. Click...

Why CSG?


We're going to use CSG geometry to rough out our level. It's the in-editor 3D modeling tool. While you could rough out the level in a 3D application such as Maya, Max, or even AutoCad, CSG gives you an incredibly fast turnaround when you begin working out the gameplay of your level. It's much easier than going back-and-forth between the different software packages.

That said, CSG isn't good for anything very detailed. It's expensive, it's hard to work with, and is prone to errors if the geometry gets too complicated. For this reason, it's great for prototyping since you don't want to add much detail in the early stages. It's also suitable for some simple geometry in the final level, as you can see in some of the epic's maps.

Time for action – the builder brush and our first cube


At the center of your empty level is a red wireframe cube. This is the builder brush. Think of it as a rubber stamp. Whatever shape and size it is, that's the shape and size of the geometry that you're going to stamp down.

  1. Select the builder brush, then click on the CSG : Add button.

  2. This stamps a cube down into the world, as shown in the following screenshot:

  3. If you move the builder brush out of the way, you see that the cube stays in the 2D views. It appears as a blue wireframe box.

  4. Now select the blue additive brush in one of the 2D views and move it to the side.

  5. The checkerboard cube didn't move with it. When you modify existing the CSG, unreal requires you to rebuild for a simple cube move, which is pretty fast. But when you've got a whole level roughed-out in CSG, you wouldn't want unreal to pause and re-calculate all the time. Click on Build Geometry for Current Level, towards the top-right of the screen. You'll get some warnings,...

Subtractive


So say you wanted to create a room. You could place six additive cubes making up the walls, floor, and ceiling, but there's a better way to do it. In addition to additive, unreal has subtractive, and it does just what you'd think—it carves a hole in additive. Select the builder brush, move it so that it's partially intersecting with your additive brush, and click CSG : Subtract.

If you move the builder brush out of the way, you'll see that there's now a chunk taken out of your cube, and there's a yellow subtractive cube in the 2D view.

Try moving the subtractive brush around. You will again need to rebuild geometry in order for the changes to update in the 3D view.

Also, you can clone your additive or subtractive brushes by copying-and-pasting them (ctrl+c, ctrl+v), or by alt+dragging one of the movement handles. Play around a little more, intersect some more shapes, and rebuild. Get a feeling for the tools.

Brush Order


You may notice that sometimes a subtractive brush cuts into one additive brush, but not another.

This is because brushes are order dependent, they're like a set of commands such as Build this, Now cut into it, Now build on top of that, which are shown in the following screenshot:

If we want the subtractive brush to cut into both the additive brushes, we can make it the last command in the list. Select the subtractive brush, right-click on it, and select Order | To Last.

Now the brushes are in the order we want.

And if we rebuild geometry, we get the results we want.

And yes, you could have also selected the #3 additive brushes and clicked on Order | To First, to get the same result.

What just happened?

So we know how to use the builder brush tool to create our first cube. Let's go ahead and look at the geometry editing mode tool.

Time for action – geometry editing tool


Let's face it; it would be tough to build a level solely out of cubes. Let's look at some more advanced geometry editing. But first, save your work, create a new file, and save it as DM-CSGTest02.udk.

  1. Create a new additive brush, then click on the Geometry Mode button at the top-left corner of the window. This opens up the Geometry Tools dialog box. You can close it again by clicking on the button to the left, Camera Mode.

  2. Working with edges is the easiest way to get started, so click on the Edge button, and select your additive cube.

  3. Make sure you're in the World mode (not Local).

  4. Then select an edge and try moving it around.

  5. Now our cube is an elongated rectangular box. Don't forget to rebuild geometry.

  6. You'll notice that when you selected the edge in the 2D view, it actually selected two edges in the 3D view—in my case, the top and bottom. This is really handy and what you want most of the time. But you can also make a ramp shape by selecting only one...

Time for action – building our first room


Time to create our first room, something we can actually run around in. Save your work, create a new file, and save it as DM-CSGTest03.udk.

We want our room to be big enough for the player to run around in. The builder brush is 256x256x256 by default, and the player is 88 units tall. That's going to feel a little cramped, so let's make our cube more like 1024x1024x512 units tall. What we're going to do is create an additive cube which is the size we want, and then hollow it out by using a slightly smaller subtractive cube. Select the builder brush and make sure you're in the Geometry mode. Yes, the geometry editing tools work on the builder brush too.

Also, resize your grid to 32 units either by using the controls in the bottom-right corner of the screen or the bracket [ ] keys. It's important to build on the grid so that we have an easier time-judging size, and so that when we expand our level later, everything lines up nicely. This is also why we...

Time for action – placing lights and a player start


In this section, we'll be placing actors, so we'll be mostly working in the 3D view. Close the Geometry tools window, click on the Camera Mode button, and save your work. First we'll place a light. It is easy—right-click on the ground, then click on Add Actor | Add Light (Point).

The light should appear where you clicked. Go to Lit mode, and you'll see your room appear with lighting now, though it looks a little strange, since the light is right on the floor.

Move the light up from the floor so it's in the middle of the room. You can also increase or decrease the light's radius using the Scale tool. Give it a try.

The last thing we need to do before we run is to Bake Lighting . Right now the light is calculated dynamically, which is expensive and unnecessary. If we bake it, it calculates texture maps for any light and shadows in the scene, which is much cheaper. Click on the Build Lighting tool that is right next to Build Geometry. The default...

Time for action – creating a hallway and a second room


At this point, you should be able to create a second room and a hallway without any more guidance, but I'll take this opportunity to show a few more tricks. Save your work, and then save it as a new file, DM-CSGTest04.udk.

We'll create the second room first, and then the hallway.

Instead of building the second room from scratch, let's select the first room and everything in it, and then clone it over. In one of the 2D views, ctrl+alt+drag a selection box around the entire room. We want the player start and the light too, which will be useful later.

Then alt+drag on the Move tool to copy the room over to the right side.

Press the Rebuild Geometry button, go to Unlit mode, and you should see both rooms in your 3D view. Remember that there are no lights outside, so the outer surfaces will show up black.

Time to create the hallway. We could clone a room again and shrink it down using the geometry editor tools, but let's build it from scratch...

Time for action – applying materials to CSG surfaces


It's time to get rid of that grey checkerboard pattern covering the walls and floor. You can apply either a material or a material instance to a surface. We'll discuss the differences later. Both types of materials show up in the generic browser with a green border.

Let's find a material that we can apply to our CSG surfaces. Open the generic browser, and in the filter list, check Material and Material Instance Constant. If you have anything else checked, like Static Mesh, uncheck it.

Click on some packages. Any of them starting with HU_ contain human environment assets, which is a good start. You'll see that a few materials show up, but not many. This is because the packages haven't been fully loaded yet.

Select a package, right-click on it, and select Fully Load. You can select multiple packages at the same time by ctrl+clicking on their names, or by shift+clicking to select a block. Select all of the HU_ packages now, and fully load them...

Surface Properties


Now let's look at how to change the alignment, rotation, or scale of your material. Select a face and go to View | Surface Properties (or hit F5).

The best way to learn the tool is to try it out for yourself.

Panning and rotating are easy; just click the button you want and the material updates on the surface. You can shift+click on a button to move or rotate in the opposite direction. Changing the scale is nearly as easy, but once you select a scale option, you need to press the Apply button just to the right of the scale. The default scale is 1, and larger numbers mean that the material will cover a larger area. The other things you can control on this menu are the surface's lighting properties, but we'll discuss that in detail when we talk about lighting.

What just happened?

So our map has a little character to it. Let's now test our map, add some bots, and get an idea of what our map will play like.

Have a go hero – adding more elements to your level

So we know how to add...

Time for action – test map and add bots


I'll cover this in much more depth later, but it would be fun at this point to add some bots to the level. Make sure your map name starts with DM- and save your work. In the editor, click the Build All button to the right of Build Lighting.

Save your game and run it. Open up the console by pressing Tab, and type addbots 1. A bot should appear, and you can kill it.

To add more bots, add more player start nodes, rebuild all, run the level, and type addbots [number] in the console. Have fun with it. Try adding some additional rooms, and make a more interesting layout. See if you can make ramps to rooms at different heights, or raised platforms inside the room.

What just happened?

So we have now tested our map with bots and have an idea of what our map will play like with these two rooms and a hallway.

Have a go hero – content browser

So we know how to add a player start, but what else can we add to our level. Open up the content browser and see if you can add...

Summary


We learned a lot in this chapter.

Specifically, we covered:

  • How to set up our level and configure viewport options and unlit settings

  • How to build a basic room

  • How to add light to our basic room

  • How to add player starts to our level

  • How to create surfaces in our room

  • How to apply a material to a surface

  • Finally, how to test our level and add bots

We know how to create a basic room and add characteristics such as light and materials to surfaces, we also know how to test our map with bots. We're now ready to look further into lighting and how to get the most out of it.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Unreal Development Kit Beginner's Guide
Published in: Aug 2011 Publisher: Packt ISBN-13: 9781849690522
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}