You are on page 1of 51

ACKNOWLEDGMENT

Before any development of this professional experience, it seems


appropriate to begin this report by thanking, for what appeared to
us during this experiment.

At the end of this work, we would like to express our deep


gratitude to our dear teacher and coach ​Mr Sami Ben Amor for
his follow-up and for his tremendous support. He continued to
provide everything along the project. For the time he has spent
and for the valuable information, he has given us with interest and
understanding.
We also extend our sincere thanks to the juries for reviewing and
judging this work.

In the making of this document we were greatly helped by


Mohamed Amine Belkahla and ​Mohamed Nabi​. We thank both
of them for providing us with the guidance needed throughout this
project .

A special thanks as well to ​SYNTY STUDIOS for providing us with


a bunch of assets to help create this educational game.

We also thank our families for their moral and financial support and
for their sacrifices.

Finally, we thank our friends, as well as all those who contributed


directly or indirectly to the realization of this work.
Table Of Content
Abbreviations 5

General Introduction 6
Chapter 1: General View 7
Introduction 7
Problem 7
Possible Solutions 8
Video Games 8
Serious Games 10
Educational Games 10
Benefits of serious games 11
Concurrence 13
Project’s Background 15
About The Game 15
Gameplay 16
Welcome Scene 16
Lobby 16
In Game 16
Exploring 17
Facing Obstacle and solving problems using cards 17
Gathering Information 17
Solving Final Puzzle 18
Cognitive Gains 18
Decision Making 18
Problem solving 18
Memory 19
Need Analysis 19
Functional Needs 19
Non-Functional Needs 20
Conclusion 20

Chapter 2: System Design 21


Introduction 21
System’s Functional View 21
Actor Identification 21
Identification of use cases 21
Main Use Case 23
Predefined Unity Classes 25
MonoBehaviour 25
NetworkBehaviour 25
Package Diagram 25

2
Dynamic view of the system 26
Conclusion 28

Chapter 3: Implementation 29
Introduction 29
Hardware environnement 29
Software Environment 29
Audacity: 29
Programming Language 30
Game Engine 30
Technologies 30
Unity3D 30
UNET 31
Integration with android 31
WHY Unity3D 31
Making the Game 32
Setting up our project 32
Separating assets 33
Protecting the project 35
Coding the game logic 35
Character Movement 36
Camera rotation 39
Collision, Triggers, actions on collisions and calculations 39
Optimization 42
Audio and voice clip 43
Multiplayer 45
Final Beta version 46

General Conclusion 48
References 50

3
4
Abbreviations

(GE) : Game Engine


(SDK) : Software Development Kit
(TP) : Third Person (Gameplay style)
(FPS) : Frame Per Second
(AR) : Augmented Reality
(VFr) : Vuforia
(PUN2): ​Photon Unity Networking 2
HDRP: High Definition Render Pipeline
API: ​Application Programming
Interface

5
General Introduction

Nowadays, the educational system proves the amount of knowledge


students need to acquire by the end of each year. This focuses on the result
rather than the process of learning, which means it can be difficult to retain
information. Even if there is nothing wrong with giving greater importance to
the students’ grades than the learning experience, it is overwhelming for
students to try and digest that amount of information each year. It gives
children the impression that school is boring and removes the feeling that
learning should be a joyful experience that can be immensely rewarding to
them.

As important as the school curriculum is to a student’s development, it is not


the only way to increase knowledge and skills. Since school can be
sometimes difficult to handle and it does not allow them to reach their full
potential, we can overcome challenges with learning games. The best thing
about educational games is that they can provide new ways of understanding
our own innate aptitudes and help us learn effectively.

With the quick development of the video game market, pupils got many
opportunities to expose themselves to video games. A lot of developers and
designers have done a lot to combine video games and education through
educational games.

The purpose of this project is to come up with an idea for an educational


game for primary school students that is complementary to their school
curriculum. We developed an educational multiplayer game targeted for
primary school students aged 8-12.

This document Contain three chapters:


First <<​General View​>> Explain the game, how it works and how it will
benefit the player.
Second<<​System Design​>> will model our system using UML. It will
explain how the game works and how it is built.
Third <<​Implementation​>> is the part where we break through the
tools we used in making the game. It will also explain our choices of certain
softwares over others

6
Chapter 1: General View

● Introduction

This chapter will lead us through the concept of educational games.


We start by the problem that caused the invention of educational games, how
video games solved these problems, then we will talk a bit about video games
in general and then classifying them by their types, after that we will have a
general explanation for what serious games are, and then we dive into the
game we developed from the player’s point of view, and finally we finish by
discussing the benefits for the player’s needs.

● Problem

Every kid occasionally grumbles about school. But five to ten percent of kids
dislike it so much they don’t want to attend and there's so many reasons
behind that

- Loneliness​. Some kids dislike school because they have no friends.


