2D SandBox RPG Game Using Unity
2D SandBox RPG Game Using Unity
2D SandBox RPG Game Using Unity
BY
Md. Harun-Or-Rashid
ID: 12331418
Supervised By
Sadia Jahan
Lecturer
Department of CSE
City University
CITY UNIVERSITY
DHAKA, BANGLADESH
FEBRUARY 2017
This project titled Role Playing Sandbox Simulation Game submitted by
Mohammad Sazzad Hossain Khan and Md. Harun-Or-Rashid to the department of
Computer Science and Engineering, City University, has been accepted as satisfactory
for the partial fulfilment of the requirement for the degree of B.Sc. in Computer
Science and Engineering and approved as to its style and contents. The presentation
was held on 25th February, 2017.
APPROVAL COMMITTEE:
ii
DECLARATION
We hereby declare that, that project has been done by us under the supervision of
Sadia Jahan, Lecturer, Department of CSE City University. We also declare that
neither this project nor any part of this project has been submitted elsewhere of any
degree or diploma.
Supervised By :
Sadia Jahan
Lecturer
Department of CSE
City University
Submitted By :
Md. Harun-Or-Rashid
ID: 12331418
Department of CSE
City University
iii
ACKNOWLEDGEMENT
First, I want to say thank you to the most influenced people during my
research time. They are my parents, Abdul Jalil Talukdar and Hamida Begum, then
my sibling, for their continuous support and criticism.
I would like to thank my utmost capable and kind supervisor, Sadia Jahan for
providing me supervision. Her esteem guidance and simple words kept us right on
track in my project completion.
iv
ABSTRACT
This paper presents the outcome of the first stage of an ongoing research that
deals with games integration in real world perspective. The main goal of my research
is to develop sandbox virtual area where player will experience a reference of a
specific real world area. At the end of the research, a proposed game is developed
using the model of our university campus. This game application is going to help
reach the state goal with attractive user interface, interactive environment and
functional capabilities. Students or Non students, whoever is interested about our
University will find this an amazing guide to know our campus virtually by playing
and exploring the games. Moreover, it can be also used to simulate ideas of the future
plan to develop the university facilities.
This research also explores the domain of which games benefiting the player
and the student in acquisition of skill, knowledge and in medium as practical platform
for learn knowledge.
KEYWORDS:
Interactive Game , Sandbox Simulation Games, Role Playing games
TABLE OF CONTENTS
CONTENTS
Approval Committee......................................................................................................ii
Acknowledgements ....................................................................................................... iv
Conclusion ..................................................................................................................... v
CHAPTER
1
CHAPTER 2 : LITERATURE REVIEW ............................................14
2
CHAPTER 3 : METHODOLOGY .......................................................21
CHAPTER 4: SYSTEM
ANALYSIS..............................................................................................27
4.1 Introduction ............................................................................................................ 28
3
4.1.5 Tiled Map Editor ................................................................................................. 33
4.3.5 Portability............................................................................................................ 37
4
CHAPTER 6 : SYSTEM IMPLEMENTATION AND
DEVELOPMENT
..................................................................................................................46
6.1 Introduction ............................................................................................................ 47
5
CHAPTER 8 : DISCUSSION ................................................................71
LIST OF FIGURES
Figure 1.1 : Milestone schedule for Games ............................................................... 11
REFERENCES 75-76
6
CHAPTER 1
INTRODUCTION
7
1.1 Project/Thesis Title
1.2 Introduction
We are living in such an era when technology is used not only for our must
need necessities but also gain comfort and entertainment. Among tons of
entertainment Game is one of the biggest and most powerful form of entertainment
that technology gave us. From multimillionaire youtuber PewDiePie, billion dollar
AAA industries, Indie game developers to small tea stall businessman, by the
booming popularity of mobile casual games like Candy Crush or Clash of clans,
have become the part of gaming universe. Although we dont agree that the
addictive nature of gaming is good but it is scientifically proven that video games
not only can improve problem solving, multitasking, self-control ability but also it
helps to reduce stress, depression and pain. Day by day People are becoming more
aware about the power of gaming that playing video games are not a silly child
thing any more. Games can be based on Fantasy world full of imagination or it can
be based on real life simulation. This fun interactive medium can give user the
experience not only to reading a book or watching a movie but also take part into
the action with story and visual graphics.
A video game is an electronic game that involves interaction with a user
interface to generate visual feedback on a video device such as a TV
screen or computer monitor. The word video in video game traditionally referred to
a raster display device, but as of the 2000s, it implies any type of display device that
can produce two- or three-dimensional images. Some theorists categorize video
games as an art form, but this designation is controversial.
The conventional method of teaching and learning is no longer effective in
order to impart the vital facts and skills foundation the student need for their future
8
life. Although game deployment in education is still new but proving to be much in
demand as games provides the needed features of interactivity, fun, communication,
critical thinking and also practice drill.
9
1.5 Project Objective
This research is on how the gaming especially role playing based enhance and
affect in real world implementation. The outcome of research will provide
information on better games integration with the place we can see.
To study how the use of gaming environment can be useful to make
a look alike sandbox simulation.
The users of this game are the student, educators and anyone who wants to
have a university experience in an interactive gaming medium. Moreover, the
students related to City University and The interested students who want to study at
our university will find this amazing as they can check the physical world and the
virtual world both.
1.5.2 Technology
10
1. Unity version 5.5 : The game engine we use to develop our
game.
2. C# : The Programming language we wrote our code
3. Microsoft Visual Studio (2015) : To compile and run code.
4. Tiled Map : A tiled based mapping tool to build the 2D world.
5. Adobe Photoshop : To make Graphical Assets.
6. Audacity : To edit and tweaking Audio effects.
1.5.3 Environment
We use three Floor and the campus area of our university campus as the
gaming environment of this project. Furthermore, we used some maze to
inherited from Pacman games for our mini games.
11
1.7 Expected outcome/Benefits of the project
This project will bring upon an interactive system inherited from games which
will be not only helpful to guide new comers but also it increases the strength of
digital marketing of the institution. Moreover, we can include story and funny mini
games to represent the institution in a nice, friendly and interesting way
This research was done in order to find out how the role playing gaming
can be integrated into real world environment. The development of the games will
focus on students who currently are our university students. Although the game is
specifically focusing on building design and interactions but we are also keen to
make a story that will provide a glance of a life of a University student.
Role playing Action (RPG) game are the types of games where the
participants play as the role of fictional characters. They will decide up on the action
and behaviour of the character they play. The success and failures are determined by
a formal system set of rules and guidelines. Role playing games are a bit different
from other types of games as they stress more on social interaction and
collaboration while the other more emphasize on competition. Action on the
participants part will shape the outcomes and direction of the games.
Game that is developed also must have the capabilities to induce critical
thinking and impart the important key point of the subject without losing its fun
12
environment. A sit is a role play game based, an interesting storyline must be used
to deliver the objective of learning, the fact sand the skills students required to
know, understand, develop and mastered. The pace of the game can also be used as
an assessment of student comprehension and understanding.
1.9 Conclusion
The interactivity and problem solving in gaming can be utilized for a better
and successful earner production. As learning and teaching goes in both directions,
gaming provides an excellent field for students and educators to share their
knowledge. However, the gaming industry are still not equipped with the right
teaching strategy as the educators about games designing. As a lot of people is not
used to experience this medium pure gaming itself may pose a threat towards
foundation of valuable learning if implemented without proper guidance.
13
CHAPTER 2
LITERATURE REVIEW
14
2.0 Purpose of Literature Review
With the explosion of computers and technology, video games have developed
into a multi-billion dollar market in the entertainment industry. Many see these
games strictly as forms of unenlightened, recreational past-times. As with films
however, that would be a false claim. A more detailed examination of video games
and literature will no doubt reveal the similarities between them. Parallels can be
drawn simply because both are forms of art. Additionally, literature, when broken
down to its fundamentals, share many of the same characteristics as video games.
Knowing that, one may begin to see the different perspectives offered through video
games to discuss literary concepts in a new light. Due to its intimacy though, video
games may not be regarded for any intellectual significance, but there remains great
potential in them to effectively explore the many philosophies studied in literature.
From three basic types of strategic, planning, and learning exercises: games,
simulations, and case studies, a number of hybrids may be considered, including
simulation games that are used as case studies.
2.1.1 Introduction
To preview the aspects of gaming first we have to know what kinds of games
exist . As like as different food item give ones a different tastes and tastes varies
person to person game have similar effects on person to person.
15
2.1.2 Genre of games
Adventure games were some of the earliest games created, beginning with the
text adventure Colossal Cave Adventure in the 1970s. That game was originally titled
simply "Adventure," and is the namesake of the genre. Over time, graphics have been
introduced to the genre and the interface has evolved.
16
Unlike adventure films, adventure games are not defined by story or content. Rather,
adventure describes a manner of gameplay without reflex challenges or action. They
normally require the player to solve various puzzles by interacting with people or the
environment, most often in a non-confrontational way. It is considered a "purist"
genre and tends to exclude anything which includes action elements beyond a mini
game.
A role-playing game (RPG) is a genre of video game where the gamer controls a
fictional character (or characters) that undertakes a quest in an imaginary world.
Defining RPGs is very challenging due to the range of hybrid genres that have RPG
elements.
2.1.2.5 Simulation
2.1.2.6 Strategy
Strategy video games are a video game genre that focuses on skillful thinking
and planning to achieve victory and often autonomous decision-making skills have a
high significance in determining the outcome. Almost all strategy games require
internal decision tree style thinking, and typically very high situational awareness.
2.1.2.7 Sports
17
2.1.2.8 Educational games
Educational games are games that are designed to help people to learn about
certain subjects, expand concepts, reinforce development, understand a historical
event or culture, or assist them in learning a skill as they play. Game types include
board, card, and video games.
Sandbox RPG or Open World RPG allow the player a large amount of
freedom and usually contain a somewhat more open free-roaming (meaning the player
is not confined to a single path restricted by rocks or fences etc.) world. Sandbox RPG
contain similarities to other sandbox games such as the Grand Theft Auto series, with
a large number of interactive NPCs, large amount of content and typically some of the
largest worlds to explore and longest playtimes of all RPG due to an massive amount
of secondary content not critical to the game's main storyline. Sandbox RPG often
attempt to emulate an entire region of their setting. Popular examples of this subgenre
include the Dragon Slayer series by Nihon Falcom, the early Dragon Quest games
by Chunsoft, Zelda II by Nintendo.
18
2.3 Simulation Sandbox
Life simulation games (or artificial life games) involve living or controlling
one or more artificial lives. A life simulation game can revolve around individuals and
relationships, or it could be a simulation of an ecosystem.
Biological simulations may allow the player to experiment how surgeon does
operation with genetics, survival or ecosystems, often in the form of an educational
package. An early example is SimLife, while relatively recent ones are Jurassic Park:
Operation Genesis and Spore. In other educational simulations such as Wolf, the
player "lives the life" of an individual animal in a relatively realistic way. Hailed as
one of the greatest life simulation games, however, is Creatures, Creatures 2,
Creatures 3, where the player breeds generations of a species in a hugely detailed
ecosystem.
Unlike other genres of games, god games often do not have a set goal that allows a
player to win the game. The focus of a god game tends to be control over the lives of
19
people, anywhere from micromanaging a family to overseeing the rise of a
civilization.
20
CHAPTER 3
METHODOLOGY
21
3.1 Introduction
These two different approaches have now, for the most part, converged, and
little Johnny can play the latest games on the same system that daddy uses to le his
tax returns. This platform convergence (ignoring both consoles and antitrust suits) has
to be a good thing. It now means that, ostensibly, both business and game software are
written in similar styles. Both are now either coded in C or C++ and generally use the
22
application programming interface of the native operating system and a sprinkling of
third-party libraries.
Every game engine, from the simplest to the most complex, requires some
means of updating the internal state of every game object over time. The state of a
game object can be defined as the values of all its attributes. For example, the state of
the ball in pong is described by its (x,y) position on the screen and its velocity.
Because games are dynamic, time-based simulations, a game objects state describes
its configuration at one specific instant in time. In other words, a game objects state
describes its configuration at one specific instant in time. In other words a game
objects notion of time is discrete rather than
Continuous. Attractive the simple approach to object updating shown above may
seem, it is usually not viable in a commercial-grade game engine.
In our project we collected a huge amount of data from internet along with
physically going to the place. We used google map for geographical reference of our
23
University campus. In order to design the inner part we went class to class and sketch
up the design several times. As we build our project from scratch and without any
prior knowledge on Unity game engine we have do a ton of research and have watch a
lot of tutorials from YouTube. The book Game Coding Complete by Mike
McShfrry helps us to understands some good coding principles.
As this process is sequential, once a step has been completed, developers cant
go back to a previous step not without scratching the whole project and starting
from the beginning. Theres no room for change or error, so a project outcome and an
extensive plan must be set in the beginning and then followed carefully. To complete
the project in time we use this model to progress.
To make a sandbox based RPG game we have to consider what elements will
be present in the environment. Before dive into large designing we work with game
mechanics for our player to move up, down, left, right and other core functionalities
like NPC movement and interaction with objects in games. Moreover, we tried figure
24
out as much problem as possible to solve them in future phase. We finished our sketch
up model on paper for our project in this phase.
In this phase we discuss and perform analysis on our problems that we found
in the first phase. What movement code will be effective or how we will handle the
collision and trigger event in game, how large the game will be and from where we
will collect our resources to achieve our goal, all those question was asked and solved
in this section. Choosing game engine was a big dilemma at the beginning. Seeing the
simplicity, we first choose Game Maker Studio as our main game making workplace.
Although game maker studio is easy but its free version only support windows port
and without pro version there is no future of our android port. On the other hand,
Unity free edition give the comfort of porting games in cross platform including
android. So after doing the basic prototyping in game maker we understood that Unity
might be better for indie developer like us. And turns out Unity is a great tool but as it
was more focused on 3D there was a fewer tutorial on 2D gaming than Game Maker
Studio. So we have to dig a lot to find out the proper tutorial and have to a lot of asset
project from asset store of unity to understand advance 2D game development.
25
3.4.5 Phase 5: System Design and Architecture Specification
This is the most crucial part because if we failed to manage an effective design
architecture for our project the hard work of making game mechanics and graphics
designing will go in vain. To make and efficient design we have to research a lot.
Despite our limitation of time and people we do our best to make the design as user
friendly as possible.
Implementation is the phase where we put all the different pieces together. We
had to extra careful in this part to avoid as much mistakes as possible.
Finally, we ask our friends, family and teacher to perform the role quality
assurance taster of our game give us the valuable feedback. Testing is a must because
developing a system for a long time some time ignore some error where a fresh eye is
always helpful.
We discussed with our supervisor after every phase to keep notifying about
our progress. The valuable advice of our supervisors helps us to keep ourselves on the
right track.
26
CHAPTER 4
SYSTEM ANALYSIS
27
4.1 Introduction
Games can range from simple to extremely sophisticated but at the most basic
level every game performs the same core functions. All games take inputs from the
user, using those inputs they work out what effect it has had on the game state, finally
they display or animate something on the screen. After this, the process is repeated
until you either win or fail. Lets take the example of Angry Birds. The game starts by
setting up an initial game state. In this case it gives you a certain number of birds and
a pile of wood and pigs to destroy. At this point the game waits for input. If you don't
do anything the game just stays as it is. When you touch the screen and pull back the
catapult the game is responding to your input and changing the game state
accordingly i.e. the position of the catapult. When you let go the game keeps going
and calculates what will happen. The bird collides with the structure and the wood
responds realistically. When everything has stopped moving the score is calculated
and the game is over.
28
4.1.2 Game Engine
A game engine is framework which facilitates the kinds of tasks which need to
be done when writing a game. We would probably want to display images on the
screen (in game terminology, an image which is displayed on the screen is called a
sprite). We may need to draw menus or text on the screen. We might want to organize
our sprites so that some are behind others. Often games use realistic physic so objects
collide or fall with gravity. A game engine will help us do these things and many
more.
29
Scene View : The Scene View is your interactive view into the world
you are creating. You will use the Scene View to select and position
scenery, characters, cameras, lights, and all other types of Game
Object. Being able to Select, manipulate and modify objects in the
Scene View are some of the first skills you must learn to begin
working in Unity.
Game View : The Game View is rendered from the Camera(s) in your
game. It is representative of your final, published game. You will need
to use one or more Cameras to control what the player actually sees
when they are playing your game.
Project : Project window is one kind of file explorer that load the files
needed on a project.
Inspector : The Inspector is used to view and edit the properties and
settings of Game Objects, Assets, and other preferences and settings in
the Editor. When you select a GameObject in the Hierarchy or Scene
View, the Inspector will show the Properties of applying specifically
how all Components and Materials on that object and allow you to
edit them. The image above shows the inspector with the default 3D
camera GameObject selected. In addition to the objects position,
rotation and scale values, all the properties of the camera are available
to edit.
30
debugging, you can also show your own messages in the Console using
the Debug.Log, Debug.LogWarning and Debug.LogError functions.
Sprite : If your project mode is set to 2D, the image you import
is automatically set as a Sprite. However, if your project mode is set to
31
3D, your image is set as a Texture, so you need to change the asset's
Texture Type: Click on the asset to see its Import Inspector. Set the
32
MonoDevelop (also known as Xamarin Studio) is an open source integrated
development environment for Linux, macOS, and Windows. Its primary focus is
development of projects that use Mono and .NET frameworks. ... It supports
Boo, C, C++, C#, CIL, D, F#, Java, Oxygene, Vala, and Visual Basic.NET and
JavaScript.
Tiled map is an amazing tool to make. It allows tilesets to use for tile
mapping.. We downloaded minimum 40 different RPG tileset to make the graphical
design for our game. This tool map uses tiled to unity converter to convert map int
unity system. It allows layer based design. Further more, it can put collision layer the
is useable which make this editor one of the best choice of tiled map editing. .
33
The game will be displayed on a visual display and will be 550px x 400px in
size.
The game will feature music and sound effects; however these will not be
crucial for gameplay. Speakers or headphones are an optional user
requirement.
The completed game file must be capable of being embedded in a web page.
The game must have a title screen with buttons that allow navigation to the
game screen, instructions screen and credits screen.
The game must have an instructions screen. The user can navigate from the
instructions screen back to the title screen.
The game must have a credits screen. The user can navigate from the credits
screen back to the title screen.
The game will feature next level screens that appear between the levels of
the game. These screens show the current score. A button allows navigation to
the next level.
The player character can move up, down, left and right, using the arrow keys.
The game will have more than one level. Each level must be completed
within a time limit or the game will end. Each level has a time limit of 60
seconds. The player character must pick up the dungeon key and reach the
trapdoor within the time limit to proceed to the next level.
The player can pick up keys and treasure coin. There will be a limited view
of the dungeon maze around the character, simulating the environment.
Frames rate
The minimum frame rate must be twenty frames per second. The average frame rame
must be greater than 30. Frame rate can be monitor directly from the graphic engine.
Usability
34
The maximum number of clicks for any function in the system should not
exceed five clicks. This can be achieved by usability testing with random users.
Response time
The average response time between click and reaction must be less than 0.5
seconds. The maximum response time between click and reaction must be two
seconds. Adding some simple classes and methods that will compute and display the
time needed to process any operation can test this requirements.
Required resources
The game must be able to run with minimum of 1024 MB of RAM. The game
must use less than one gig of hard disk space. Checking the total size of the folder in
which the game was installed, for the hard disk space can test this requirement. For
the RAM used, when playing the game, we can check the physical memory in the
Windows Task Manager performance tab.
Platform
The game must run in any Windows OS. Installing the game in a Windows
environment and run simple tests to verify if the game properly works can test this
requirement. Later we will try to build our games for android platform.
Maintainability
The code written for the game must be maintainable. This can be achieved by
collecting metrics, such as DIT (depth in inheritance tree), MPC (message-passing
coupling), WMC (weighted method complexity) and DAC (data abstraction
coupling). Also adding documentation will improve the maintainability scale of the
system.
On a design perspective, we will use managed C# code in non-performance critical
component. This code will be easier to maintain then the one in native C#, since it is
already garbage collect by the compiler.
35
4.3.1 User Friendly
Refers to anything that makes it easier for novices to use a computer. Menu-
driven programs, for example, are considered more user-friendly than command-
driven systems. Graphical user interfaces (GUIs) are also considered user-friendly.
Online help systems are another feature of user-friendly programs.
4.3.2 Interactivity
In computers, interactivity is the dialog that occurs between a human being (or
possibly another live creature) and a computer program. (Programs that run without
immediate user involvement are not interactive; they're usually called batch or
background programs.) Games are usually thought of as fostering a great amount of
interactivity. However, order entry applications and many other business applications
are also interactive, but in a more constrained way (offering fewer options for user
interaction).
Letting players make their own path, and they will do things they like while
having fun. Too much rope lets them hang themselves, and leads to something that
is a sandbox, not really a game. As our first initial games was try to make a
sandbox games using our University Campus are but later we decided to add some
fun and put a replica of Pacman into our games. With all the dialog option it may
be get interesting we are afraid that a very small portion of our user will able to
understand.
We need to plan things out for them to a limited extent, and give players the
tools they need. If you do this, and allow them to use those tools gracefully, players
will like your game. Balance things wrong, and a new career in something other
than game development.
36
4.3.4 Stability
4.3.5 Portability
37
CHAPTER 5
SYSTEM DESIGN
38
5.1 Introduction
In this section we are going to go over a nearly-complete Game Design for our
RPG game. We are going to take a look at how the game world is going to be
structured, how the player is going to operate, what kind of enemies we are going to
have, a deeper look into the skill tree and much more.
Components
Game environment
Game environment is the area of our games where it took place. We use our
campus design as the environment design.
Actions
What a player can do in our games are the actions of our game. The player can
move up down left right. It can run in a certain speed. Can enter new area.
39
And last but not least our player can start conversation with NPC by pressing
E button going near them and different collectables like coin, health etc.
Mechanics
Game Mechanics are the backbone of games that handles all the
functionalities. It includes game system, algorithms or rules and the core of
game. In Short mechanics defines how game behave.
Goals
Goals defines the purpose that keep our player motivated to play our games. In
our games gamers main goal is unlock section of the map by completing submissions.
And another core purpose of playing hides behind exploring and knowing our City
campus virtually collecting all the points in submission is needed to win the game.
Victory conditions are collecting and competing the story mode to have an amazing
experience conditions for loosing game is when player failed to complete the
submission and get caught by the guard.
It is the different level of our games. There several phases like collect the ID
card. Beat guards in submission are the few examples of our game state. From the
start to finish there are several phases where player have to take decision to proceed.
A good video game menu is like a good roadie: It stays out of the way. But
still, far too many menus waste far too much of our time. People want to play games,
not mess around in menus . We follow the simple and clean visualization for our
menu scene.
40
This is the main menu of our Games. We learn how to use Unity's UI system
to create a basic menu for your game including buttons, sub-pages for help and audio
settings and scripts to control menu functionality. To remove dull and boringness we
also added an animation that four guard chasing our player into the main menu scene.
By clicking on the play button in the menu user interface page player will be
direct to a new scene which is the level of our main game. Here the loaded level
represents the sandbox environment of our University. Here player will able to
explore the university campus. By going to interact able object player can accrue
information.
41
This whole main section has two main parts. Those are the inside of a building
and the other part is the outside of the building. In building there are also three parts
for three floors as our main University building.
This sandbox simulation includes outside campus design along with the inside
building maps. The inside map is divided for three parts for each floor each. As a
programmer our basic goal was to build all the perfect mechanism but we also put a
lot of effort on game 2D graphics as well.
This level is the mini game inside our main sandbox area. It will be loaded as
an obstacle before player. Player must have to finish this mini game to advance
further. User can also access this level by selecting the Play Submission button in
the menu.
This Guard Chase game is a rip off from the Classic game Pac-Man where the
guards are like the ghost that chase our player. In order to survive our player must
have to collect all the Dots until it finishes. As our player dont have any ID card at
the beginning of the game and the guards are sworn to protect our university from any
unauthorized person this small chase scene took place. if player can beat the 1st level
then will not appear in that place anymore.
42
2nd level with a slightly increase guard movement level will be appeared when player
try to unlock new places in the game. Player has three lives before game over. Life
will be decreased if player get caught by the guard.
5.3.4 Help
This help scene provides the information about keyboard control and the basic
goal for player. Small header animation of guard chase makes it a bit dynamic
although it is not well polished due to the lack of time.
This flowcharts is meant to be a design aid to better help us keep track of the
system, so we are not bothered if they're a little hard to follow as a player for now. We
thought some other folks here would like to see a visual method of game design. I
43
kind of like seeing a whole game's organs and guts splayed out across a single page.
As like as finger attached to a hand and hand attached to the whole body, in
unity game components are attached to a game object and a game object is a part of a
scene and the final game is a combination of different scene. The hierarchy below
shows a partial of our game E-R model
44
Figure 5.2 : E-R Diagram
5.6 Conclusion
Game design is the art of applying design and aesthetics to create a game to
facilitate interaction between players for entertainment or for educational, exercise, or
experimental purposes. Game design can be applied both to games and, increasingly,
to other interactions, particularly virtual ones.
Game design creates goals, rules, and challenges to define a sport, tabletop
game, casino game, video game, role-playing game, or simulation that produces
desirable interactions among its participants and, possibly, spectators.
45
CHAPTER 6
SYSTEM IMPLEMENTATION
&
DEVELOPMENT
46
6.1 Introduction
Unity Game Engine is a well compact and optimized game dev platform.
However as it combines a lot of functionalities there is some hardware limitations to
use this editor in different platforms. Those limitations and hardware specifications of
Unity has given below.
Windows XP & Vista are not supported; Because Unity dropped support for those OS
after v5.30.
GPU : Any Graphics processing unit that supports DirectX 9.0 or OpenGL 3.0
or higher.
47
Additional platform development requirements :
iOS: Mac computer running minimum OS X 10.9.4 version and Xcode 7.0 or higher.
Android: Android SDK and Java Development Kit (JDK).
Windows Store: Windows 8.1 (64-bit) and corresponding Visual Studio and platform
SDK:
Windows 8.1/Windows Phone 8.1: Visual Studio 2013 or later and Windows 8.1
SDK;
6.4 Coding
Codes are the life of the games. We use C# as programming language and
Microsoft visual studios editor to edit, compile and run our code. We used object
oriented programming technique that allows us to break our code into small pieces
instead of a big giant code. It also increases the reusability of our code.
PacdotSpawners.cs
using UnityEngine;
using System.Collections;
48
void Start ()
{
startTime = Time.time + startOffset;
}
startTime = Time.time;
}
}
}
Move.cs
using UnityEngine;
using System.Collections;
MenuNavigation.cs
using UnityEngine;
using System.Collections;
public class MenuNavigation : MonoBehaviour {
49
public void Quit()
{ // quite application
Application.Quit();
}
}
public void SubMission(){
// load the Sub game scene
Application.LoadLevel("game");
}
ScoreManager.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
50
public Score(string n, int s)
{
name = n;
score = s;
}
MusicManager.cs
using UnityEngine;
using System.Collections;
//-------------------------------------------------------------------
// single tone implementation
void Awake()
{
if (_instance == null)
{
_instance = this;
DontDestroyOnLoad(this); // keep music on the background
}
else
51
{
if (this != _instance)
Destroy(gameObject);
}
}
}
GameManager.cs
using System.Collections.Generic;
using UnityEngine;
// Game variables
// singleton implementation
private static GameManager _instance;
return _instance;
}
}
// function definitions
void Awake()
{
if (_instance == null)
52
{
_instance = this;
DontDestroyOnLoad(this);
}
else
{
if(this != _instance)
Destroy(this.gameObject);
}
AssignGhosts();
}
void Start ()
{
gameState = GameState.Init;
}
void OnLevelWasLoaded()
{
if (Level == 0) lives = 3;
void Update ()
{
if(scared && _timeToCalm <= Time.time)
CalmGhosts();
53
pacman.GetComponent<PlayerController>().ResetDestination();
blinky.GetComponent<GhostMove>().InitializeGhost();
pinky.GetComponent<GhostMove>().InitializeGhost();
inky.GetComponent<GhostMove>().InitializeGhost();
clyde.GetComponent<GhostMove>().InitializeGhost();
gameState = GameState.Init;
gui.H_ShowReadyScreen();
Debug.Log("Ghosts Scared");
}
score = 0;
Level = 0;
lives = 3;
Destroy(GameObject.Find("Game Manager"));
}
}
Point.cs
using UnityEngine;
using System.Collections;
54
void Start ()
{
Destroy(gameObject, 1.5f);
}
Wrap
using UnityEngine;
using System.Collections;
ScreenFadersf=GameObject.FindGameObjectWithTag
("Fader").GetComponent<ScreenFader> ();
yield return StartCoroutine (sf.FadeToBlack());
other.gameObject.transform.position = wrapTarget.position;
Camera.main.transform.position= wrapTarget.position;
Screen Fadder.cs
using UnityEngine;
using System.Collections;
// Fade in and out mechanism
public class ScreenFader : MonoBehaviour {
Animator anim;
bool isFading= false;// veriables for animator
void Start () {
anim = GetComponent<Animator> ();
}
public IEnumerator FadeToClear(){
55
isFading = true;
anim.SetTrigger ("FadeIn");
while (isFading)
yield return null; // time to perform fade in
}
public IEnumerator FadeToBlack(){
isFading = true;
anim.SetTrigger ("FadeOut");
while (isFading) {
yield return null; // wait for the given time
}
}
void AnimationComplete(){
isFading = false;
}
}
NPCmovement.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
void FixedUpdate () {
// waypoint not reached yet ? then move closer
//Animation
MoveAnimation.cs
56
public class MoveAnimation : MonoBehaviour {
// componet
Rigidbody2D rbody;
Animator anim;
// variables to manupulate
public float speed;
public bool controls;
string touching;
// UI componet and Dialog manager
public InputField name;
public RPGTalk rpgTalk;
public GameObject askwho;
public RPGTalk rpgTalkToFollow;
void Start () {
// initailization of componet attached to the game
object
rbody = GetComponent<Rigidbody2D> ();
anim = GetComponent<Animator> ();
Debug.Log (touching);
Debug.Log (GameManager.Level);
//skip the Talk to the end
if(Input.GetKeyDown(KeyCode.Return)){
rpgTalk.EndTalk ();
}
if (controls)
// Movement controller and animation trigger.
} else {
anim.SetBool ("iswalking", false);
}
57
if (Input.GetKey (KeyCode.LeftShift)) {
// For Run
speed = 2;
anim.speed = 2;
} else {
speed = 1;
anim.speed = 1;
}
rbody.MovePosition (rbody.position + movement_vector * speed *
Time.deltaTime);
}
} else {
anim.speed = 0;
}
rpgTalk.callbackFunction = "GiveBackControls";
rpgTalk.NewTalk ();
58
}
public void ByeWall(){
wall.SetActive (false);
particle.SetActive (true);
Invoke ("FunnyGuyEnd", 2f);
}
void FunnyGuyEnd(){
rpgTalk.lineToStart = 26;
rpgTalk.lineToBreak = 29;
rpgTalk.callbackFunction = "GiveBackControls";
rpgTalk.NewTalk ();
}
void OnTriggerEnter2D(Collider2D col){ // collider trigger active
touching = col.name;
if(touching == "semantha"){
rpgTalkToFollow.NewTalk ();
}
if (touching == "PGameLevel1" && GameManager.Level==0) {
Application.LoadLevel("game");
}
}
}
void EndTalk(){
rpgTalkToFollow.EndTalk ();
Coin.cs
using UnityEngine; // This handles coin destroy, sounds and add points in
score
using System.Collections;
void Start () {
gameManager = GameObject.Find
("GameManager").GetComponent<GameManagerScript> ();
audioSource = gameObject.GetComponent<AudioSource> ();
}
// On trigger functionalities with Player collision
59
gameManager.GmAddScore();
audioSource.Play ();
Invoke("Destroy",.5f);
}
}
void Destroy(){
Destroy(gameObject);
}
}
All the codes of our projects are uploaded in a bit bucket which we use as our
version control system for our games.
6.5 Conclusion
System development and implementation is one of the most important and
complex phase of our project. We design something new and also reduce some older
ideas to meet the expectation. Implementation phase taught us how to think outside
the box to solve problem. In Game development weird and unconventional design
idea can be generated but the process to implementing those ideas in real games
requires a hard dedication towards problem solving. We hope we will be able to use
this experience of thinking unconventional methods to solve problems in our future
career.
60
CHAPTER 7
TESTING
61
7.1 Introduction
This article is about a topic that is one of the pillars of writing good code:
Error reporting. It is what a programmer does when he or she thinks that theres
something wrong which should not go wrong. And because professional programmers
want to know when something goes wrong, its incredible important to do error
reporting right. If you are working with another library for instance, then you need to
know how errors are being reported at some point.
int main() {
divide( 10, 0 );
}
The call will (hopefully) lead to a division by zero error, which is clearly a
programming error. The programmer should know that a division by zero is not
62
possible, it is not defined mathematically. So, by definition, when you do that, you
provoke an error that could have been avoided by just using the function correctly use
its documentation or other information to learn how to use functions; if theres no
documentation, that means no one is using that code anymore.
Exceptions (the programming term) have been invented for providing a way to
report and handle errors directly as a language feature, which makes the language and
programmer more responsible. They are usually implemented in a way that allows the
programmer to catch thrown exceptions in a try/catch block. And if he doesnt, the
exception is delegated until someone catches it at last the language itself, which
usually will crash the program.
The big advantage is that the programmer does not explicitly has to check for errors,
they will be thrown anyway and cant be ignored. The delegation of exceptions is
another big plus: The programmer does not need to handle the exception when calling
the function that throws it. Instead it can be caught from a higher step of the call
stack. Example code:
void load_images() {
load_file( "a.png" );
load_file( "b.png" );
}
void load_sounds() {
load_file( "a.ogg" );
load_file( "b.ogg" );
}
void load_resources() {
63
try {
load_images();
load_sounds();
}
catch( FileNotFoundException ) {
// ...Catch Exception
}
}
n the example the function load_file() is the one that throws an exception when
something goes wrong. Both load_images() and load_sounds() use the function,
but do not catch possible exceptions. Instead load_resources() takes care of that,
which is a more centralized place.
And as a final bonus, functions (or scopes in general) are left in a defined way (this
especially counts for C#). If you create objects in a function, for example, and that
function is left due to an exception, all your objects will be cleaned up properly (the
destructors get called). This is not limited to the function that throws the exception,
but all callers in the call stack until the exception is caught!
Not to mention that exceptions can be objects, i.e. they can carry error messages or
other useful things.
Software testing is an engineering discipline. This is also true for game testing.
Yes, you can play games and find bugs without structure or expert knowledge just as
you can test that a mobile phone works, but if you want to exceed you need to become
a professional tester.
Being a professional game tester means that we must understand both testing
in general, but also the unique discipline of game testing. This is no small feat, as
software testing is very complex and multifaceted, and game testing requires very
specific skills.
64
Before we can explore the differences we need to agree on the similarities between
software testing and game testing. Basically everything that Cem Kaner has written in
his course Black Box Software Testing, is in my opinion applicable to both fields.
Almost everything Alan Page has written about test automation can also be applied to
game testing. Most of what is included in the ISTQB testing certifications should also
be valid. Game testing basically inherits almost every aspect of software testing in
general. Even the mindset of James Bach and his rapid software testing can basically
be tailor made for game testing. How Google and Microsoft works with software
testing can teach game testers a lot about how to structure and organize testing in a
good way.
Game testing is every bit as complex as any other testing, and should be
treated in just the same way. It is not something that can be left to untrained laymen.
There is a place for live user test, or alpha and beta test, but those are just a few pieces
in a much larger puzzle. To reduce game testing to something as simple as just
playing the game to see if you find any problems, is to seriously undermine the
quality of your game.
So how is game testing unique? What aspects make game testing different from
normal software testing? I tried to compile a list of types of testing that makes game
testing especially troublesome.
Usability or user experience is something that is tested for all software, but
Fun Factor Testing is something unique to games, since they are an entertainment
product. Games are not only supposed to work intuitively and provide a good user
65
experience they also have to be fun to play. How do you assess if something is fun
or not? How do you know if a certain experience is something that will entice the
proposed target group? This requires a unique insight into game design, and vast
experience and data about the user group and what that group enjoys.
Creating balance between different options, as well balance of difficulty for
different levels, monsters or events, is also something unique to games. Balance
Testing can only be done in a good way with a vast knowledge of game design and
how the target audience responds to different difficulty levels. It also requires many
hours of actual gameplay of the game under test.
One of the most complex aspects of game testing can be the testing of the
actual world or level, especially if it is a vast, sprawling, 3D world, such as for
modern MMOs. Some parts of this can be automated in interesting ways that are also
quite unique to game testing, such as having bots move randomly through the game
world to see if they get stuck or find other problems with the world. As the
complexity of the task grows, it becomes more and more important to find ways to
reduce the complexity with the help of tools. For puzzle games it is important to make
sure that all the graphics for every level looks good, but also that each level is
passable, and that game mechanics that have previously been tested in isolation,
actual work in different level implementations.
Testing that computer-controlled opponents are working correctly, that the artificial
intelligence is behaving according to design, can also become very difficult as the
complexity of the behavior increases. Chess is a good basic example, and enemies in a
first person shooter is a more modern one. This type of testing requires the tester to
understand what triggers different types of behavior, and how these triggers can be
confused by different parameters. Understanding of AI and game design is critical to
succeed in this field.
Multiplayer testing is a whole other beast in itself. Many players simultaneously
interacting with the game world, with computer-controlled opponents, with game
servers, with each other. So many things that can go wrong. And it often requires a
whole team of testers. Many difficult risk-based decisions to make if you dont want
to spend unlimited amounts of time testing different scenarios. Understanding of
multiplayer game design, and how to test efficiently as a team is required knowledge
for this type of testing.
66
Audio testing is common in all software that creates some kind of sound or plays
media. However, games have a unique aspect that other software does not have to
care about to the same extent. Game music has to involve the user in the game and
enhance the game play. Not only should the audio play without stuttering or missing
elements, it should also add to the gameplay. This requires extensive audio skills and
specific understanding of game audio. Very specific expert domain knowledge.
Many modern 3D games have physics engines. Modern shooters such as
Battlefield or Crisis and RPGs such as Skyrim, have destructible environment and
possibilities to throw objects. Testing if the physics engine works requires an
understanding of physics as well as how to implement that in a good way into a game.
The complexity of the testing grows with the complexity of the engine.
Especially in simulators or racing games it is very relevant that the game feels
real, but many other games also incorporate elements that need to feel real. Testing
for realism requires specific domain knowledge needed for the game or game
element. An airplane simulator requires an understanding of airplanes. Cars, weapons,
human movement, animals. Each poses their own problems.
A lot of software has open API that can be used by third parties. But there are
few other instances where the players will try to exploit these open API to gain unfair
gameplay advantages. This requires outside-the-box thinking. How will the modders
use the API, and how will they be able to alter the gameplay in significant ways?
Being one step ahead of the entire community of modders is a daunting task indeed.
In addition to these different types of testing, categorizing users can most likely also
be done in a unique way for games, to help prioritize and select what tests and use
cases are most relevant to run. How to do this categorization is another article in
itself, but I leave you with an example of how you could think about categorizing
different types of gamers.
Unless it is a (totally) web-based game, there would be some software that the
player needs to install on their computer first. The installation process has a series of
steps that should be tested on the common computer configurations (each
configuration specifies data like the Processor, RAM, Hard Disk, Display, Display
67
RAM, operating system etc. used by players. You should design test cases for the
installation steps and then execute these test cases on each of the common
configurations. You should also check the completeness and accuracy of the content
in the installation guide. This may be done just once (on the most common computer
configuration).
This is the most important type of game testing. Typically, the game would
have a number of features. You should aim to cover the game's features as
exhaustively as feasible. An efficient way to accomplish this is to design test cases in
a number of ways, such as:
a. Detailed test cases - These test cases are suitable to cover obvious features e.g.
game options, progression from one level to the next, correct working of the controls,
start/ suspend/ resume/ stop game etc.
b. Task based test cases - These test cases are at a higher level of detail. They take
into account the objectives a player could have e.g. go through each level and win the
game, choose and old saved game and continue it etc.
c. Test matrices - These test cases are useful when there are different features for
different player statuses e.g. a particular weapon is available to the player only after
clearing a particular level, the player can go through an obstacle only when they have
collected a particular item before. A test matrix is drawn in the form of a table. The
rows could then represent the features and the columns the player statuses (e.g.
current level).
Executing the different types of test cases may still not be sufficient to discover a
majority of the defects. You should perform exploratory testing. In simple words, this
would mean play the game and perform interesting tasks that you think would reveal
defects.
68
7.3.3 UI testing
Since games are typically based on user interfaces, this is also an important
type of game testing. UI testing includes testing of the graphic elements (e.g.
characters in the plot, backgrounds, objects in the foreground) as well as the content
(both viewable and audible). An efficient way to test the UI is to first list the checks
desired for every graphical element and content type. Then check each item in your
list in every logical division of the game (e.g. each screen and each level).
There is an important thing that you should keep in mind regarding UI testing.
It is possible that your game is released in multiple languages and cultures. If so, you
should create a matrix (a table) listing all the supported languages. Then you should
take the help of a speaker of a given supported language to check the content. You
should get the content checked in each supported language at least once.
A novel story line, incredible graphics and sounds and numerous well-
integrated features of a game may still fail to satisfy the player if the game becomes
too slow or freezes up. You can check the speeds of operation of the game on
common computer configurations. A good way to do this is to identify the common
tasks a player is likely to perform. Then you should determine the acceptable
times for these tasks. These times are the goals. You should then perform each task in
the game and note the time it actually takes to do so. Since there are a large number of
tasks to be timed, you should automate the performance tests.
Another flavor of performance testing comprises testing your game at extremes. For
example, run a complete game without any pauses at all or run a game continuously
for 24 hours or keep on increasing the number of players if your game is multi-player.
Running such tests would give you data on how the performance of your game
degrades on high loads. If the game shows performance problems at a realistic load, it
means that you have discovered a problem that should be fixed. You now know about
69
the main types of tests that you can run on a game. Remember that feature tests and
UI tests are especially important.
7.4 Conclusion
This article explained how to raise errors and showed some strategies together
with their advantages and disadvantages. Good code chooses one strategy and follows
it consistently. Programming errors are raised differently than exceptions, and the
wording of function names should give an idea of how the return value is to be
interpreted.
70
CHAPTER 8
DISCUSSION
71
8.1 Introduction
Making a games is not possible without love and passion toward the gaming
medium. "The challenge of making a game is sometimes like trying to build a house
blindfolded," said Ryan Benno, environment artist at Insomniac Games-whose
artwork you've also seen in Telltale's Walking Dead and Wolf Among Us series, as
well as Call of Duty: Infinite Warfare. "You can plan out where the walls will be,
what the rooms will be like, how to make it stable and functional, but until you are
actually in the space you don't actually know."
We intend to build a sandbox that inherits ideas form RPG games. Nothing in
games works without any effort. Every particle every change in games is determine
by coding and design by the developers. There is a saying in game development
Every developer first ten games are worst games. However, we tried our best to
make a decent one but we are hopeful that will be able to add a lot of good features in
future.
Our goal was to make a replica model of our university where anyone can
explore as a virtual player. To Make the environment more alive and dynamic we add
more animation and full functional interact-able moving NPC along with Pop up UI
dialog boxes are used to show information that we store to different places in the
maps . For example, the bathroom location in our game world represents the same
location where the bathroom situated in real world. The complete project goal is make
the whole design as perfect as possible. On top of all those design to make our game
more fun and interesting we implement some mini games like pacman where ghosts
replaced with guards and pacman sprites replaced with our player sprites. We design a
whole RPG Talk system using which we can make a narrative style games which was
primarily our main goal. We have to narrow down our scope because a good story is
not easy to create in a short period of time.
72
8.3 System Strength
Limiting ideas may seems bad for innovation but later we understand it is
helpful to keep ourselves focused on the core functionalities of our project. As we
dont have unlimited time and resource we have to sacrifice ideas like Online
multiplayer system, 30 days Good boy or Bad boy simulations and ideas like telling a
great story through our game. As we are supposed to play mainly the role of
73
programmer in this project, limiting ideas helped us a lot to reach our goals. However,
we hope in future version of our project we will be able to bring those ideas to life.
8.8 Conclusion
74
75
References:
[1] Brathwaite & Schreiber, 2008, Challenges for game designers. Charles River
Media, chapters 1-2
[2] Jrvinen, 2008, Games without frontiers, Tampere University Press, chapter 4.
[3] S. M. Dorman, Video and computer games: effect on children and implications
for health education, Journal of School Health, vol. 67, no. 4, pp. 133138,
1997.
[6] J. Blow, Game development: harder than you think, Queue, vol. 1, no. 10, pp.
2837, 2004.
[7] J. Kirriemuir and A. McFarlane, Literature review in games and learning, Tech.
Rep. 8, 2004.
[8] E. Ferguson, B. Rockhold, and B. Heck, Video game development using XNA
game studio and C#.Net, Journal of Computing Sciences in Colleges, vol. 23,
no. 4, pp. 186188, 2008.
76