117
Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date: 28 Feb. 2010

Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

  • View
    219

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Introduction to UDK

Prepared by Sai-Keung Wong

National Chiao Tung UniversityDepartment of Computer Science

Reference: Mastering Unreal Technology

Date: 28 Feb. 2010

Page 2: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Contents

• Show demos based on UDK• Use UDK to build a game level

Page 3: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Demo

• Show demos to students

Page 4: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Introduction to UDK• Introduction• A Walkthrough to Build a Game Level using UDK– Building the first room– Building the second room– Connecting rooms – Turning on lights– Try out game levels – Assigning materials to geometry – Placing static meshes – Placing more static meshes– Placing light sources

Page 5: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Introduction to UDK

– Building an emitter– Adding extra properties to Emitter – Adding particle system in rooms – Placing InterpActor ( Mover ) and a trigger – Build a Kismet sequence – Using Matinee to setup InterpActor – Physics objects– Building a Physics material – Fog

Page 6: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

A Walkthrough to Build a Game Level using UDK

• Excited to use Unreal Engine to design games• Use your imagination to design interesting and

stunning games• Be very happy and full of energy to work on your

games• Difficult at the beginning, but happy at the end• Correct attitude• Need different techniques to work out an

excellent game

Page 7: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Skin of UDK

Perspective

Top

Front

SideBrushes

CSG

Special Brushes& Volumes

File

Page 8: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building the First Room using Brush(es)

• Run UnrealEd (editor)• File -> New -> Subtractive (Geometry style)• You will see a red-dotted brush• There are four viewports (by default)• Right click on “Cube”– Make the appropriate settings for defining the dimension

of the cube– X : length, Y : width, Z : height– Example: X = 1024, Y = 1024, Z = 512

• Click BUILD and CLOSE

Page 9: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building the First Room

Page 10: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building the First Room

• Save your work– File->Save->…– Package Name: MyFirstGameLevel

• Open your work– File->Open Package– or– File->Open Recent Package

Page 11: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Tool Bar

• Show Flags: Toggle the visibility of some items• Viewport Mode. It’s Perspective (P) now.• Real time mode• Etc.

UnLit

Lit

Page 12: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building the First Room• Select the red dotted Brush (red Cube)• Click CSG Substract icon• Click Unlit on the lower left viewport• You Left Click (Press Left Mouse Button) to select a

plane. The plane is highlighted as blue color.

The bottom plane is selected.

Page 13: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building the Second Room

• In Brushes, select “Cylinder” (圓柱體)• Properties:– Z : 1024– Outer Radius 512– Inner Radius 384– Sides : 8

• Click Build and Close the dialogue.• Use Translation Widget ( 平移控件 )• Make sure SHOW items are set properly

Page 14: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building the Second Room

Page 15: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building the Second Room

• Zoom: Press Left Mouse Button and Right Mouse Button at the same time– Move up or down so as to ZOOM out or ZOOM in

• Pan : Press Left or Right Mouse Button and move

Page 16: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Top View

Page 17: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Top View• Move the Cylinder to the appropriate position

Page 18: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building the Second Room

• Use Drag Grid ( 拖曳網格設置 ), set as 16– Using Drag Grid is a GOOD habbit!– Why? You can’t put something exactly near to

other if Drag Grid is not used.• Place the Cylinder near to the first room• You need to work on Top View, Side View and

Front View.

Page 19: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building the Second Room

• Make sure the Cylinder Brush is selected• Press CSG Subtract

Before Pressing CSG SubtractNote: the Cylinder Brush is not selected.Make sure that you select it.

After Pressing CSG Subtract

Page 20: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building the Second Room

• Save your work and close the file. Make sure you enter a good name: MyFirstGameLevel

Page 21: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Connecting Two Rooms

• Open your saved file• Right Click Cube Brush – X: 32 – Y: 256 – Z: 256

• Build and close the property dialogue.• Move this red brush to connect the two rooms

Page 22: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Connecting Two Rooms

• Place the new Red Brush in the correct position

• Click CSG: Subtract• Now, we have created a corridor!

Page 23: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Connecting Two Rooms• While you are moving the brush, the geometry is not

updated. Don’t be panic. • Press Build Geometry to solve the problem.

Do yousee the problem?

Page 24: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Connecting Two Rooms• Press Build Geometry after you are done.• Now, save your work and close file.• Why do we have to save our work frequently?