This may be the case if a child is always alone, feigns illness to avoid
class outings or gives away treasured possessions in an attempt to be
liked.
- Trouble Learning. Some children’s school complaints spring from
physical problems. For them, “hating school is really frustrating at being
a step behind, no matter how hard they try,” says psychologist Harvey
Mandel, co-author of Could Do Better.
- HomeWork. ​Childrens always complain about homeworks especially
when there's a heavy load of it so he spends the night awake finishing
them.

7
All these factors can cause a horrible experience to every child in
school and transform the school from a paradise where kids get
knowledge and skills to a nightmare​.

● Possible Solutions

Technology just can't stop evolving and getting into everything in our
lives with all possible means, one of the recently added technologies to school
are video games. ​video games can help people see better, learn more
quickly, develop greater mental focus, become more spatially aware, estimate
more accurately, and multitask more effectively which make it an ideal
solution for such a problem, not just because the mental improvement that
video games allows, but also for moral sides which is the most important for
us considering that our game will target childrens between 2 up to 12 years
old.

Simple games that are easy to access and can be played quickly, such
as "Angry Birds," can improve players' moods, promote relaxation and ward
off anxiety

➢ How Videogames Can Help School in this case ?

By simply merging both moral and mental sides of improvement that


video games provide and add knowledge to it, video games can become very
effective in such a case, a game that all kids enjoy and learn from it.
This is called << ​Educational Games​ >>

● Video Games

There are two ways to explain what exactly a video game is: the easy,
simple way, and the really complex way.

8
The easy answer is that a video game is interactive digital entertainment that
a person can play via a computer or a gaming console (XBOX , Playstation),
or mobile devices such as tablets, mobile phones or nintendo switch.

A more complicated explanation, Video games are sports that take place in a
computer. They’re interactive TV shows and interactive movies. They’re digital
board games and card games. They’re rough simulations of everyday life
including, probably, whatever you do for a living. Some video games are
works of artistic expression. Others don’t know what artistic expression is or
why you would care about whatever that is.
But they’re all video games. Playing video games fulfills a purpose in life. This
could include gaming for: relaxation, opportunities to exert control, enjoyment,
creativity, socialization, prevent boredom, challenge, and achievement. It
could also be used as a coping method or stress management.
Also, Gaming is a completely normal pastime for anyone and everyone. Even
if you are over 40. Not at all. Playing video games is actually healthy, as long
as you don't play too many hours everyday.

Video games can be classified as shown below:

↦ Action Games
↦ Action-Adventure Games
↦ Adventure Games
↦ Role-Playing Games
↦ Strategy Games
↦ Sports Games
↦ Puzzle Games
↦ Idle Games
↦ Serious Games

Educational games are a part of the serious games industry, we will take a
close look at serious games in this project and then we will talk in more details about
video games and education.

9
● Serious Games

Serious Games are designed for a primary purpose other than pure entertainment,
the word “​Serious​”[10] is generally used to refer to video games used in industries
like scientific explorations, health care, engineering, city planning, simulations,
space, education and more.

This term wasn’t used at all or lets say didn’t exist until 2010 [10], and was applied
then in almost all fields, the mentioned above and other and even politics, but still
serious games can be divided into 2 pieces.

- Simulation: ​Designed to closely simulate real world activities, this type of


game is used in almost every scientific field, and to better understand how our
world works, to set prediction for the future or even analysis.

- Educational Games​:.This type of games isn't used by any expert scientific


users, it is always dedicated to school kids, for learning and entertainment
purposes, usually uses the AR technology to describe the course in real life.
This is the main subject of this report and this is the app type of games we are
going to use in our project.

● Educational Games

Educational Games, Applied Games or Interactive Games. The main


purpose of this type of games is to provide entertainment and support learning
and education. Playing these games is fun for both adults and childrens and
very beneficial depending on the contexte.

However, Interactive games can be defined as a step beyond


e-learning. they push players (learners) to solve problems and take decisions
in order to achieve a defined goal.

10
Compared to general video games, serious games differ in one single
point, they have purpose other than entertainment. Depending on the purpose
or field of the serious game like education, science exploration, engineering,
politics, etc., it helps the player acquire knowledge about that subject.

Video games also help improve children's mental abilities such as


reactions, problem solving, thinking faster, awareness etc. and also the kids'
mood, changing the idea of school is hard and boring, and helps kids to make
friends faster by playing together with these games and cooperating in order
to achieve the goal.

Following that, we explain how serious games benefit players and how
it does. and then we will focus on the game developed for this project and
how it fits into the general shema.

● Benefits of serious games

Serious games have very precise objectives: Transmit the specific


skill-set to players (​Learners​) by putting them into situations where they need
deep thinking and focus to overcome. Challenges make them much more
comfortable facing similar obstacles outside the game.

Let's suppose we have a math-focused interactive game in which the player is


confronted with a very hard equation. Player will try to solve the problem for
sometime and even if he does not solve it while in game he still have
advantage in attempting it if he faces the same problem in class or in a test
because he simply tried thinking about it if we compare him with someone
who never encountered it.However, this sounds more like doing homework
and it goes against our goal of making something that is complementary to
normal school work. This is why we need to mention that we also focus on the
entertaining part of the serious game so that it differs from schoolwork. The

