0% found this document useful (0 votes)
31 views

Computer Graphics Lab Manual

This document provides an overview of 12 chapters in a computer graphics lab manual. Each chapter covers 1-2 labs focused on building game development skills in Unity. Lab objectives include learning game engines, installing and using Unity, creating game objects, world building, assembling game components like characters and items, adding a health bar and inventory system, and setting up game managers and spawning/camera systems. Students are assigned reports on topics like anti-aliasing, object-oriented programming concepts in games, and artificial intelligence techniques.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Computer Graphics Lab Manual

This document provides an overview of 12 chapters in a computer graphics lab manual. Each chapter covers 1-2 labs focused on building game development skills in Unity. Lab objectives include learning game engines, installing and using Unity, creating game objects, world building, assembling game components like characters and items, adding a health bar and inventory system, and setting up game managers and spawning/camera systems. Students are assigned reports on topics like anti-aliasing, object-oriented programming concepts in games, and artificial intelligence techniques.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Computer Graphics

Lab Manual
2
Chapter 1

Lab-01

1.1 Game Engines


• Objectives

– Learn about game engines:


∗ what they are
∗ why they’re used
– Discuss a few game engines of historical significance
– Introduce the high-level capabilities of Unity

1.2 Assignment
1. Write a Report, comparing at least three different Game Engines

2. Comparison Criteria include

• Characteristics of each one


• Different License categories
• Pros and Cons of each type
• Hint: Exclude Unity (already discussed)
• Hint: Consider Unreal Engine (a powerful, widely spread one)

3
4 CHAPTER 1. LAB-01
Chapter 2

Lab 02 - Lab 03

2.1 Installation and First Game Execution


• Objectives

– Install Unity
– Configure Unity
∗ On Disk
∗ In the Cloud
– The Script Editor: Visual Studio 2018
– Navigating the Unity Interface
– Understanding the Different Window Views
– Configure and Customize the Layout
– The Transform Toolset
– Handle Position Controls
– Play, Pause, and Step Controls
– Unity Project Structure
– Unity Documentation

2.2 Lab Activities


1. Activity

• Description: Follow one of the Tutorial Games available at Unity Hub


– Download the Tutorial Game Project
– Run the Project
– Use the different tools illustrated in this Lab

5
6 CHAPTER 2. LAB 02 - LAB 03
Chapter 3

Lab 04 - Lab 05

3.1 Game Objects: Our Container Entities


• Objectives

– Entity Component Design


– Components: Building Blocks
– Sprites
– Animations
– Colliders
– The Rigidbody Component
– Tags and Layers
– Logic for Components

3.2 Lab Activities


1. Activity:

• Create a New Project


• Add one of the available Sprites / Characters
• Follow the illustrated steps to Move the character around the screen

2. Activity:

• Build upon the previous activity


• Switch between animations based on current player state
• Hint: use the animator window

7
8 CHAPTER 3. LAB 04 - LAB 05
Chapter 4

Lab 06 - Lab 07

4.1 Objectives: World Building


• Templates and Tile Palettes

• Creating Tile Palettes

• Painting with Tile Palettes

• Working with Multiple Tilemaps

• Graphics Settings

• The Camera

• Using Cinemachine

• Virtual Cameras

• Stabilization

• Materials

4.2 Lab Activities


1. Activity

• Customize the illustrated Tile Palette


• Use the Paintbrush to paint on the Tilemap

2. Activity

• Add another Tilemap


• Organize both Tilemap in a hierarchical manner

3. Activity

• Tweak Unity Graphics Settings to

9
10 CHAPTER 4. LAB 06 - LAB 07

– Toggle Anti-Aliasing
– Toggle Anisotropic Textures
Did you notice the differences?

4. Activity

• Install Cinemachine (if not already installed)


• Add it to your project
• Familiarize yourself with different options became available to your project
• Create 2D Camera
• Select the Virtual Camera, and apply some effects on the player object

4.3 Assignment
1. Prepare a Report about (Anti-Aliasing), an important topic that will be dis-
cussed in lectures. You report must include the following items

• Why we need anti-aliasing


• Discuss different anti-aliasing algorithms
• What is the most widely used anti-aliasing algorithm?
• Can you implement an anti-aliasing algorithm (in a programming lan-
guage of your choice)?
Chapter 5

Lab 08 - Lab 09

5.1 Assembling the Nuts and Bolts


Objectives

• Character Class

• Player Class