Page 25: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

What’s next?

• Don’t be disappointed at this moment.• Everything seems to be quite “ugly”?!• You are going to work on some great thing!

Page 26: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding Lights to Rooms

• Open your work• Make sure the mouse cursor is inside a room.• Add Light: Press L key press and then Press

Left Mouse Button. We can’t see the effect of light until we turn on Lit (點亮) mode.

• To check properties of a light source, select a light source and press F4

Page 27: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Select the light sourceand press F4

Property dialogueIs shown.

Page 28: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Duplicating a light source

• How to duplicate an object? Select the object and press Alt key and drag the object away

• Now, we have two light sources.• Place the new light source to another room

• Note: You can see the translation Widget:• X : Red, Y : Green, Z: Blue

Page 29: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding Lights to Rooms

• Save current level

Page 30: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Playing the Game Level

• Open your work• Build All: build geometry, build light maps and build

paths. Using lightmass may slow down everything. So disabled it.

• Inside a viewport, right click and select “Play From Here” to try out our new level!

• Another way to try out the new level:– Place a playerStart actor:

• right click and select playerStart

• Press ESC to quit the play mode

Page 31: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Playing the Game Level

• Uncheck “Use Lightmass”• There are other options.• Students should study them.

Page 32: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Playing the Game Level

• Oh! The screen is black if you forget building all..

Black screen

Having built light maps and geometry

Page 33: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding Materials to Geometry Objects

• Open your work• View > Browser Windows > Generic (Content Browser) • There are some packages: ambient sounds, particle

effects, materials, meshes• Check materials • Select a material and drag it to the selected objects or

a BSP plane• Note: if you just left click on a wall and the color of the

wall turns into light blue, then the wall is selected.

Page 34: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Material Browser

Page 35: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding Materials to Geometry Objects• Select more than one objects: press CTRL key while

you left click on other object(s)• De-Selection: left click on it again, you de-select it.• You can select one wall and press Shift-B to select all

the planes that connect with that plane.

Page 36: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding Materials to Geometry Objects

• After assigning materials to some walls, you can try out your game level!

You can assign a material of one plane to another by doing the following:Right Click and press Alt Key on a plane. Then,Left Click and press Alt Key on another plane.

Page 37: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding Materials to Geometry Objects

• Build lightmaps! • If not, you will see a black screen.

Page 38: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding Static Meshes• Open your work• View > Browser Windows > Generic• Select Meshes • You will see the images of static meshes in a

window

Page 39: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:
Page 40: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding Static Meshes• Move the mouse cursor to a place that you

want to put the mesh• Add Actor > Add StaticMesh

StaticMesh: UTGame / S_HU_Deco_Pipes_SM_PipeSetB05

Page 41: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding Static Meshes• After you put the meshes, you can try out your

level.• If you do not rebuild light maps, there will be

no shadows!

Page 42: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding Static Meshes

• Also, if the shadow resolution is not high enough, the shadow is hardly seen.

• Shadow is computed surface-by-surface (面到面) .

• Press F5 to show Surface Properties.• Surface Properties (表面属性) ->Lighting

(光照)组 ->Lightmap Resolution (光源影射分辨率) ->Choose a small value, such as 8.0

Page 43: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding Static Meshes

• The smaller the value of Lightmap resolution ( 光源影射分辨率 ), the sharper the shadow is.

• Try out different values of Lightmap resolution to see the effects.

• Save your work.

Page 44: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding More Static Meshes

• Open your work• Add some static meshes in the corridor, for

examples, a “doorway” mesh and light meshes• Right click->add actor->static mesh->…• Build all and try out your game level.• Save your work.

Page 45: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding More Static Meshes

Page 46: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding More Static Meshes

Page 47: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding more lights to decorate the rooms

• Open your work.• Add a light source. Place your mouse at the

position that you want to put a light source. Press left button and press L key.

• Put the light source in an appropriate position.

Page 48: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding more lights to decorate the rooms

• Make sure the light source is selected. Press F4 so as to change the properties of the light source.

• Light->LightComponent:• Brightness (亮度) : 0.25 • CastDynamicShadows (投放动态阴影) : check it • LightColor (光源色彩) :

– B: 91 – G: 198 – R: 255

• LightingChannels (光照通道) : Check Dynamic • LightShadowMode (光源阴影模式) : Check LightShadow_Normal • Radius (半径) : 96