11
player, who is also the student, will want to play our game and will not think of
it as a boring homework assignment.

The benefits of games in general is that they increase problem-solving


skills, hand-eye coordination, and improve the accuracy and speed of
decision-making. While these skills are very general in a sense that anyone
can acquire them not only by playing games but also through other methods,
it is important to take time and point it out since it is the core of what games
provide to players.

Educational games do not just entertain us like any other game, but
they also benefit us from an academic standpoint. Playing them gives the
player an edge and facilitates learning, which translates to mastery of
important skills and improved marks.

This project is very important to us as we started playing games at a


very young age and we went through this process of learning. We found
ourselves in a place where we had an advantage over our classmates who
did not share our passion for playing games. For example, most of the time
when others were not coping well and unable to understand a chapter in
math, history or physics, we already had a solid base of understanding them
from all the serious games we played that were realistic and used real-life
events that occurred or showed how people from a certain civilization lived
during a certain period of time.

Most of our knowledge about games comes from our own experience.
We are very passionate about this project since we benefited from serious
games when we were younger. Therefore, we know how to proceed to
structure games to benefit players since we were in their place before.

12
● Concurrence

There is a lot of big companies that make a stock of billions of dollars each
year, and for a new project and a new idea it's hard to compete with them, so
winning the local and arabic market first is a smart move since video games industry
in tunisia and in our arabic world is still fresh, new and empty, there is few
companies in our dear country working on the same context such as “​ENVAST​” and
“​3DWave​”, each have some professionals educational masterpiece games, and to
be able to compete with them we need to make something new, something totally
different, so the hardest questions was!

➢ What are the new features can we add to our game ?


To ​answer this question we need to know first what other games have and
how they work.

Fortunately, most startup and companies picked the easiest way to make an
educational game with valuable content, its by making an AR magazine, an AR
magazine - as the name says - is a magazine that content only pictures, and a
mobile app developed with unity and an AR technology called Vuforia to add 3D
objects animations and more to the game, sometimes the app start telling story
about the picture found at any page, or only shows a 3D environment and text
around for explanation.

13
As shown in the picture, we have an epic dinosaur 3D model appearing on top
of a dinosaur picture in a book for a better understanding of how this dinosaur looks
like back in time.

This type of educational games is traditional and very consumed specially by


new startups for being so easy to implement, and a fast way to have a product in no
time, also such a game is boring and not entertaining at all because it doesn’t
implement any multiplayer, no cooperation between students, no interaction between
childrens and their teacher.

Making a game that solves all these problems will be a great move, with
childrens have much more freedom in with game so they can interact directly with
their character and the environment of the game, and with a multiplayer system
implemented in game that allows kids to play together, have fun, forget about school
being boring, and learning while enjoying it and making new friends, this could be a
great first step.

14
● Project’s Background

This project is to create an educational, Multiplayer game for students


to be a complementary to their school curriculum. It focuses on logical
thinking, quick decision making, planning, cooperating with their classmates,
and also the competitive side.
Multiplayer games allow us to explore this functionality freely and in a
more flexible way. This occurs through the running of four different paths with
completely different mechanics and objectives but leading to the same goal.

Our choices of this game style (Game theme and Gameplay) was
strongly influenced by the modern third person games and the old educational
games that we’ve played during our childhood. Our game is a mixture
between the old and modern gameplay mechanics and we want kids
nowadays to enjoy our game to experience the same good feelings as we did
when we played them.

● About The Game

A backstory is often employed to lend depth or believability to a story.


In our case, it is very useful to add to the experience of the players of the
game.

Our game begins with our friend “Farid”, Yes the same tiny little robot
from the educational AR magazine “Farid Around The World” by “Horizon”
startup, he now has a big spaceship and he wants to discover the whole earth
and the solar system and he needed some company so he took some
children with him in his journey.

The Main Objective is to collect as much as possible of information and


use them to solve the final puzzle and pass to the next level, the competitive
side of the game is combined with the cooperate system that allows 2 or more

15
students to help each other and pass together to the next level where they
start gathering information again and solving problems.

● Gameplay
the player’s role in the game.

I. Welcome Scene

As stated in the title, this is where all players start playing, this scene is
where they log into the game, all students already have accounts stored into
the school special ​Unit PUN2 database ​which is a special realtime database
developed for video games. This scene grants children's access to some
information such as their highest points records, history of achievements
unlocked and more and also allows them to start playing the game.

II. Lobby

Lobbies are menu screens where players can inspect the upcoming
game session, examine the results of the last, change their settings, and talk
to each other. It's also very important for the matchmaking[8] process where
all players get ready, finish the internet and bugs check before joining the
game.

The main reason for using the lobby in this project is to avoid students
from different classes overlap, using the room functionalities in lobbies where
each class has a separate room inside the lobby so the teacher, Instructor,
Supervisor can simply add his students to their classroom lobby and make the
play together.

