Escape: Level Design Exercise in Unity

Post on 27-Jun-2015

416 views 1 download

Tags:

description

Slides introduces Escape package that is developed for teaching Unity. The package contains building blocks for a simple first person sneaking game. Contents: - Introduction to prefabs in package - Level design assignment Download the Unity package: http://www.mediafire.com/download/2t49ajxl6n7xq3z/escape_new.unitypackage

Transcript of Escape: Level Design Exercise in Unity

Petri Lankoski

EscapeLevel Design Exercise in Unity

Petri Lankoski

Goals Learn to use with Unity

editor in level design

Familiarize to simple level design task

Prerequisites Familiar with

the Unity interface Materials in Unity How to create textures

and import them to Unity

Petri Lankoski

ContentsUnity package Escape

Level design assignment description Using Escape package

Petri Lankoski

Escape PackageHow-To

Petri Lankoski

An Example Intended to show how main pieces are used

Prefabs with functionality

Not an example of level design

Not cover all aspects of level design No examples working with materials and 3D models

StartScreen(scene 0) level1 level2 level3 TheEnd

An enemy patrolling + door

A door with a lock + key + power-ups

Gate + lever

Petri Lankoski

Set-up Create New Unity Project

File -> New Project

It is important to start from empty Unity project!

Select folder and name

All packages should be unchecked

Petri Lankoski

Set-up… Download the unity

package

Import package to Unity Assets -> Import

Package -> Custom Package…

Select escape_new.unitypackage

Click Import

Petri Lankoski

Prefabs Main components are in

Prefabs folder Enemy

Waypoint Health power-up Power power-up Door Door with key

Key Gate Gate with Lever Some wall pieces

Petri Lankoski

Start Screen Add StartScreen prefab

Save scene File->Save

Name it as StartScreen Move the StartScreen

scene to Scenes folder

Add scene to Build File->Build Settings… Click “Add Current”

Petri Lankoski

StartScreen Object

Credits screen Uses these

Write level1(new Game loads this level)

Petri Lankoski

Level1 Save Scene

Create new scene File -> New Scene

Save and name the scene File->Save Scene Name should be level1

Move level1 to Scenes folder

Add scene to Scenes to be build File->Build Settings…

Petri Lankoski

Building a Level

Delete Main Camera

1. GameObject->Create Other-> • Directional light• Plane

2. Scale the plane3. Move the plane to <0,0,0>

Add GameManager

Add PlayerStart- Place it above the Plane

Petri Lankoski

Some TipsStart building your levels at <0,0,0>

In project use folders E.g., all scene files belongs to Scenes folder Do not leave thing floating around at the top level

In Hierarchy one can use an empty GameObject like folder Moving that empty GameObject moves all children

Petri Lankoski

Building the first Level

• NextLevel:• size: 1• Element0:

level2• If more than one

level specified, the level is picked randomly

• GameFinished• Check if this is

the game if finished after reaching this door

Petri Lankoski

Adding an Enemy

First we need create a patrol route for the enemy• A three waypoints• Rename

• Waypoint1• Waypoint2• Waypoint3

• Make sure that the waypoints (colliders) are just fully above the plane

Petri Lankoski

Adding an Enemy…

Add the enemy• Place it near

waypoint1• Make sure that the

enemy (CharacterController) is just fully above the plane

Connect the Enemy to the Waypoint1• Drag-and-drop

Waypoint1 to Target in Inspector

Petri Lankoski

Connecting Waypoints

1. Select Waypoint12. Drag-and-Drop

Waypoint2 to NextTarget of Waypoint1

3. Select Waypoint2 4. Drag-and-drop

Waypoint3 to NextTarget

5. Select Waypoint3 6. Drag-and-drop

Waypoint1 to NextTarget

Petri Lankoski

Ready Enemy

• Save Scene!

Petri Lankoski

Second levelCreate new Scene

Remove MainCamera

Add Plane DirectionalLight GameManager PlayerStart

Save scene Name it level2

level2 is the name we added to door in level1

Petri Lankoski

Door with a Lock

• Set-up door: NextLevel = level3

• Number of keys needed to make door visible and accessible

Petri Lankoski

Keys

Place three keys

Petri Lankoski

Power-ups

• Save Scene!

Petri Lankoski

Third LevelFile->New Scene

Delete MainCamera

Add DirectionalLight Plane Door (Next Level: TheEnd, check Game Finnished) PlayerStart GameManager

Petri Lankoski

Gate

Add walls• Gate prevents

accessing door• We need a way to

open the game

Petri Lankoski

Switch to the gate

Petri Lankoski

Gate

Lever control Disable Type

Absolute Lever turns the gate

on/off Timed

Gate will active after a Disable Time has elapsed.

Disable Time Second the game if off

Off intervals Intervals

If check the gate will turn on and off randomly

Min time Minimum that time (sec)

that the gate if off in one time

Max time

Maximumthat time (sec) that the gate if off in one time

Petri Lankoski

TheEnd scene Create new scene

Add TheEnd prefab to the scene

Save the scene Name it as TheEnd

Add to Scenes to be build File->Build Settings…

Petri Lankoski

Building Web Player File->Build Settings

Platform: Web Player

Build

Petri Lankoski

Thanks to Oscar Romin

Programming / Electric Gates

Andreas Jansson Electric gate model Power power-up model

License Escape Unity Assignment

by Petri Lankoski is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Petri Lankoski

Level Design Assignment

Petri Lankoski

AssignmentBuild a game that has 3–5 small levels using

Escape Unity package

The game is a 1st person sneaking game where the player should find ones way via levels that are patrolled by monsters. The monsters shoot an electrical ray if they see the player. The player can turn oneself invisible in order to evade the monsters. Being invisible draws energy. If the player runs out of energy, it is not possible to turn oneself invisible.

Petri Lankoski

Requirements 3–5 small levels (playtime around 2–5 minutes)

All main components are in used in the game Do not use every main component type in one level Do not modify the looks of main components Use inspector to fine-tune the behavior of the main components

The game is possible to play through

No new component with functionality. You should the gameplay using the above-listed main components.

In addition to ready-made level pieces, create your own pieces to make levels in Maya or use Unity’s components

Object should be textured and the levels should have one directional light

The web player should be less than 100MB

Return as Unity Web Player