Page 49: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding more lights to decorate the rooms

Page 50: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding more lights to decorate the rooms

• Duplicate a light source: Press Alt key and use mouse to drag the light source.

• Now, you can create as many light sources as you want!

• Make sure you put them in appropriate positions.

• You can do multiple selection for all the light sources and move them around: press CTRL key while you select them.

Page 51: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding more lights to decorate the rooms

• Build all and try out your game level.• Save your work after you are done.

Page 52: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building a Particle Emitter• Open your work.• Generic browser->“ New ParticleSystem ”

(新建粒子系统) ->New Object (新建对象)

• Note: Right click side the content browser

Page 53: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:
Page 54: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building a Particle Emitter

• Inside the new target dialogue ( 新建对象”对话框中 )Package Name( 包名 ): MyFirstGameLevelGroup Name ( 组名 ) : EmittersName ( 名称 ) : first_particlePress OK. You will see UnrealCascade.

Page 55: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building a Particle Emitter

Page 56: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Unreal Cascade

• UnrealCascade ( Cascade ) : A particle editor

• Right click Emitter list Cascade (i.e. Black area)-> New ParticleSpriteEmitter

• A new particle emitter node appears.• After we have edited the emitter, we can set

the emitter in our game levels.

Page 57: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building a Particle Emitter

Page 58: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building a Particle Emitter

• We need to add material• In Cascade window -> “Show Generic

Browser”• Open Generic browser->select a material• Then go back to Cascade• Click “required” at emitter node, then click

“Use Current Selection in Browser”for Material of the emitter

Page 59: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building a Particle Emitter

Material

Required

Page 60: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building a Particle Emitter• We have to set properties of the emitter• Show RequiredModule and set as follows:• SpawnRate (生成速率) ->Distribution (分布)– Constant (常量) : 25 。 (25 particles per second)

• InterpolationMethod (插值方法) -> PSUVIM_Linear_Blend 。Note: blend the textures based on the ordering the textures.SubImages_Horizontal (子图像水平值) : 2 与SubImages_Vertical (子图像垂直值) :2 Note: texture is formed by 2x2 grid

• Save your work• Note: The actual appearance of the particles are not shown yet.

Page 61: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building a basic emitter

• Open your work.• Open the particle that you just built.• Generic browser->MyFirstGameLevel-

>Emitters->first_particle• Emitter List->Lifetime->Distribution (分布)– Min (最小) 至 1.25 – Max (最大) 至 2.0

Page 62: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building a basic emitter

• Back to Emitter List• Initial Size (初始大小)模块– Max (最大) X , Y 和 Z 至 150.0 – Min (最小) X , Y 和 Z 至 75.0

• You can see particles now in the browser window.

Page 63: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Building a basic emitter

• “Initial Velocity” (初速度)– 最大 X 和最大 Y: 40 – 最大 Z: 200 – 最小 X 和最小 Y: -40 – 最小 Z: 175

• Save your work.

Page 64: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding extra properties to emitters

• Open your work.• Emitter -> 列表

中, Right click the empty area below the list

• Select SubUV > SubImage Index 。

• Add SubImage Index to the list

Right click here

Page 65: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding extra properties to emitters

• 在 Properties 区域,设置如下属性:

• Distribution->Create A new Object (新建对象)

• Select DistributionFloatConstantCurve

• Create a curve.• The particle system reads the

curve for controlling the particles and rendering them.

Page 66: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding extra properties to emitters• You can change the shape of

the curve by adding or deleting points of the curve.

• Constant Curve->points 边上的省略号(“…”)。• “ Add New Item ” (新建

项) . Click twice• That will add two points,

namely, [0] and [1] to the curve.

• Set InVal as 1.0 for [1] , and set OutVal as 3.0 。

Page 67: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding extra properties to emitters

• Back to Emitter• Right click the area below SubImage Index• Select Size > Size By Life – A new Size By Life is created

• The particles may disappear! This is due to that the size of particles are not set yet.

Page 68: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding extra properties to emitters

• Same as what we have done to SubImage Index.

• Click Distribution -> “Create A new Object” (新建对象)按钮 。

• Select DistributionVectorConstantCurve 。

• This will control the size of particles over life.

Page 69: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding extra properties to emitters