III. In Game

Here the most important game mechanics the player is going to


experience.

16
A. Exploring

The Player can control a 3D character around the map he found


himself in, he needs to explore for more points and to find much more
collectible items that can help him pass the level faster.

B. Facing Obstacle and solving problems using cards

Here where AR takes place, the player (Learner) can sometimes


find himself stuck inside a room or in such a situation where he can’t
continue his exploration, here he can use one of the 3 type of cards
and use the device front camera to scan the card recognize it and give
him a question, quest, or random items that if he understand how to
use he can overcome his current situation.

example: the player is stuck inside a room, to get out he needs


to open the door. A scan card pop-up to tell him to scan a question
card, after the player passes the card in front of the camera a random
question will appear if he answers the door will open or else he must
retry or ask for the help of one of his friends.

C. Gathering Information

Players are already exploring the map in order to gather as


much information as possible and also for much more points to unlock
the final puzzle. This will help increase their Observation ability and
their Promptitude.

17
D. Solving Final Puzzle

After sometime some players will get enough points to unlock


“The Final Puzzle” which design the end of each level, whoever
succeeds in solving it will pass the next map where things get harder.

The final quest can be anything like a question, finding an item, actual
puzzle game and more​...

● Cognitive Gains

This part is important since the main goal of the game is to help
students acquire skills that will help them in life and their school curriculum.
These skills might relate to some issues they face in school or general skills
needed for their development. The rest of this section explains the main skills
used and how the game helps players acquire them.

I. Decision Making

Decision-making happens in our daily routine. It is not a skill that


someone needs to be taught. It is just something you need to upgrade over
time. The more the person gets into hard situations, the more he develops this
skill and gets out of bad situations in the future.

The game increases in difficulty over time. With more clients showing
up, the player will be under pressure to ensure he does everything correctly
and within the time limit. He will learn to deal with pressure, which is one
important factor in people making incorrect decisions.

II. Problem solving

You can find a lot of restrictions in video games that players need to
consider in order to play properly. Those restrictions force the player to think
carefully before making decisions in order to stay within the bounds of the

18
game. Also they need to make those decisions rapidly – in a few seconds – in
order to advance to the next stage.

This skill is used in all roles in our game since the restrictions and constraints
require them.

In addition, they make the game more challenging and fun. The more difficult
the game gets, the more the player will get involved since it is challenging to
win when something is difficult.

III. Memory

Video games require both ​Visual ​and ​Audial ​memory. The players are
required to read or listen to the instructions, which might only be provided at the
beginning of the game. players need to remember these instructions throughout the
entire game. Mastery of the keys on the keyboard helps the player move the
characters easily in the game. This helps improve muscle memory.

● Need Analysis

I. Functional Needs

Every player will be able to:


Play single / multiplayer
Check his high score after every round
log in, join the lobby, join the room and start playing the game
alongside his classmates.
After joining the game players start the map exploration and data
gathering.
When the game starts, the player will at all times be able to check the
options menu to enable or disable the sounds or leave the game.
When the game ends players can disconnect from their accounts.

19
II. Non-Functional Needs

Scalability: the game and specially the maps have a very big
potential to grow with more updates. It can support more features and
more quality improvement.
Maintainability: The way that we developed “Into the Horizon”
makes it very easy to fix bugs and deal with issues that can show up.

● Conclusion

In this chapter, we explained the reasoning behind this game. We started with
a very basic introduction to educational games and what are their benefits. Then
justified that our game’s compliance with the educational game industry by
describing its objectives and how it will achieve them. In the next part, we will
present the system design using UML modeling language.

20
Chapter 2: System Design

● Introduction

This part, we will illustrate our game’s system and the user’s needs
throughout diagrams. The diagrams we show are the Use case diagram,
Package diagram and Sequence diagram.

● System’s Functional View

1. Actor Identification

We can only identify one single actor in this case:

The Player: ​The person playing this game, also there will be Much
more players since the lobby can hold up to 15 players, but in each use case
we will just look at only one of them considering that all players can do the
same thing.

2. Identification of use cases

This diagram illustrates the player’s first interaction with the game. It
shows what students can do when the game starts.

21
Figure 1: use case diagram of the main game scene
To play the game, the player should log into the game, options like
enabling volume or volume change doesn’t require an active account in order
to be managed.

Being logged in allows the player to join a game, we will explain this
process in detail with the gameplay use case diagram. While playing the
game player can do the main four in game actions which are:

Move character: ​using joystick touch screen to move the character


around the map.
Collect items: ​Collect random items can be found around the map.
Scan Play Card: ​Getting stuck in some levels or getting points boost
or finishing missions require player to scan one of the 3 possible cards type:

- Mystery: this card can provide a random help with points, boost,
bonus items to the player should use it in a smart way while he
can use it only 3 times per level.
- Question card: this card is required most of the time to get out of
tough situations such as getting stuck in a room or elsewhere.
- Action Card: this cards isn’t implemented in the game for now,
this card ask the player to perform a specific action while the