• Focus on Prefabs

– Create a Coin Prefab


– Build the Consumable Script
– Assemble Our Item
– Player Collisions
– Create a Heart Power-Up

• Layer based Collision Detection

• Triggers and Scripting

• Scriptable Objects

– Create a Scriptable Object


– Build the Consumable Script
– Assembling Our Item
– Player Collisions
– Creating a Heart Power Up

5.2 Lab Activities


1. Activity: Create Basic Player Class

• Create new CSharp script - called Player

11
12 CHAPTER 5. LAB 08 - LAB 09

• Remove the Start() and Update() functions


• Create coin prefab

2. Activity: SetUp the Circle Collider 2D

• Select CoinObject
• Add a CircleCollider 2D
• Set the Radius
• Can you use the CircleCollider as a trigger?

3. Activity: Set Up a Custom Tag

• Select the CoinObject from the Project view


• On the top-left of the Inspector, select “Add Tag” from the Tags menu.
• Create the CanBePickedUp tag
• Select the CoinObject again and set its Tag to: CanBePickedUp

5.3 Lab Assignment


1. Can you summarize the steps to create an interactable prefab
Chapter 6

Lab - 10

6.1 Health and Inventory


This lab (and the next one) will attempt to build a health bar to track the players’
hit-points. Lab objectives include

• Creating a Health Bar

– Canvas Objects
– UI Elements
– Building the Health Bar
– Anchors
– Adjusting the Anchor Points
– UI Image Masks
– Importing Custom Fonts
– Adding Hit-Points Text
– Scripting the Health Bar
– Scriptable Object: HitPoints
– Update the Character Script
– Update the Player Script
– Create the HealthBar Script
– Configure the Health Bar Component

6.2 Lab Activities


1. Regenerate what have been illustrated in this Lab; to achieve the same results
yourself

2. Understand what have been done carefully, so we can build upon in the next
lab

13
14 CHAPTER 6. LAB - 10
Chapter 7

Lab - 11

7.1 Health and Inventory (continued)


In this lab, we continue what we started in the last lab. In this lab, we focus on the
Inventory object, and its script. Objectives include:

• Import the Inventory Slot image

• Configure the Inventory Slot

– Configure the InternImage


– Configure the Background
– Configure the Tray
– Configure the Quantity Text
– Create the Prefabs
– Build the Slot Script

• Create the Inventory Script

– Set-Up Properties
– Instantiate the Slot Prefabs
– Fill in the Start() method
– The AddItem method
– Update the Player Script

7.2 Lab Activities


1. Regenerate what have been illustrated in this Lab; to achieve the same results
yourself

15
16 CHAPTER 7. LAB - 11
Chapter 8

Lab - 12

Game Managers are central components to any video game. Game Manager is
responsible for coordinating and running the game logic, such as spawning the player
when the player dies. We’ll also build a Camera Manager to ensure the camera is
always set up properly. Objectives

• Create a Game Manager

• Singletons

– Creating the Singleton


– Build a Game Manager Prefab

• Spawn Points

– Build a Spawn Point Prefab


– Configure the Player Spawn Point
– Spawn the Player
– A spawn point for Enemies

• Camera Manager

– Using the Camera Manager


– Character Class Design
– The Virtual Keyword

• The Enemy Class

– Refactoring
– The internal Access Modifier

• Coroutines

– Invoking Coroutines
– Pausing or "Yielding" Execution

17
18 CHAPTER 8. LAB - 12

– A Complete Coroutine
– Coroutines with Time Intervals
– The Abstract Keyword
– Implementing the Enemy Class
– The DamageCharacter() method
– ResetCharacter()
– Calling ResetCharacter() in OnEnable()
– Kill Character

8.1 Lab Activities


1. Regenerate what have been illustrated in this Lab; to achieve the same results
yourself

8.2 Assignment
1. From what we have learned so far, it is clear that Game Programming requires
strong programming concepts. Write a report illustrating new object oriented
programming concepts we have used in this course. You report can include

• Access Modifiers
• Inheritance
• Singelton
• Importing external code files and libraries
• any other concept that were new to you

2. Artificial Intelligence are everywhere. Many of the current available games


rely on them heavily. We will not be able to present how we can embed AI in
our game, because we have not yet studied AI. As a challenge, can you write
a report about AI in games. Your report must include the following

• What are some famous examples of AI based games


• What are the most widely used AI techniques in games
• How can we utilize AI in our game

You might also like