• Select Distribution and set the values as follows:• Open ConstantCurve :• Click Points (“…” 记号)。 Click “Add New Item” (添加新

项) four times to create four points, namely, [0], [1], [2], and [3].

• In point[0] 。 Set OutVal X , Y , and Z as 0.2 。 • In point[1]. Set InVal as 0.6 。 Set OutVal X , Y , and Z as

1.5 。 • In point[2]. Set InVal as 0.85 。 Set OutVal X , Y , and Z as

0.75 。 • In point[3]. Set InVal as 1.0 。 Set OutVal X , Y , and Z as 0.0

Page 70: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding extra properties to emitters

• Save your work.

Page 71: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

将发射器置于关卡中• Open your work• Generic browser->MyFirstGameLevel->Emitters-

>first_particle• Make sure you select the particle system that you

create• Right click on a plane inside the room• Add Actor > Add Emitter: first_particle• Turn on Real Time mode (Left side of the bar)• Save your work and try out your level.• Note, you can change materials if you like.

Page 72: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:
Page 73: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:
Page 74: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Adding an InterpActor ( Mover ) and a Trigger

• Open your work.• We are going to add “Interpolation actor”

( or called as “mover” )。• Then we use Matinee to animate the

object(s)in 3D space.• First we select a mesh from generic browser– Generic browser->meshes – Select a mesh in generic browser

Page 75: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:
Page 76: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

• Now, you will see an “InterpActor”• Add Actor > Add InterpActor : StaticMesh…• Select the door (mover), press F4• DynamicSMActor -> StaticMeshComponent • Lighting-> bCastDynamicShadow set as false (未点选) .

Avoid casting shadow• Close DynamicSMActor dialogue• Click Collision • CollisionTyper set as COLLIDE_BlockAll 。

– The player cannot pass the door.• Close the property dialogue

Page 77: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:
Page 78: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:
Page 79: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

• We need to open the “door” by activating a trigger

• add Actor > Add Trigger, a trigger is shown!• Select the Trigger , press F4• Properties Window:– Inside the properties window, click trigger– Set CylinderComponent:

Set CollisionHeight (碰撞高度) and CollisionRadius (碰撞半径) as 96.0 。

Page 80: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

• Press C key to see the collision geometry• Place the trigger in the correct position.• Note: to see the collision geometry in a

viewport, you need to set SHOW flags.• Press C key to toggle the visibility of the

collision geometry• Save your work.

Page 81: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Press C key toshow collision geometry

Page 82: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

• What next?• We have placed InterpActor and a trigger• We need another two items to activate the

animation of the InterpActor: a Kismet sequence and a Matinee sequence.

• Matinee is used to check the status of the trigger.

• Then, Matinee tells InterpActor to animate.• We need Kismet to “glue” things together.

Page 83: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Kismet

• A visual programming system• Enable designers to organizing events as a

logic work flow that satisfies certain logical requirements.

Page 84: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

A Kismet Sequence

• Open your work.• Click UnrealEd->“Open Kismet” (打开

Kismet )• Open UnrealKismet (简称为 Kismet )

Page 85: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

A Kismet Sequence

• Make sure you select the trigger

• In the empty area inside the Kismet Browser

• Right click– New Event Using

Trigger_0 > Touch 。– This creates a Touch

sequence associated with the Trigger_0

Page 86: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Kismet Node

Page 87: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Kismet and Matinee

• Move the Touch sequence in Kismet workspace to the left hand side

• On the right hand side, in the empty area, right click to create a Matinee– New Matinee 。

Page 88: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Kismet and Matinee

Page 89: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Connecting the trigger to animation sequences

• Move the mouse cursor near to the “touched” connector of “Touch” Kistmet node.

• The color of the connector changes to yellow.• Drag the output “Touched” to “play” of Matinee

Node.– It means that if the trigger is touched, Matinee

sequence will start to play its corresponding sequence.• Connect “Untouched” of “Touch” Kistmet node to

“Reverse” of Matinee Node.

Page 90: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Connecting the trigger to animation sequences

Page 91: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

MaxTriggerCount

• Select Trigger_0 Touch sequence– Set MaxTriggerCount as 0. Zero means infinite. If

not, if the number of triggers exceeds this counter value, you cannot trigger the event anymore.

• Save your work.

Page 92: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Using Matinee to animate InterpActor

• Recall that we have setup InterpActor• Kismet sequence is set• Now, we need to animate the object “door” by

