SE 320 – Introduction to Game Development Lecture 11: Animations and GoKit Lecturer: Gazihan Alankuş Please look at the last slides for assignments (marked.

Slides:



Advertisements
Similar presentations
SE 320 – Introduction to Game Development Lecture 5: Programming in Unity & Developing Simple Games Lecturer: Gazihan Alankuş Please look at the last two.
Advertisements

SE 313 – Computer Graphics Lecture 13: Lighting and Materials Practice Lecturer: Gazihan Alankuş 1.
SE 313 – Computer Graphics Lecture 14: Armatures Lecturer: Gazihan Alankuş 1.
Lights Camera Action! Part 3: BDE Events By Deborah Nelson under the direction of Professor Susan Rodger Duke University July 2008.
GameCamp! and Game Davis Introduction to Unity®
GameCamp! and Game Davis Creating a 2D Platformer in Unity.
© Anselm Spoerri Lecture 11 Flash –Build Flash Website with Animated Navigation Structure –Decide on Overall Navigation Layout, Import Images & Organize.
HELLO WORLD: YOUR FIRST PROGRAM CHAPTER Topics  Hello World?  Creating a Unity Project –The Unity Project Folder  MonoDevelop: Unity's Code Editor.
Based on Roll-a-ball video tutorial from Unity Technologies Part WakeUpAndCode.com.
1 Flash Programming Introduction Script Assist. 2 Course Description This course concentrates on the teaching of Actionscript, the programming language.
Unity 3D game IDE 1.  Unity is a multi-platform, integrated IDE for scripting games, and working with 3D virtual worlds  Including:  Game engine ▪
© 2011 Delmar, Cengage Learning Chapter 8 Building Complex Animations.
SE 313 – Computer Graphics Lecture 11: Projection Painting and Merging Textures Lecturer: Gazihan Alankuş 1.
SE 313 – Computer Graphics Lecture 10: More Modeling and Texturing Lecturer: Gazihan Alankuş 1.
Creating a 3D Terrain Model and Flyover Bonnie J. Brown CAST – University of Arkansas, Fayetteville.
SE 313 – Computer Graphics and Visual Programming Lecture 5: Geometric Transformations Lecturer: Gazihan Alankuş Please look at the last slides for assignments.
Modeling and Animation with 3DS MAX R 3.1 Graphics Lab. Korea Univ. Reference URL :
SE 320 – Introduction to Game Development Lecture 4: Programming in Unity & Project Presentations Lecturer: Gazihan Alankuş Please look at the last two.
SE 350 – Programming Games Lecture 6: Programming with Unity Lecturer: Gazihan Alankuş Please look at the last slide for assignments (marked with TODO)
Exercise : Animated Navigation Structure in Flash 1.Develop Answers to “What did you learn in ITI program?” “What do you have to offer?” “What are your.
Flash MX II. Flash MX – Tweened Animation There are two methods for creating an animation sequence in Flash –Frame-by-frame animation –Tweened animation.
Introduction to the WebBoard Terry Dennis. The WebBoard - Our Connection The WebBoard URL is
EEC-693/793 Applied Computer Vision with Depth Cameras Lecture 13 Wenbing Zhao
Publishing a Macromedia Flash Movie – Lesson 131 Publishing a Macromedia Flash Movie Lesson 13.
The Story of Westward Development. What is PhotoStory?  PhotoStory is a free program from Microsoft that allows you to create a digital story.  You.
SE 350 – Programming Games Lecture 1: Introduction Lecturer: Gazihan Alankuş Please look at the last two slides for assignments (marked with TODO) 2/10/20121.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
SE 320 – Introduction to Game Development Lecture 8: Animations, GUIs, Debugging and IDEs Lecturer: Gazihan Alankuş Please look at the last two slides.
SE 350 – Programming Games Lecture 7: Programming with Unity Lecturer: Gazihan Alankuş Please look at the last slide for assignments (marked with TODO)
Photo Story 3 Importing Pictures. When you create a new Photo Story, the first thing that you will do is import pictures. You can import pictures from.
Web Games Programming An Introduction to Unity 3D.
Agenda – Week 8, Day 2 Tuesday Intro to Flash Animation process Computer animation Lesson 1 – Overview Lesson 2 – Drawing Lesson 4 – Layers Lesson 8 –
SE 313 – Computer Graphics Lecture 6: Transformations Lecturer: Gazihan Alankuş Please look at the last three slides for assignments (marked with TODO)
1. Press the New Layer Button 3. Double click names to re-name Ball & Shadow layers 2. Click to change to 12 fps Step 1.
Learning Unity. Getting Unity
Introduction to Flash Animation CS 318. Topics Introduction to Flash and animation The Flash development environment Creating Flash animations  Layers.
SE 320 – Introduction to Game Development Lecture 3: Unity’s Interface and Concepts Lecturer: Gazihan Alankuş Please look at the last two slides for assignments.
SE 320 – Introduction to Game Development Lecture 7: Programming Lecturer: Gazihan Alankuş Please look at the last two slides for assignments (marked with.
Yingcai Xiao Game Development with Unity3D. Outline IDE Engine Assets Tutorial Examples Inside.
Photo Story Creating your own!. What is Photo Story? Photo Story is a way to create slideshows with added narration, effects, transitions and background.
Creating a Historical Tour in Alice By Jenna Hayes May 2010.
LESSON #10: Digital Playtesting & Introduction to Character Animation with Mecanim DGMD E-70 Principles of Game Design.
Derived from Kirill Muzykov’s Rocket Mouse Tutorial WakeUpAndCode.com.
Adding Text and Navigation to the Home Page – Lesson 51 Adding Text and Navigation to the Home Page Lesson 5.
Tutorial 3 Creating Animations. XP Objectives Learn the different elements of animation Create frames and layers Organize frames and layers using the.
Flash animation For beginners. homework Your homework is over two weeks so please write in each week of your planner for the next two weeks For homework.
Learning to Program: Part 1 Scene Setup and Starting Animation by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University,
SE 320 – Introduction to Game Development Lecture 2: Introduction to Unity Lecturer: Gazihan Alankuş Please look at the last two slides for assignments.
SE 350 – Programming Games Lecture 5: Programming with Unity Lecturer: Gazihan Alankuş Please look at the last slide for assignments (marked with TODO)
XP Tutorial 3 Creating Animations. XP New Perspectives on Macromedia Flash MX Elements of Animation Layers are used to organize the content of.
UFCFSU-30-13D Technologies for the Web An Introduction to Unity 3D.
Cosc 5/4735 Unity 3D Getting Started Guide for Android.
INTRO TO UNITY Building your first 3D game. DISCLAIMER  “This website is not affiliated with, maintained, endorsed or sponsored by Unity Technologies.
Yingcai Xiao Game Development with Unity3D Inside/Outside Unity3D.
Angry Teapots– using the physics engine in Unity Peter Passmore.
Game Development with Unity3D
Welcome! Day1, Lesson 1.
EEC-693/793 Applied Computer Vision with Depth Cameras
Quick Intro to Unity Lecture 2.
Game Development with Unity3D Inside/Outside Unity3D
Tutorial 3 Creating Animations.
2D Graphics and Animations in Unity 3D
EEC-693/793 Applied Computer Vision with Depth Cameras
Scratch Unit Overview We are going to look at computer programming and how to create your very own computer game The piece of software we will be using.
EEC-693/793 Applied Computer Vision with Depth Cameras
Flash animation For beginners.
A Prime Example of HCI Application
Computer Animation Ying Zhu Georgia State University
EEC-693/793 Applied Computer Vision with Depth Cameras
Creating a Simple Game in Scratch
Presentation transcript:

SE 320 – Introduction to Game Development Lecture 11: Animations and GoKit Lecturer: Gazihan Alankuş Please look at the last slides for assignments (marked with TODO) 1

Topics Today Revisiting animations Using Animations Using GoKit 2

Moving Things in Unity 3 Setting position/rotation in the Update() function ManualAnimations Applying forces/setting velocities in the update function Position-basedPhysics-based Creating animations in Unity’s Animation pane In Unity Creating animations in the modeling software In Blender, etc. Tedious, have to keep state and do something every frame Things can go out of control, most motions are not physically viable Static motions, cannot adjust easily in runtime

Deciding how to move things All methods have their pros and cons, you have to decide for your situation – Animations are great for most cases In week 8, we have learned how to create animations in the Unity editor Let’s see how we can use animations coming from a model created in Blender – Models from 3DS Max and Maya are similar 4

Using animations created in Blender We have a model that was created in Blender.model It has a number of animations in a single timeline, one after the other 5

Using animations created in Blender Now we would like to use this in Unity Select the.blend file and the textures, drag them together to the Assets folder or Project pane – You can also drag the folder that contains them 6

Using animations created in Blender Now you see a prefab-like entry in the Project pane. You should see the textured robot in the inspector when you select it. 7

Using animations created in Blender You can drag it into the scene and run the game. You’ll see it doing some motions one after the other These are the animations that are in the timeline of the Blender file. We need to separate them and name them. 8

Using animations created in Blender The artist that created the animations (yours truly) told us which frames contain which animations: – 1-20: Walk – 30-50: Damage – : Rejoice Now we want Unity to know them as well. Select the model in the project pane and look at the inspector. 9

Using animations created in Blender There you will see import options for this Blender file. Under Animations, we want to add all the animation segments 10

Using animations created in Blender We add them and name them accordingly. We can set them to loop if it makes sense. Don’t forget to press the Apply button on the bottom 11

Using animations created in Blender Now select the robot in the hierarchy. In the inspector, under the Animation component, we see that Play Automatically is marked. This is why it was moving when we ran the game earlier. When we run it now, it will only play the Walk animation. This is because the Animation property is set to Walk. 12

Using animations created in Blender Under Animations property, we should see all three of the animations. We can set Animation to be one of the others and view them by running the game 13

Using animations created in Blender Now disable Play Automatically and let’s start to initiate animations through the code 14

Starting animations in code These are just like the animations that we created in Unity’s Animation pane in week #8 Create a new C# script and add it to the robot. Add the code below to create buttons that initiate the animations 15

Starting animations in code Notice how clicking only once is sufficient for starting the animation. Similarly, your code should call the.Play() function only when it’s needed. – We have talked about this extensively in Week #8 16

Preparation for this week’s homework At the end of the slide deck you will see more information about this homework. Here we will go over the necessary steps for you to start working on the homework Download this package: Create an empty Unity project and import the package 17

18 (Create an empty Unity project and import the package)

Preparation for this week’s homework Play the game and observe that you lose health when you hit the arrows, the axe, spikes, etc. Jump to the other side and get rich. 19

Preparation for this week’s homework Now let’s prepare to add our animation. In Hierarchy, under 3rd Person Controller, remove Bip001 and construction_worker. Let the DamageReceiver stay. 20

Preparation for this week’s homework Download the robot model from here: Extract it, then import the extracted folder into your project by dragging it into the project pane 21

Preparation for this week’s homework When you select the robot model in the project pane, you should see the robot textured in the preview part of the inspector pane 22

Preparation for this week’s homework Drag the robot model into the scene at the beginning of the level 23

Preparation for this week’s homework Now we will make it work with the 3 rd person controller. – Create an empty game object and drag it under 3rd Person Controller. Rename it “Offsetter” – Reset its transform component – We will use this to locate the robot without touching the robot’s transform, which is driven by animations coming from Blender. 24

Preparation for this week’s homework Drag the robot under Offsetter Revert the transform of the robot to prefab by clicking “Revert to Prefab”. This will ensure that we don’t compete with the transform values coming from Blender’s animations. – Finally, these transform values should not be in bold 25

Preparation for this week’s homework Now, when we run the game, we see that the robot is huge and sideways. – We will fix this using the Offsetter 26

Preparation for this week’s homework Rotate and scale the offsetter so that the robot is smaller and looks at the correct direction. 27

Preparation for this week’s homework From here on, it’s up to you to complete the rest of the homework. Take a look at the earlier parts of this slide deck for more information. 28

Limitations of Animations Animating displacement is static. In code, I should be able to give a destination that I calculated, and an object should move there in a specific duration. Tweening libraries – GoKit

Getting GoKit Go to and download a zip filehttps://github.com/prime31/GoKit Extract it to a folder. This is a Unity project. Open it with Unity. 30

Getting GoKit Open the scenes in the Demo folder and play with them 31

Using GoKit To use GoKit in your own projects, you just need to copy the Editor and Plugins folders into your own project Let’s create a new empty Unity project and copy these folders from the GoKit-master project into our project. 32

Using GoKit Let’s create a cube, a c# script "CubeScript" and attach the script to the cube. Create a directional light and align the camera to view When you run the game, nothing happens, yet. 33

Using GoKit Add the code below to the script. When you run the game and press the button, you will see the cube move to (5, 0, 0) in 3 seconds. Notice how GoKit added new functions to the existing Transform class Run it and see the cube move 34

Using GoKit Take a look at the GoKit Code Basics page in the GoKit wiki: Instead of calling extension methods such as transform.positionTo(), you can also do this – Go.to(someTransform, duration, someTweenConfig) – This way you have more control over the configuration of your tween. 35

Creating Tween Configurations Try this code, it will move the cube, make it smaller and make it red, simultaneously in 3 seconds. The TweenConfig class encapsulates these operations. 36

Using GoKit You can tween any property you see in the components. For example, lets move it by changing the position property by name: Instead of transform, you can use any other component and any property that they may have. It behaves as if you are changing the property using the inspector. 37

Using GoKit You can shorthand the config creation if you want. The two code pieces below are equivalent. 38

Using GoKit You can also chain tweens one after the other, or place them in different points in time, using TweenChain and TweenFlow classes 39

Visual Path Editor GoKit includes a visual path editor that you can create paths composed of spline curves – You can create these paths visually, or you can supply the points in runtime – Let’s see how we can use the visual path editor 40

Visual Path Editor Create a folder named StreamingAssets in your project. This is where GoKit will save path files. Create an empty game object and drag the GoDummyPath script onto it 41

Visual Path Editor When you select this GameObject, you will see some new markers in the scene. You can drag these to set the begin and end of the path. You can double click on them to create new points for the path 42

Visual Path Editor Once you’re done, name your path and save it using the inspector. The file in StreamingAssets folder contains information about this path. If you don’t want to create any new paths, you can remove this GameObject. 43

Visual Path Editor Here is how we can play this path in our code 44

Visual Path Editor When we run the game, we see that the cube follows the path nicely 45

TODO: Homework Start with slides here. Using Blender animations – Make the robot play the Walk animation while it is moving. Stop it when it is not moving (handle input independently in your script) – Make the robot play the Damage animation when it receives a damage – Make the robot play the Rejoice animation when it reaches the gold. Play it only once. Using GoKit – Change the red balls so that they hit the character like a homing missile – Add another ball cannon that shoots green balls that go in a predefined path that looks like a wave Get Özkan to grade your work, according to – (NOTE THE ADDRES CHANGE!) – Subject (paste this): SE 320 Homework 11 – What to send: Assets -> Export package File -> Build Settings -> Web player -> Build (for both games) – DUE DATE: Dec 11 46