22
professor is supposed to use his application “Into the horizon
teacher” to evaluate the student, this action can be a quick
theatral piece, draw something on paper, or sometimes it could
ask him to scan another card.

Solve Final Puzzle: ​Final puzzle found in a specific point of every level
and requires a certain amount of points in order to unlock it, final puzzle is a
test about the information the player collected, found, heard or seen.

3. Main Use Case

In this part we will look into the details of the main use case of
the game. We will go through the main scenario that all players are
going to experience.

23
Use Case Diagram of the “GAMEPLAY”

Figure 2: Gameplay use case diagram

Objective: ​Collect the X amount of points to unlock the final puzzle and finish the
game.
Actor: Player
Abstract: ​This diagram explains what the player can do while playing the game.
Post Condition: The Teacher stops the game and a result board shows up to each
player.
Main Scenario:
- The player Join the class lobby room
- The player start playing
- The player start collecting points with all the possible means
- The player unlocks the final quest by reaching the required amount of points.

24
- The player finish the final puzzle and pass to the next level
Alternative Scenario: ​The player leaves the game, no errors will occur as long as
the host device’s app (Into the horizon teacher) is running.

4. Predefined Unity Classes

Those predefined classes are used in all of our scripts, they allow us to
use the unity predefined functions and classes in order to build the game
logic.

● MonoBehaviour

MonoBehavior is the base class from which all unity c# scripts derives, it
contains all the the ​Unity Engine C# predefined classes and functions that allows us
to build the game logic.

● NetworkBehaviour

A class inherits from ​MonoBehaviour, ​performs high-level API functions and


contains predefined classes responsible for networking stuff.

● Package Diagram

The Package Diagram is one of the UML diagrams family composed of


packages and dependencies between them only. Package is a group of
encapsulated and grouped files in some sort of folder, while dependency named link
between two packages.

25
Figure 3: Package diagram

This diagram shows the general overview of the game system. The Game Logic
Layer handles the mechanics of each scene. The Multiplayer Manager Layer
handles the synchronization of the order between the players​.

● Dynamic view of the system

The sequence diagram shows all the interactions between objects in the
order, which these interactions happen.

The diagram below shows what happens when the player starts, joins and
interacts with the game, it is important to mention that this is the normal scenario for
all players, else in an open map level players can do what they want at any order.

26
Figure 4: Sequence Diagram of the game lifetime

27
One Actor which is the player and 2 life times, the first is the interface which is
the visible part that design the results of each action the player does like pushing the
left stick forward to move the player forward.
The second life time is the system, the background part of the game where
the executions and the result calculations.

The execution occurrence is covering the whole life time because the game
code is executed every frame, that means many times per seconds -like 60 times per
second for example- and this is how the unity engine works and execute his c# code,
so even if the player doesn’t do anything in the game the code keeps executing.

● Conclusion

In this chapter, we modeled our game using three types of diagrams. Each
one lets us observe it from a different perspective. It allows us to get a better
understanding of the game and how we made it. The next chapter entitled
Implementation will specify which tools we used to make the game work.

28
Chapter 3: Implementation

● Introduction

A lot of effort into a project isn’t the only key factor to make it successful, we
need also to make good choices about how the job should be done. Choosing the
tools to make a game is an important aspect.
In this chapter, we will describe the tools and technologies we used to make
the game and show the end result step by step.

● Hardware environnement

This project is developed using :

- PC ASUS X550J :
Intel® Core-i7 4720 HQ 2.6GHz Overclock 3.6 GHz.
Ram: 8GB
Graphic Card : Nvidia Geforce 950M 4 GB VRam

- Tested using: Samsung M20 3GB Ram, OctaCore 1.8GHz

● Software Environment

A. Audacity:

Audacity is a free and open-source digital audio editor and


recording application software​[3]. It allowed us to edit all the sounds
we put into this game .We were able to adjust them to the game’s main
theme

29
B. Programming Language

C# is a simple, object-oriented, modern, general purpose


programming language developed by ​Microsoft ​within its .NET
initiative led by ​Anders Hejlsberg​[4]. Unity supports only c# language
which has been used for the whole game.

C. Game Engine

A ​game engine​, also known as a ​game architecture​, ​game framework or


gameframe​, is a ​software-development environment designed for people to build
video games​.[9]
Developers use game engines to construct games for ​consoles​, mobile
devices, and ​personal computers​. The core functionality typically provided by a
game engine includes a ​rendering engine ("renderer") for ​2D or ​3D ​graphics​, a
physics engine or ​collision detection (and collision response), ​sound​, ​scripting​,
animation​, ​artificial intelligence​, ​networking​, streaming, ​memory management​,
threading​, ​localization support, ​scene graph​, and may include video support for
cinematics​.

Implementers often economize on the process of ​game development by


reusing/adapting, in large part, the same game engine to produce different games ​or
to aid in ​porting​ games to multiple platforms.

● Technologies

A. Unity3D