using Matinee.• In Matinee, we set the animation for the

InterpActor

Page 93: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Using Matinee to animate InterpActor

• Open your work.• In Kismet editor, double-click Matinee• Open Matinee editor• Matinee editor looks like a non-linear visual

editing environment• Make sure you select the mover before you

enter Matinee editor

Page 94: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Using Matinee to animate InterpActor

• Right click “Group” (inside Matinee window, left hand side, gray area) 。从

• “ Add New Group ” (新建组 ) name the group as MyFirstDoor->

• Right click MyFirstDoor->Add New Movement Track ” (新建移动轨迹)。

• Inside Matinee window, select the Movement track (the ones just created). Then, drag a time line to 0.0 (grey area).

Page 95: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Using Matinee to animate InterpActor

Page 96: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Using Matinee to animate InterpActor

• If you cannot see the timing information, zoom in or zoom out (Mouse Wheel)

• Make sure the time block is set as 0.000/5.000 。

Page 97: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Using Matinee to animate InterpActor

• After creating the group MyFirstDoor in Matinee, you can connect the InterpActor to Matinee.

• Proceed to the next step to set animation.

Page 98: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Using Matinee to animate InterpActor

• At time 0.0, click “Add Key” (添加关键帧)– Create a key frame.

• At time 1.0, click “Add Key” (添加关键帧 )– Create the second key frame

• As at both time instants, the position of the door does not change. Thus, the door does not move.

• Note: Drag the line with black thick line and press ENTER to ad Key.

Page 99: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Using Matinee to animate InterpActor

• At movement track time 1.0 click the orange triangle, select the second key, you can see ADJUST KEY 2

• Now, in UnrealEd Viewport, move the door upwards by 128 units.– Make sure, you enable Drag Grid mode.– Thus, the door opens in one second.

Page 100: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

The motion path of the door ADJUST KEY 2

Page 101: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Using Matinee to animate InterpActor

• Save your work and try out your game level.• Move close to the door area.• Save your work.

Page 102: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Physics

• You are going to add Physics materials to the game level.

• The physics objects will react to external forces.

Page 103: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Physics Objects

• Open your work.• Generic browser->Meshes, select a static

mesh which will be used for physics animation.

• In an appropriate position in the room,– Add Actor > Add RigidBody: StaticMesh

Basic_Room.Meshes– Set the static mesh as rigid body.

Page 104: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Physics Objects

Page 105: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Physics Objects

• Duplicate the static mesh.

• Place them in “good” positions

• Scale them if necessary

• Save your work.

Page 106: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Physics Material

• Open your work.• Open Generic browser, in emptry area, right

click and select “New PhysicalMaterial” (新建物理材质) -> “New Object” (新建对象)– Package (文件包) : MyFirstGameLevel– Group (组) : Physics – Name (名称) : phy_test

Page 107: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:
Page 108: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Physics Material

• Set the followings for the physics material:– Density (密度) : 0.25 – Friction (摩擦) : 0.5

• Make sure the physics material is selected in Generic browser• Assign the physics material to the rigid meshes.• After that, open DynamicSMActor

– StaticMeshComponent 。 – Click Physics, click PhysMaterialOverride as “None” 。– Click Use (使用) (right hand side) , so that phy_test is

assigned to them• Save your work.

Page 109: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Physics Material

Make sure you select all the rigid meshes

Page 110: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Physics Material

• Save your work• Try out the game level• Move to the rigid bodies and interact with

them• Right click on the rigid meshes• You can throw the rigid meshes

Page 111: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Physics Material

Page 112: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Setting Fog

• Open your work.• View > Browser Windows > Actor Classes• Open Info-> HeightFog 。 • “Add HeightFog Here” (在此添加高度雾)。

• Double click HeightFog actor to show properties window:

• HeightFog-> Component – Set Density as 0.0025

Page 113: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:
Page 114: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Setting Fog

• Move HeightFog actor to the root of the room if you like

• Note: you can press spacebar to circulate the widgets: translation, scaling and rotation.

• Save and try out the game level.

Page 115: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Fog

Page 116: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:
Page 117: Introduction to UDK Prepared by Sai-Keung Wong National Chiao Tung University Department of Computer Science Reference: Mastering Unreal Technology Date:

Summary

• A walkthrough to build a simple game level.• It’s simple and intuitive.