Creating E-Learning Games with Unity
eBook - ePub

Creating E-Learning Games with Unity

David Horachek

Share book
  1. 246 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Creating E-Learning Games with Unity

David Horachek

Book details
Book preview
Table of contents
Citations

About This Book

In Detail

Unity is a fully integrated development engine providing the required functionality to create games and interactive 3D content, while reducing the time, effort, and cost of developing the content. Nowadays, many people have started to use Unity in an eLearning setting as it allows them to create real-world scenarios, or models, for training purposes. With Unity, one can develop video games that are not only fun, but are also effective teaching and learning tools. When properly designed, an engaging game is an ideal platform for the presentation, testing, and application of learning objectives.

eLearning Game Programming in Unity is a practical, hands-on guide to programming eLearning games. You will encounter a step-by-step approach to developing a 3D game that is interactive and engaging, built around sound teaching pedagogy and game theory.

In this book, the readers will be taken through the development of an eLearning game framework using the Unity engine. In addition to developing the technology for the game, we will create 3 levels (missions) in the game that teach, test, and reinforce learning. The subject matter being taught is the 50 American states and their flags. Concurrently, the book shows readers how to develop multiple game levels that support the various learning objectives of the game. In level 1, the user has to locate the missing flags and return them to the flag monument. During this time, the state flags design and state name are given to the player. This is the teaching phase. We also discuss cognitive flow and how learning is encouraged when the player is in this state.

In level 2 the user has to run a race through the park, competing against two other racers. Non-Player Characters (NPCs) are stationed along the way, and will ask questions about state flags. The user has to achieve 100 percent and first place in the race to move on to level 3. This is the testing phase, as we approach the problem from other direction with multiple choice popup cards.

In level 3, we reinforce learning through interactions with NPCs. These interactions require higher order thinking and association of the subject matter with the game experience. You will also learn how to program the interactive elements of a game to increase immersion. You will construct interactive objects that can be collected by the player and will program non-player characters that will populate the world, move, and interact with the player.

With this guide, you will learn everything you need to know to make your own effective eLearning game from start to finish.

Approach

This book is an easy-to-follow guide that incrementally develops the game framework and missions, step-by-step, with each chapter. Extensive source code is provided and explained in detail to support and explain each of the concepts in the book.

Who this book is for

This book is intended for novice game programmers with a little experience in Unity3D, who want to learn how to program eLearning games. Educators and trainers who want to use Unity in an eLearning setting will also benefit from the book. It would be helpful to have a basic understanding of the concepts such as Unity scripting and the Finite State Machine (FSM), but no prior experience in game development is required.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Creating E-Learning Games with Unity an online PDF/ePUB?
Yes, you can access Creating E-Learning Games with Unity by David Horachek in PDF and/or ePUB format, as well as other popular books in Informatica & Programmazione di giochi. We have over one million books available in our catalogue for you to explore.

Information

Year
2014
ISBN
9781849693424

Creating E-Learning Games with Unity


Table of Contents