Unity3D is a cross-platform game engine that allows making 2D, 3D, VR, AR
Games. This engine can export to more than 20 platforms including Android games,
IOS, desktop, etc. Unity was released in June 8, 2005 supporting Javascript and C#
but since unity 2017.0.1f Javascript was removed and C# is the only programming
language supported by unity3D.

30
B. UNET

UNet is Unity's legacy multiplayer solution[5]. It provides developers with


network behavior that allows players to play the game multiplayer either through a
local host or online.

C. Integration with android

Our game supports only android for the time being, and can be playable on all
android devices with at least android v4.4, The integration with Android has never
been easier with Unity which requires only the Android SDK and JDK to be able to
build the game for Android devices.

● WHY Unity3D

Unity3D and his Eternal competitor ​Unreal Engine ​are the only open source
game engine providing all professional functionalities for free except getting a fee
between 10 up 20% of the game income after launch and you can get rid of that
buying one of these softwares packs that provides you with professional courses and
free assets alongside tools that helps accelerate programing.

Choosing between these 2 is hard because both of them are professional and
still have a lot of advantages to be used in this specific projects.

First, Unity is the most popular game engine and consequently it has the
biggest community of users and developers and one of the biggest forums, this
makes looking for solutions, bug fixes and professional tips much easier than Unreal.

Second, the project's peculiarities. Our game is a 3D low poly style, low
frame, low graphic, mobile game. ​Unreal is best suited for developing highly
graphical and photorealistic games, Unity ​– while still able to produce high- quality

31
visuals – takes a lot more work to get your assets looking close to the same level as
Unreal, which makes us exclude Unreal engine.

In addition, more than 60 percent of mobile games are developed using


Unity3D[6] because it’s the most optimized engine for low configuration devices such
as mobiles and tablets.

Finally, Unity is easier to learn than Unreal, supporting C# which is much


easier than C++ in Unreal engine.

● Making the Game

Making a video game inside unity passes through 4 steps


- Setting up a project
- Separating assets by their type
- Building the level ( This Job is called level design)
- Coding the game logic using C#

1. Setting up our project

Unity has a very powerful tool called ​Unity Hub that helps setting up a
project, this step is very important, you have to define a name for the project, the
project type (2D, 3D, AR, VR etc..) type of Visual settings HDRP or normale graphic
which in our case is normale because we are aiming to low configurations devices,
also setting up the build target which is Android, the screen resolution responsivity
and finally importing all the assets required for the project

32
Figure 5: Unity Hub project setup tool

2. Separating assets

This process goes through making folders for each type of files like
models folders, scripts, textures, shaders etc..

Figure 6: Project Manager

It is considered one of the most important phases because it helps the


game developer or the level designer or even a team of developers to access
all kind of assets faster rather than looking into a bunch of 3D/2D models and
script files

33
Figure 7: 3D objects, buildings Ingredients
Building assets: Walls, floor, ground, sign, etc..

Maps are built using multiple pieces, like walls, roofs floor, sign doors
environment etc., 3D artists could make simply a full map in 3D but that doesn’t
gives much flexibility in the project, you can’t control objects, animations, lightning,
collision or even trigger action if each part is connected to the other.

Figure 8: 3D Objects, tools, decoration, objects

Here we managed to organize over 235 models of decorations together and


by categories.

34
3. Protecting the project

The Unity Technologies team cares about their user’s security. This is why
they provided them with ​Unity Collaborate [7] ​enabling small teams to save,
share, and sync a Unity Project in a cloud-hosted environment. Using
Collaborate allows your entire team to contribute to a Project, regardless of
location or role and also keeping multiple versions of the project backup
during the development so no worries about losing the project.

Figure 9: Unity Collab, Pushing changes to the cloud service

4. Coding the game logic

Making the level and adding characters to the game doesn’t mean it will work
by itself, we need to tell each object in the game how it behaves and how it interacts
with the player and the other objects in the game.

Our game uses a lot of scripts attached to multiple objects in form of


components, to build all our game’s gameplay mechanics and make the core engine
of the game, Later even removing all the map and replacing it using another map
won’t affect anything in the game.

35
● Character Movement

The main character in this game “Farid” is a 3D humanoid model which


contains a baked animation, baked animation is a pre-computed animation cycle
attached to the model in order to speed up other processes later, in our case we are
going to use it inside a game.
Farid should move around the map and start the animation cycle at the same
time, this process starts by adding a new component to the 3D model and to keep
things clear, to give functionalities to a Gameobject you have to attach components
to it, and you can access these components through scripts because simply even
your scripts are attach to any gameobject as a component like shown in the screen
below.

​Figure 10: Unity Inspector, Animator and Move script component

The Animator component takes as argument the Animator controller


which is the file that control the transition between the walking animation to
the run animation or idle animation for example using boolean or trigger
parameters.

36
Figure 11: Unity Animator Controller

explaining this is easy, if the “Walking” boolean variable is true then the
animation goes from looking around to mixamo walking else it returns to looking
around.

