Before diving into Unity, it's essential to grasp the foundational principles of instructional design. The ASSURE model, commonly used for lesson planning, will serve as our guiding framework for creating interactive lessons in Unity. This model will help you align your game design objectives, media selections, and assessments, ensuring that each game component fulfills a specific educational purpose.
A: Analyze Learners
S: State Objectives
S: Select Methods, Media, and Materials
U: Utilize Media and Materials
R: Require Learner Participation
E: Evaluate and Revise
Assessment:
LLlLearning Modalities and Game Design
Learning modalities, a concept rooted in the theory that individuals have preferred ways of receiving and processing information, often categorized into visual, auditory, reading/writing, and kinesthetic, play a significant role in the field of game design for learning. This approach suggests that educational games should cater to these diverse modalities to enhance learning outcomes. However, the application of learning modalities in game design is not without controversy. Critics argue that the evidence supporting learning styles is weak and that designing games based on these styles may oversimplify complex learning processes. They contend that effective learning is more dynamic and less dependent on fixed modalities. Despite this, the integration of multimodal experiences in educational games—combining visual, auditory, and interactive elements—remains a popular approach. This strategy aims to engage a broader audience and acknowledges the multifaceted nature of learning, even as the debate over the validity and impact of learning modalities continues.
"Watch the video tutorial on installing Unity to prepare for your upcoming activities. Please complete this task promptly to engage fully with the materials and activities."
Assessment:
3D Design
This section is designed to guide you through creating your first level prototype in Unity using ProBuilder. After a brief introduction and learning phase, you will spend most of the week building a basic level, which will serve as a foundation for scripting and interactivity in a subsequent module.
ProBuilder is an innovative tool integrated within the Unity engine, designed to enhance and streamline the process of 3D modeling and level design directly in the Unity Editor. It stands out as a versatile tool for both beginners and seasoned developers, offering an intuitive interface that allows you to create, edit, and manipulate 3D objects without the need for external 3D modeling software. With ProBuilder, you can easily construct complex geometries, engage in rapid prototyping of game levels, and experiment with architectural designs. Its features include advanced modeling capabilities such as vertex, edge, and face manipulation, alongside UV mapping for detailed texturing. ProBuilder's seamless integration with Unity makes it particularly valuable for game developers, as it enables the immediate testing of 3D models within the game environment. This tool not only accelerates the workflow of game development but also opens up creative possibilities, making it an essential asset for anyone looking to harness the full potential of Unity in creating immersive 3D worlds and interactive experiences.
Expected Outcomes:
Pre-Work Activity: Unity Interface Familiarization
The purpose of this activity is to help you get acquainted with the Unity Editor's interface, ensuring you can navigate and utilize its various components efficiently when starting game prototyping with ProBuilder.
Task:
Unity Interface Overview:
Key Area Identification:
Hands-On Task:
Documentation Reading:
Read the 'Unity Interface' section of the Unity Manual available on the Unity Documentation to reinforce your understanding.
Modeling and Animation with ProBuilder:
Please watch the following videos:
Scripting in Unity Using C-Sharp
This section is designed to introduce you to the essentials of scripting, which is the backbone of game development in Unity. We'll be using Visual Studio, a powerful and user-friendly code editor, to write and manage our scripts. Starting with the basics, we'll explore variables – the fundamental units of data storage. You'll learn how to use various data types and how variables interact within your game.
Next, we dive into the world of logic with 'if' statements, understanding how to make decisions in your code. This will lead us to loops – both 'for' and 'foreach' – which are critical for performing repetitive tasks efficiently. We'll see how these loops can work hand-in-hand with arrays, a key concept for managing multiple elements in an organized way. Lastly, we’ll cover methods, the building blocks of organized and reusable code, which allow us to perform specific tasks.
To learn C# specifically for Unity, it's important to choose resources that balance general C# concepts with their application in game development. Here are some recommended documents and websites for prework before diving into this module:
Websites:
Video Tutorials:
Online Forums and Communities:
Please Watch the Following Videos:
Assessment. Unity Scripting Assignment: Grade Analyzer
Objective: Create a Unity script that analyzes an array of grades and provides feedback about the class performance. You will define a set of grades, calculate the average grade, and use control structures to categorize the overall performance.
Assignment Details: In Unity, create a new scene and save it as "yourlastnameScene4", then create a new c# script in your script folder and name it " QuizCalculator " (Please use the camelcase style naming. Capitalize each word without spacing for writing the name of your script. However, when writing your variables, start with lowercase.; for instance, gradeAverage.
Here is the code that you need to complete. Remember, there are multiple ways to solve this problem. Aim to create the most efficient script possible!
------------------------------------------
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class QuizCalculator : MonoBehaviour
{
// Declare an array to hold the quiz grades and a variable to hold the average grade
(Please write the code here)
void Start()
{
// Initialize quiz grades with random values between 0 and 100 use for loop
(Please write the code here)
// Calculate the sum of all grades using foreach loop
(Please write the code here)
// Calculate the average grade
(Please write the code here)
// Log the average grade to the console
(Please write the code here)
// Classify performance and log the letter grade to the console if and else if
(Please write the code here)
}
}
-------------------------------------------------------
Scripting in Unity Using C-Sharp Part2
In this section, we will delve into user input, player movement, and collision handling in Unity, laying the foundation for creating dynamic and interactive games. You'll learn how to harness Unity's input system to translate players' actions—like keyboard presses and mouse clicks—into responsive on-screen movement. We'll explore how to use scripts to control characters or objects, adjusting their position, rotation, and scale based on user input, and implementing collision detection to create realistic interactions between game objects. Whether it's moving a character across a platform, steering a vehicle, navigating through obstacles, or interacting with the game environment, mastering player movement, input, and collision detection is a crucial step towards building engaging and immersive gameplay experiences. Additionally, we'll touch on Unity's UI system, understanding how to create and manage user interfaces that are both functional and aesthetically pleasing.
Please Watch the Following Videos:
Assessment 1: Player Health Reduction on Collision with Enemy
Objective:
Add a script to the player character in Unity so that when they collide with an enemy, they lose health. The player starts with 100 health points, losing 20 points with each collision. If the health points reach zero, the player is destroyed.
Step-by-Step Pseudocode:
Here's a version of the Unity C# script for the player health system with key sections left blank for you to complete as an exercise: fill the blanks and create a script in unity and add it to your player. Test your game to see if it’s working correctly.
public class YourLastNamePlayerHealth : MonoBehaviour
{
private int health = ___; // Students should fill in the initial health value
void OnCollisionEnter(Collision collision)
{
// Check if the collision object is an enemy
if (collision.gameObject.CompareTag("___")) // Students should fill in the correct tag
{
// Reduce health
health -= ___; // Students should fill in the correct amount of health to deduct
// Check if health is zero or below
if (health <= ___) // Students should complete the condition
{
// Destroy the player object
Destroy(___); // Students should fill in what needs to be destroyed
}
}
}
}
Assessment 2: Play a Specific Sound on Collision
public class YourLastNameEnemySoundEffect : MonoBehaviour
{
public AudioClip funnySound; // Assign the specific funny sound clip
private AudioSource audioSource;
void Start()
{
// Get the AudioSource component attached to the enemy
audioSource = GetComponent<AudioSource>();
}
void OnCollisionEnter(Collision collision)
{
// Check if the collision object is the player
if (collision.gameObject.CompareTag("Player"))
{
// Play the funny sound clip
audioSource.PlayOneShot(funnySound);
}
}
}
Instruction:
Publishing Your Game
In this crucial phase of your game development journey, we're going to walk through the process of publishing your Unity game using WebGL. This powerful tool allows you to deploy and run your games on web browsers, making your creations easily accessible to a wide audience.
Here’s what you need to know to get started:
Call to Action:
Watch the accompanying video tutorial that covers each step-in detail. After watching, your task is to publish your own game using WebGL. Once it's live, take the sharing link provided by the hosting platform and integrate it into your website. This is a significant milestone, as it transitions your game from development to the hands of players. So, get your game ready, watch the video, and take that exciting step of publishing your creation for everyone to enjoy!
This content is provided to you freely by EdTech Books.
Access it online or download it at https://edtechbooks.org/designing_immersive_Learning_experience/prototyping_a_game.