Basic Rooms

advertisement
TUTORIAL 1
A Brief Introduction to UDK
Getting Started
The Grid
Adding and Subtracting Brushes
Creating Rooms with an Intersecting Corridor
The Content Browser
Geometry Mode – The Edit Tool
A BRIEF INTRODUCTION TO UDK
The Unreal Development Kit (UDK) is a free game editor aimed towards those who wish
to create their own game levels and content from scratch. If this is not your intent, you
could purchase for a small cost the Unreal Tournament 3 (UT3) game from Steam or
Amazon and use the myriad of ‘assets’ (objects, materials, etc) and modify (‘mod’) the
levels. Whilst the UT3 game engine interface is very similar to UDK’s, there are small
differences; this tutorial is written to support UDK.
You can download UDK from http://www.udk.com/
Getting Started
The link below covers some important information on setting up UDK and discusses
folder structures, launching the editor, creating desktop shortcuts, the autosave function
and how to use the content browser. You must familiarise yourself with the folder
structures before continuing.
http://www.worldofleveldesign.com/categories/udk/udk-basics-part1.php
Once you have viewed the above tutorial, (don’t panic if there are things you don’t
understand – we’ll cover them in time) it would be a good idea to familiarise yourself with
the User Interface. This is discussed in detail at: http://utmapping.wikidot.com/unrealedreference.
So lets get started. From the main
menu bar along the top of the window,
select File and from the drop down list
choose New.
You will see a screen as shown here
on the right:
2
The screen is split into four viewports. The top left window is a top down view, the top
right is the side view, the bottom right is the front view window, and the bottom left is the
3D perspective window. If this is not what you have got, you can change the viewports
by left clicking on the T, S, F or P or right click to bring up the menu drop down options.
To navigate in the 3D window hold down the right mouse button in the window and use
W,A,S,D or the arrow keys to move around. Notice than when you click on a particular
viewport, it is surrounded by a yellow border; this informs you which viewport is
activated.
Notice the red bordered cube inside the view ports. This is the ‘builder brush’. Builder
brushes, also known as BSP brushes (Binary Space Partition) allows a level designer to
quickly generate and edit basic environments, (e.g., rooms, corridors, etc) and for
creating ‘placeholders’ for objects (known as static meshes).
If you click on this brush you will see what is known as a ‘widget’ or ‘gizmo’. This will
appear when you select any object in your viewport and will allow you to move it around
just by left clicking on one of the arrows and dragging. Note: To move or edit
your BSP brushes you need to be in translation mode … select this icon on
the menubar …
3
The Grid
Before we continue, it is important to understand the use of ‘grid snapping’. It is
recommended you work with the grid snaps turned on. For some fine detailing it may be
necessary to turn it off or change the setting, but get into the habit of turning it back on
again for general work. The options are found at the bottom of your window under the
front viewport
:
Grid
Set to
check to turn on/off
select to change grid
rotation grid setting
select to change
scaling imcrements
select to change %
By default, the grid is set to 16 unreal units where each
square is equal to one foot. If you need to change the
setting, just click on the little black arrow and select from
the drop down menu, e.g.,
A useful detailed explanation can be seen at:
http://www.chrisalbeluhn.com/UT3_Modular_Snapping.html
4
On the left side of the window, right mouse click on the cube
icon. This will bring up the Cube brush builder properties
box. For now, keep the 256 x 256 x 256 default setting and
hit Build > Close.
At this stage, all we have done is set the size of the brush.
Adding and Subtracting Brushes
Locate the CSG (Constructive Solid Geometry) area from the toolbar on the left (under
the Brushes). If you hover over the icons, you will see the options to Add, Subtract,
Intersect or Deintersect. If you were to select the Subtract option right now, nothing
would happen. This is because the ‘world geometry’ is already an empty space, it
needs to be constructed with ‘Additives’ first.
Note: Older versions of UDK gave the option to select Additive/Subtractive when
creating a new file. The latest versions no longer have the Subtractive option. This is
because a subtractive level is an infinite amount of ‘solid mass’ which requires ‘carving
out’ and therefore takes longer for the engine to calculate – not very efficient!
5
Left click to add the brush. You will see the brush in the 3D view has been added.
Move the builder brush aside (or hit ‘b’ on the keyboard to hide it) and you will see the
added brush appears as a blue wireframe.
Now move the builder brush over the blue brush so that it overlaps a large portion, e.g.,
something like below … (you will need to adjust it accordingly in all viewports) …
and select the Subtract option.
6
Again, move the builder brush away. You will see
that the subtractive brush has removed mass from
the added brush. Subtractive brushes show as
yellow wireframes in the viewports.
At this point, have a play around adding and subtracting brushes.
You can change the brush type by selecting the brush,
right mouse click and from the drop down menu, select
CSG and select Additive or Subtractive accordingly.
When you do this, it may appear that nothing has
happened. You need to select Build from the main
menu > Geometry for Current Level. This will
update the geometry. This needs to be done
whenever you edit, move or rescale brushes.
The intersect / deintersect tools allows you to create new brushes. Create a cube and
move the builder brush so it covers just the upper half of the cube. Select the CSG
Intersect tool and subtract it. Move the builder brush, select the CSG deintersect tool
and this time add it. You can create some interesting (weird!) new geometry shapes –
have a play and see what you get.
7
Creating Rooms with an Intersecting Corridor
Create a new file and right click on the cube in the brushes toolbar for the properties
box. Set the dimensions to 1024 x 1024 x 512 and leave the wall thickness as 16.
Make sure the Hollow box is checked. Build and Close. Hit CSG Add (or Ctrl+A).
You
will now have a hollow rectangle. Zoom inside. Hold the L key and click on the floor or
a wall. This will place a white ‘point light’ in the room.
Click on the Build on the menu bar and select Geometry for Current Level to update the
map. (You need to do this each time you make any changes to brushes).
When the build is complete, right click on the floor and select ‘Play From Here’. Have a
run around. Once finished, hit escape to close the window.
In order to judge how large your environment is, we can place a Skeletal Mesh
(character) into the level. The scale of a character height in UDK is 96 unreal units.
The Content Browser
This is where all the game content and
assets are housed. To open click the icon
to the right of the binoculars. Check the
Skeletal Meshes box under Object Type.
8
If you don’t see anything, select the All Assets which will load the skeletal meshes.
Select one (it will be highlighted with a yellow border)
and left mouse click and drag him into your room.
Ensure he’s standing on the floor by moving him in
the side viewport.
Whilst the Content Browser is open, you can add some materials to your room by
checking the Materials box, selecting a material and dragging it onto a surface.
Now let’s create a connecting corridor.
9
Note: If you can’t see the builder brush, click on Edit in the menu bar > Find Actors and
double click on the Brush with the Group assigned as Cube.
Create a cube brush: 336 x 1040 x 272 = uncheck Hollow
Ensure it is correctly placed to align
with the floor of the room.
Side viewport
Note: If you can’t see the widget just
right click on the vertex and the
widget will appear.
To allow this alignment you may
need to change the grid to a lower
setting temporarily (8 should work
fine).
Front
Also make sure it aligns with the inner wall of the room.
Now select CSG Add.
Now we need to cut the mass out of this solid cube.
Create another cube brush: 320 x 1024 x 256
10
Place it as shown in the viewports below
Side
Top
Front
Go ahead and hit CSG subtract.
We should now have a room with a
corridor attached.
REMINDER! Don’t forget to set the grid back to 16.
Add some point lights in the corridor.
NOTE: You can duplicate objects by holding the ALT key down and dragging the object.
It would be a good time to SAVE your map right now. Go to File > Save As and name
your map to whatever you want.
11
If we were to go in and play the map right now, we wouldn’t see anything because the
lighting has not been rebuilt. As we have changed the geometry, go to Build in the
menu bar and this time select Build All.
Dive in (right click and select Play From Here) … here’s what I’ve got so far …
Let’s add another room and attach it to the other side of the corridor, only this time we’ll
use the Cylinder brush.
Select the Cylinder brush and give it the
following dimensions in the properties box:
12
These dimensions fit nicely on our corridor.
Top
Align it as shown in the screenshots.
Make sure the bottom is aligned to the floor.
Front
CSG Add.
Now create another cylinder brush with the
following dimensions:
Align it as seen in the screenshots and CSG
Subtract:
Top
Front
13
Now we have a hollow cylindrical room but at the moment it is not accessible. This is
easily remedied by extending the subtracted part of the corridor. To do this we need to
go into geometry mode.
Geometry Mode – The Edit Tool
When you want to modify an existing brush, such as
moving a face, vertex, or even extruding, you need
to enter "Geometry Mode." By default, the UDK is in
"Camera Mode." You can switch modes by clicking
the modes button. Geometry Mode is the cube
button next to the camera.
When you enter Geometry Mode, a new panel will open on
top of the editor containing various tools that are selected
via radio buttons. The default radio button selected is the
Edit tool which is what we want for now. We will cover the
other geometry tools later.
In Geometry mode select the subtracted geometry in the
corridor. Select the two end vertices (hold CTRL to select
more than one object) and drag them to align to the
subtracted cylindrical brush.
Top
14
If we were to do a Build now, we still
would not be able to access the
cylindrical room. This is because of the
order in which the brushes were
created. We need to change the order
of the subtracted brush. With the brush
still selected, right click, select Order >
To Last.
Rebuild the level and play. You should
be able to access the cylindrical room
now.
Here’s what I got …
15
Save your level. This time when you save, you will get a map check with diagnostic
messages. Just hit Close for now.
You will next get a dialog box with a list of packages to be saved. Make sure your level
is checked and hit Save Selected.
16
Download