Creating E-Learning Games with Unity
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Introduction to E-Learning and the Three Cs of 3D Games
Understanding e-learning
Introducing our game – Geography Quest
Comprehending the three Cs
Creating our first scene
Developing the character system
Building character representation
Developing the camera code
Implementing GameCam.cs
Developing the player controls code
Implementing PlayerControls.cs
Try it out!
Summary
2. Interactive Objects and MissionMgr
Understanding the base scripts
Building an interactive object
Implementing the CustomGameObj script
Implementing the InteractiveObj script
Implementing the ObjectInteraction script
Implementing the InventoryItem script
Implementing the InventoryMgr script
Implementing the DisplayInventory method
Implementing the MissionMgr script
Implementing the Mission script
Implementing the MissionToken script
Implementing the SimpleLifespanScript
Putting it all together
Testing the mission system
Try it out!
Summary
3. Mission One – Find the Facts
Finding the facts
Designing games to maximize fun
The teaching loop in game design
Implementing the core classes for mission one
Creating a terrain
Creating the FlagLocators GameObject
Creating the FlagMonument GameObject
Creating the MonumentMgr Script
Creating the InventoryPlaceOnMonument class
Creating the MissionMgrHelper script
Creating the TriviaCardScript script
Creating the SetupMissionOne script
Creating the flag Prefabs
Creating the pop-up card Prefabs
Creating the mission pop-up Prefab
Creating the mission reward Prefabs
Creating the FoundAllTheFlags Prefab
Creating the ReturnedTheFlagsResult Prefab
Configuring the mission manager
Playing the level!
Summary
4. Mission One – Future Proofing the Code
Reorganizing our GameObjects in the Scene view
Creating a global scene
Creating a first level scene
Adding new scenes to the project
Creating the PopupMainMenu GameObject
An introduction to Finite State Machines
Implementing an FSM in a game
The switch case FSM
Classes implementation of FSM
Implementing the GameMgr script
Reflecting on our code changes
Analyzing code functionality
Updating some systems
Making the ScorePlate active
Updating the player motion algorithm
Playing the level!
Summary
5. User Interfaces in Unity
Getting familiar with Unity UI classes
Developing the pop-up system
Exploring the GUIText component
Interpreting the members on GUIText
Exploring the GUITexture component
Exploring the TextMesh component
Ideal use of TextMesh
Creating clickable text elements
Detecting mouse clicks
Detecting mouse over
Detecting leaving mouse over
Exploring UnityScript and the GUIButton object
Using UnityGUI
Creating a clickable button
Detecting a mouse click
Building the main menu pop up
Testing our work
Future extensions
Summary
6. NPCs and Associated Technology
Creating the NPC GameObject
Implementing the npcScript class
Implementing the SplineMgr class
Connecting SplineMgr to NPCScript
Implementing the NPC decision system
Implementing the npcCondition script
Implementing the npcResponse script
Implementing the npcInteraction script
Implementing the npcDecisionMgr script
Building a collection of NPC conditions and responses
Implementing the condition_closerThanThresh script
Implementing the condition_fartherThanThresh script
Implementing the response_changeState script
Putting it all together
Summary
7. Mission Two – Testing a Player's Learning
Exploring the structure of mission two
Defining the framework for mission two
Adding a mission to the missionMgr script
Extending the GameCam script
Modifying the terrain
Adding NpcRacers to the mission
Creating the start and finish line flags
Creating the LevelStart and LevelFinished pop ups
Creating the setupLevel2 Prefab
Creating the raceStartup Prefab
Implementing the LevelLogicObj GameObject
Summary
8. Adding Animations
Exploring 3D hierarchies
Skinned meshes in Unity3D
Acquiring and importing models
Exploring the Mechanim animation system
Choosing appropriate animations
Building a simple character animation FSM
Exploring in-place versus root motion animation
Adding the character script
Building a zombie racer animation FSM
Building a quiz racer animation FSM
Exploring the Unity animation editor
Summary
9. Synthesis of Knowledge
Understanding the mission three GameObjects
Applying learning theory to mission three
Creating the structure for mission three
Modifying the terrain
Adding visitors to the park
Modifying the pop-up system
Creating the NpcLocators Prefab
Creating the CorrectResponse Prefabs
Modifying the quiz cards
Adding another data condition
Using the setupLevel3 Prefab
Creating the AddScore condition
Creating the ShowLevel3Results response
Creating the Time object
Modifying the LevelLogicObj object
Rewarding the player
Summary
10. An Extensible Game Framework Pattern in Unity
Load additively
Using delete/load patterns
Refactoring our work
The pop-up system
Updating level 3 pop ups
Updating level 2 pop ups
Updating level 1 pop ups
Refactoring level 2
Implementing a system to connect object references
Updating the SetupMission2 script
Refactoring level 3
Playing and distributing your game
Reflecting on e-learning and game design
Summary
Index

Creating E-Learning Games with Unity

Copyright © 2014 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by a...

Table of contents