Now that everything is setup, we need to manage this transition using the c#
code and it is worth its worth it to speak briefly about unity c#.

here we have 4 main Methods called automatically by the engine:

Awake(): called while the game is loading.


Start(): called when the game starts.
Update(): Called every frame, if the device records 100 frames per
second this method will be executed 100 times per second, it is highly
recommended to avoid managing tables, string and calculations inside this
function.
LateUpdate(): same as update but it waits till the update method gets
executed before the engine calls it.
FixedUpdate(): doesn’t matter how many frames you record, this one
is executed every 0.02 seconds (50 times per second) used in physics
calculation.

37
Now we hop into a visual studio.

Figure 12: C# movement script.

Joysticks are a well known type of mobile touch screen input, it is simply a
circle that players can drag to any direction and it returns a positive or negative ”1”
value each representing a direction.

Direction Value

Left 1
Right -1
Up 1
Down -1

These values are used later to define what direction the player will walk in.
else the movement variable which is in type of vector3 is a vector type that contains
3 values (X,Y,Z), this value is going to be added to the player’s transform position
coordinates to create the movement action, it has in it the Camera look direction so

38
the player will always walks according to where the camera is looking, it has the
Joystick variable to define what direction the player wants to move in and also a
direction variable which will keep rotating the character toward his walking direction
using the Quaternion built in Actions.

Finally, it is important to change the “Walking” variable each time we receive


values from the joystick so we can play the animation cycle alongside the position
change action.

● Camera rotation

Giving players the ability to orbit the camera around the player is a main
functionality we should add since the students are going to look around the map for
puzzle pieces, items or possible information.

Since our 3D model has a pivot point we used it to rotate the camera simply
around it.

Figure 13: Camera Orbit Script

● Collision, Triggers, actions on collisions and calculations

Unity3D has the best and most optimized physics engine if we compare it with
all the open source game engines. it manages all real life physics in details like we
have in this case with Collision.

Collision is clear and it's a part of our real world physics, simply we don’t want
our character to pass through the wall, this uses a very basic collider with any type
like, a box shaped collider or sphere collider as a component, but unity c# allows us
to get much more information from this collision like the power of the collision,
accessing all the other object components or scripts, or even using these colliders to
let other objects pass through but trigger an action if he gets into it.

39
This project is an educatif game where the player can sometimes pass near
an object and the game main character “Farid” can start talking about this object.

In unity every collider component has a set trigger checkbox that makes any
other collider pass through it but also makes it do actions if that happens like in the
frame below.

Figure 14: Collision detection, trigger actions

Using the onTriggerEnter(Collider other) Method that returns the other object
in the “other” variable, setting the question panel to active so the manager script can
run, find a random question and fill the panel with the question answer and
everything required for the quest.

Here we faced a problem, what if Farid’s model passes through 2 or 3 other


triggers at once, which voice clip the audio manager should play?

40
Figure 15: 3 Connected sphere colliders

The idea was to consider only the one the player’s camera is looking at at the
same time as the two colliders collide.

Figure 16: getting objects in front of camera scripts

It goes by accessing the “Main Camera” and measuring 10 unity units (1 unity
unit = 1 meter in real word) and return all objects hitted by the ray we casted from the
camera for 10 units forward and return which object has the tag “Information” (We
can assign tags to objects to specify which one we need to access and which one
we don’t) like that we only get the object we want and we ignore the others who’s not
directly in front of the camera and play the Audio Clip.

41
● Optimization

Even so Unity is executing the programming code many times per second it is
still very optimized and the best for low performance devices, and still he provides us
with many tools to help developers add much more optimizations to the game in
order to reach “Ultra-High Performance”.

Since our game is made of hundreds if not thousands of elements for the
map, many scripts executing every frame, and a lot of physics such as collision
detection, trigger detection, gravity, movement force, lightning and more we need to
keep it optimized as much as possible for mobile and tablets, to do so we use these
tools.

- Profiler

Figure 17: Profiler


Profiler is a tool found in many development softwares such as android studio,
unreal engine, eclipse etc., but unity took it to a whole new level by measuring all the
device resource usage like GPU, CPU, Memory and hard drive and also physics
3D/2D, Global illumination, UI and audio to keep track of what part of the game is
taking more resources than normal.

- Static

Most of performance issues comes from rendering 3D/2D objects, Collision


detection, physics or lightning, so when you have objects that doesn’t change or
move over time it is highly recommended to set it to ​STATIC ​so the engine will apply
all the calculations on it for once or for couple times per seconds if need it to lower
the device resources usage.

42
- Occlusion Culling

A tool that help always improve performance by more than 50%, it simply
allow the camera to render all objects in front of it and ignore the rest as shown in
the figure below

Figure 18: occlusion culling result

The game could render 23 frame per second till we applied the occlusion culling
To reach 98 frames with lower resource usage.

● Audio and voice clip

- Audio

Audio in Unity is easily managed using a Audio Source and Audio


listener component which are attached respectively to the object and the
camera.
Audio listener is obligatory in the camera or else the game will play no
sounds.

43
- Voice Clips

Farid should talk and make a robot voice while talking about his
precious information, but with the absence of professional equipment, it's time
to improvise.

A Samsung Galaxy M20 was used to record the voice clips at the
highest possible quality (256kbps, 48khz) but still the problem of the
background noise and my normal human voice so using audacity is required
to solve these issues.

First of all starting by identifying the parts where pure noise exists.

Figure 19: Noisy voice clip.

Then Getting the noise profile and removing it from the whole track even if this
profile is found while talking, Normalizing it to ​make multiple tracks have the same
peak amplitude and equalize the balance of left and right channels of stereo tracks
and finally increasing the pitch by 40% to have a good robot voice with clean voice
and no background noises or stereo channel issues for headsets.

Figure 20: clean normalized voice changed audio clip

44
● Multiplayer

Implementing multiplayer in unity could be dones using multiple services like


firebase realtime database or PUN2 which is “​Photon​” or using the built in UNET
technology, the difference in firebase is not good for a game that send and retrieve
data every frame but every specific action or every role like a chess game but here
we have at least one character changing position almost every frame so we
excluded firebase.

In our case we are supposed to make the game connect to the host device
which is the mentor device using the “​Into The Horizon Teacher​” which will be
developed in another time after the game mechanics is ready.

But it is important to mention that we worked on a prototype where 2 players


can connect into the same game for a better demonstration of the gameplay. The
technology used in this prototype is UNET technology by unity3D.

Note that the UNET technology now is deprecated and could be removed at
any time to announce the new UNET 2.0 so no guarantee that the game will be
functional in the next few days or weeks.

The screen below shows 2 players in the same spaceship playing with the
ability to cooperate in game and play together and collect the points together in order
to pass the level faster.

45
Figure 21: Multiplayer Gameplay

Unet doesn’t require so much programming and sometimes it doesn’t at all


because most of the functionalities like the lobby, the matchmaking and player
synchronization are built-in so you can run your multiplayer game in no time.

● Final Beta version

MAIN MENU

46
First implemented MAP

Sound Options

47
General Conclusion
In this project, we made an educational game that allows students to learn
with no stress of it being through assignments. This makes students appreciate the
learning experience without stress and subsequently get better understanding of the
subjects included in this game.

With this objective in mind, we managed to create a functional full mechanic


prototype of an educational mobile multiplayer game for students that tests their
knowledge of these themes and improves it. With unity as a game engine and some
other software, we managed to make a simple yet fun game that players can brag
about upon reaching a new high score with their friends.

With the time we were given to make this project, we managed to implement
most of what we had in mind for the game. However, while working on this project,
many more ideas appeared that would make this a more successful game such as
making it cross-platform and not only on mobile.

We learned a lot through this project and not only on the technical side of
things. While browsing through documentation about other games, we discovered a
new mindset of mind to have while creating a game from scratch. It is different to
create a game than to play it. Playing a game requires the player to focus solely on
the game, but the developer must think about the players’ needs at every single
point of the game, especially from an entertainment aspect. The player has to feel
engaged in the game and driven to play much more. That is something the
developer of the game has to prioritize because that is the main thing that he is
selling.

Coordination with my professor and my supervisor in the “New Horizon


Start-up” was necessary to make this project possible as well. We had to

48
synchronize and make decisions collaboratively. At the end, this effort rewarded us
with a great game.

49
References
[1]: date 28 august 2020
​https://docs.unity3d.com/ScriptReference/MonoBehaviour.html

[2]: date: 31 august 2020


https://www.guru99.com/uml-class-diagram.html

[3]: date: 31 august 2020


https://en.wikipedia.org/wiki/Audacity_(audio_editor)

[4]: date : 1 september 2020


https://blog.usejournal.com/object-oriented-programming-concepts-in-simple-english-
3db22065d7d0?gi=6ca8f1bb4290

[5]:
date : 1 september 2020
https://support.unity3d.com/hc/en-us/articles/360001252086-UNet-Deprecation-FAQ

[6] date : 1 september 2020


https://www.creativebloq.com/advice/unity-vs-unreal-engine-which-game-engine-is-f
or-you#:~:text=One%20of%20the%20main%20differentiators,the%20same%20level
%20as%20Unreal​.
AND
https://unity.com/solutions/mobile

[7]
date : 1 september 2020
https://docs.unity3d.com/Manual/UnityCollaborate.html#:~:text=Unity%20Collaborate
%20is%20part%20of,regardless%20of%20location%20or%20role
.
[8] date : 1 september 2020
https://en.wikipedia.org/wiki/Matchmaking_(video_games)#:~:text=Lobbies%20are%
20menu%20screens%20where,the%20end%20of%20each%20session​.

[9] date : 2 september 2020


https://en.wikipedia.org/wiki/Game_engine

[10], [11] date : 2 september 2020

50
https://en.wikipedia.org/wiki/Serious_game#History

51

You might also like