Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

A

PROJECT REPORT
ON
“3D Third Person Shooting (TPS) Game”

SUBMITTED TO

MAHARISHI DAYANAND UNIVERISTY, ROHTAK


IN THE PARTIAL FULFILLMENT OF THE REQUIREMENT FOR THE AWARD OF THE DEGREE OF

BACHELOR OF TECHNOLOGY
IN

Computer Science and Engineering

Submitted To: Submitted By:

Ms. Sakshi Kumar Nirmal Kumar (Roll no:16CSE44)


Asst. Professor , CSE Prashant Singh (Roll no:16CSE47)
Pankaj Dhiman (Roll no:16CSE45)
Ravinder Kumar (Roll no:16CSE55)

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT,

FARIDABAD – 121002

(DECEMBER, 2018)

1|Page
CERTIFICATE

Certified that this project report “3D Third Person Shooter Game” is the bonafide work
of “Pankaj Kumar Dhiman, Ravinder Kumar, Nirmal Kumar Rout and Prashant Singh” who
carried out the project work under my supervision.

SIGNATURE SIGNATURE

Mr. Sanjay Singh Ms. Sakshi Kumar

HEAD OF THE DEPARTMENT Asst. Professor, CSE

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT

FARIDABAD – 121002

DECEMBER-2018

2|Page
ACKNOWLEDGEMENT

This project would not have taken shape, without the guidance provided by Ms. Sakshi kumar
,our Trainer who helped in the modules of our project and resolved all the technical as well as
other problems related to the project and, for always providing us with a helping hand
whenever we faced any bottlenecks, inspite of being quite busy with their hectic schedules.

We would also like to thank our project supervisor Mr. Ashok Madan who gave us the
opportunity and provided us all the academic and conceptual support for our project.

Above all we wish to express our heartfelt gratitude to Mr. Sanjay Singh H.O.D, CSE
DEPARTMENT whose support has greatly boosted our self-confidence and will go a long
way on helping us to reach further milestones and greater heights.

3|Page
ABSTRACT

This bachelor thesis describes a case study where we are focusing on developing a Third
Person Shooting Game using Unity Engine Software, C# language, photoshop and
Visual studio for coding C#.

This thesis will cover the implementation of real-time graphics, Physics Engine as well
as Sound effect and background music.

In the end, our case study will show that this development process was an appropriate
choice for the development of our game development project.

4|Page
Table of Contents
1. INTRODUCTION
1.1 Problem statement
1.2 Objective of proposed system
1.3 Proposed system architecture
1.4 Scope of proposed system

2. SYSTEM ANALYSIS
2.1 User Interface
2.2 Hardware Requirement
2.3 Software Requirement
2.4 Introduction of Tools
2.4.1 Unity 3D Engine
2.4.2 Photoshop
2.4.3 C# language
2.4.4 Visual Studio 2017
2.5 Software Requirement Specification

3. SYSTEM DESIGN
3.1 System Functionality
3.2 System Modules
3.2.1 Player-Controlled Module
3.2.2 Game-Controlled Module
3.2.3 Environment Module
3.2.4 Audio Module
3.3 User interface design, Output
3.3.1 Splash Screen
3.3.2 Main Menu
3.3.3 Player
3.3.4 Game Scene
3.3.5 Enemy
3.3.6 Credit Scene

5|Page
4. SYSTEM IMPLEMENTATION
4.1 SYSTEM CODING
4.1.1 AI control Script
4.1.2 Player control Script
4.1.3 Camera Controller Script
4.1.4 Menu Manager Script
4.1.5 Gun Script
4.1.6 Health Script
4.1.7 Enemy Script
4.1.8 SplashtoMenu Script

5. SUMMARY AND CONCLUSION


5.1. SUMMARY
5.2. LIMITATIONS OF SYSTEM
5.3. IMPROVEMENTS
5.4. CONCLUSIONS
5.5. FUTURE SCOPE

6. REFERENCES

6|Page
CHAPTER 1

INTRODUCTION TO 3D THIRD PERSON SHOOTING GAME

1.1 PROBLEM STATEMENT


In Today’s World there are a lot of games available in the gaming market each with their
different specifications and features. 3D Shooter game player require a skill level to play that game but the
game that we have made is easy to play and easy to understand for the players playing the game. The 3D
Third person Shooter game has simple options to play game with good graphics ,Environment and sound.

1.2 OBJECTIVE OF PROPOSED SYSTEM

The artificial intelligence (AI) community has witnessed a transition from the “classical AI games” such as
Samuel’s Checker Player and Waterman’s Poker Player to the contemporary AI techniques adopted in
electronic games. The objective of the game is no longer a quantifiable outcome of beating the opponent in a
checker or poker game. Instead, a contemporary game contains changing environments, multiple objectives,
and dynamic aspects of the game that are revealed to the game player as the game unfolds. The objective is to
offer to the human player an enjoyable experience through his or her interaction with the game, and this does
not involve any specific quantifiable outcome.
The 3D Shooting game is a contemporary video game, and its objective is to offer the player a challenging
and enjoyable experience. Although the player’s goal within the game is to search the enemies on the terrain
and Kill the enemies.The four Kinds of AI(Artificial intelligence) possessed by the Enemies. The enemies
would discover the player if the player entered into the range of patrol or shot them, and the enemies made
long-range damage to the player. The player had to slay all enemies to win the game. If the player was slain,
then the game was over. The Health Points (HPs) were used to judge whether the player or enemies died.
The player could restore HPs according to touching the Heal Box or finishing a mission.

The game contains two main game scenes, one is the Graphic User Interfaces (GUI) scene and another one is
the game scene. The player could play on or off the Background Music, view the information of the
controller and the author and start or end this game on the GUI scene. The Skybox, Rigid body and Terrain
were applied into the game. Also an interesting way of damage calculating was used in the game.

7|Page
1.3 PROPOSED SYSTEM ARCHITECTURE

SYSTEM ARCHITECTURE

This is the basic architecture of 3D Third person Shooter Game .It is running on the unity Engine
with operating system PC and Mac OS. The user gives input from the interface to the game.
After user input it goes to game logic. Game environment according to the input given, gives us the
response like player Movement, Enemy Killing.
The game is running on PC and mac OS.

8|Page
 Flow Diagram

1.4 SCOPE OF PROPOSED SYSTEM

The scope is everything that needs to be accomplished in order for me to have a successful project. There is
a lot to do when creating a game; there are many algorithms and theories and there are different approaches
to each one and choosing the right one is vital.

This is discussed in more detail in the design section, with justification of each decision.

9|Page
CHAPTER 2

SYSTEM ANALYSIS

2.1 USER INTERFACE


The Game software starts with the main menu screen. The main menu will have Four buttons: Play Game;
Resume game; and, Quit Game,Credit Button. All buttons in the preceding and subsequent menus will have
a similar style: energetic, entertaining, but also easy to understand and use. The buttons will provide the
following functionality:

• The function of any Quit Game button will be the closing of the game.

• The Resume button will load the user to the position in the game they were before their last sign off.

• The New Game button will open the new game menu, From where the user will move to the Game
Environment. On this screen, You will Play the Game Using the keyboard and the mouse for changing the
angle of the player.

2.2 HARDWARE REQUIREMENT

 1.4 GHz Processor


 500 MB RAM
 Intel Motherboard
 1 GB HDD
 104 Key Standard Key Board

2.3 SOFTWARE REQUIREMENT

 Unity Engine 2017


 C# Language
 Photoshop
 Visual Studio 2017

10 | P a g e
2.4 INTRODUCTION OF TOOLS

2.4.1 Unity 3D Engine

History of Unity Engine


Unity Technologies was founded on 2 August 2004 by David Helgason (CEO), Nicholas Francis (CCO), and
Joachim Ante (CTO) in Copenhagen, Denmark after their first game, GooBall, failed to gain success. The
three recognized the value in engine and tools development and set out to create an engine developed in-
house that any and all could use for an affordable price. Unity Technologies has received funding from the
likes of Sequoia Capital, WestSummit Capital, and iGlobe Partners.
The company's focus is to "democratize game development" and make development of 2D and 3D
interactive content as accessible as possible to as many people around the world as possible.In 2008, with the
rise of the iPhone, Unity was one of the first engine developers to begin supporting the platform in full.
Unity now supports 24 platforms, including Oculus Rift, PlayStation 4 and Linux.
In 2010 IBM started exploring Unity 3D based browser plug-ins, as a way to access 3D virtual worlds from
within a Web browser.
In April 2012, Unity reportedly had 1 million registered developers, 300,000 of which used Unity on a
regular monthly basis. In April 2015, the number of reported registered developers reached 4.5 million, with
1 million monthly active users.47% of all mobile game developers use Unity.
On 10 November 2010, the Unity Asset Store launched as an online marketplace for Unity users to sell
project assets (artwork, code systems, audio, etc.) to each other.By April 2014, it had 600,000 registered
users who downloaded about 500,000 assets per month. According to some estimates, this has saved game
developers about $1 billion in the previous year.
Unity acquired SilkCloud, a Shanghai-based ecommerce developer, in August 2015. SilkCloud is working
on infrastructure for Unity's web based services.
At GDC 16, Unity announced two new product lines: Unity Certification to facilitate developers in
demonstrating their skill and knowledge within Unity; and Unity Collaborate which allows multiple people
to access the same Unity project remotely.[18]

Overview of Unity Engine


Unity is a multipurpose game engine that supports 2D and 3D graphics, drag-and-drop functionality and
scripting using C#. Two other programming languages were supported: Boo, which was deprecated with the
release of Unity 5 and JavaScript which started its deprecation process in August 2017 after the release of
Unity 2017.
The engine targets the following graphics APIs: Direct3D on Windows and Xbox One; OpenGL on Linux,
macOS, and Windows; OpenGL ES on Android and iOS; WebGL on the web; and proprietary APIs on the
video game consoles. Additionally, Unity supports the low-level APIs Metal on iOS and macOS and Vulkan
on Android, Linux, and Windows, as well as Direct3D 12 on Windows and Xbox One.
Within 2D games, Unity allows importation of sprites and an advanced 2D world renderer. For 3D games,
Unity allows specification of texture compression, mipmaps, and resolution settings for each platform that
the game engine supports,and provides support for bump mapping, reflection mapping, parallax mapping,
screen space ambient occlusion (SSAO), dynamic shadows using shadow maps, render-to-texture and full-
screen post-processing effects. Unity also offers services to developers, these are: Unity Ads, Unity
Analytics, Unity Certification, Unity Cloud Build, Unity Everyplay, Unity IAP, Unity Multiplayer, Unity
Performance Reporting and Unity Collaborate.
11 | P a g e
Unity supports the creation of custom vertex, fragment (or pixel), tesselation, compute shaders and Unity's
own surface shaders using Cg, a modified version of Microsoft's High-Level Shading Language.

Features of Unity Engine

 Quick learning
Basically Unity3D is a quick learning tool because it itself described as a game development ecosystem that
means it is not just represented as a mere platform. It came out with a set of power tool that can be called as
assets. During the development, it helps to smooth out the potential crease. In the assets store, you can easily
get a readymade version of assets which can be customized, you can download it from the assets store.

 Dedicated developer community


By creating a community thread for the developers, Unity3D makes a way to know more about it. Utilizing
this thread, developers can share their ideas, suggestions, information and queries which help to gain much
more knowledge and improvement in the techniques.

 A single code can be deployed for multiple platforms


Unity3D shows that it follows a certain principle in generating a code which means write once, deploy
everywhere. By creating a single code using unity framework, developers can easily deploy it on various
platforms, including Play Stations, Android, iOS and Blackberry. With this, developing an app is easier for
both game owners and game development companies.

 Allows Integration with native codes


Developing a game by using the Unity3D framework makes the game extremely stable and the game can be
run as native game. Once the native code has been used, it can be integrated again in the future.

 It is a low cost technology


The latest version of the unity tool has a feature which supports mobile platforms for iOS and Android. A
game developer who has a passion of developing game using Unity3D tool can also convert it as his
profession, as it is low cost technology. So by using this tool’s features and your innovative idea and skills,
you can develop an outstanding game.

12 | P a g e
2.4.2 PHOTOSHOP

Adobe Photoshop is a raster graphics editor developed and published by Adobe Systems for macOS and
Windows.
Photoshop was created in 1988 by Thomas and John Knoll. Since then, it has become the de facto industry
standard in raster graphics editing, such that the word "photoshop" has become a verb as in "to Photoshop an
image," "photoshopping" and "photoshop contest", though Adobe discourages such use.[4] It can edit and
compose raster images in multiple layers and supports masks, alpha compositing and several color models
including RGB, CMYK, CIELAB, spot color and duotone. Photoshop has vast support for graphic file
formats but also uses its own PSD and PSB file formats which support all the aforementioned features.

With the Extended version of Photoshop CS5, 2D elements of an artwork can easily become three-
dimensional with the click of a button. Extrusions of texts, an available library of materials for three-
dimensional, and even wrapping two-dimensional images around 3D geometry.

With the Camera Raw plug-in, raw images can be processed without the use of Adobe Photoshop
Lightroom, along with other image file formats such as JPEGs, TIFFs, or PNGs. The plug-in allows users to
remove noise without the side-effect of over-sharpening, add grain, and even perform post-crop vignetting.

2.4.3 C# LANGUAGE

History of C#
C# is pronounced as "C-Sharp". It is an object-oriented programming language provided by Microsoft that
runs on .Net Framework.
Anders Hejlsberg is known as the founder of C# language.
It is based on C++ and Java, but it has many additional extensions used to perform component oriented
programming approach.
C# has evolved much since their first release in the year 2002. It was introduced with .NET Framework 1.0
and the current version of C# is 5.0.

13 | P a g e
Overview of C#
In 2000, Microsoft announced the C# programming language. C# has roots in C, C++ and Java. C# has
similar capabilities to Java and is appropriate for the most demanding app-development tasks, especially for
building today’s large-scale enterprise apps, web-based, mobile and “cloud”-based apps.
C# is object oriented and has access to the powerful .NET Framework Class Library—a vast collection of
prebuilt classes that enable you to develop apps quickly.
C# is event driven. You’ll write programs that respond to user-initiated events such as mouse clicks,
keystrokes, timer expirations, touches and finger swipes—gestures that are widely used on smartphones and
tablets.
C# also allows asynchronous programming in which multiple tasks can be performed at the same time.
Asynchronous make your apps more responsive to user interactions, such as mouse clicks and keystrokes,
among many other uses.

Features of C#

1) Simple
C# is a simple language in the sense that it provides structured approach (to break the problem into parts),
rich set of library functions, data types etc.

14 | P a g e
2) Modern Programming Language
C# programming is based upon the current trend and it is very powerful and simple for building scalable,
interoperable and robust applications.

3) Object Oriented
C# is object oriented programming language. OOPs makes development and maintenance easier where as in
Procedure-oriented programming language it is not easy to manage if code grows as project size grow.

4) Type Safe
C# type safe code can only access the memory location that it has permission to execute. Therefore it
improves a security of the program.

5) Interoperability
Interoperability process enables the C# programs to do almost anything that a native C++ application can do.

6) Scalable and Updateable


C# is automatic scalable and updateable programming language. For updating our application we delete the
old files and update them with new ones.

7) Component Oriented
C# is component oriented programming language. It is the predominant software development methodology
used to develop more robust and highly scalable applications.

8) Structured Programming Language


C# is a structured programming language in the sense that we can break the program into parts using
functions. So, it is easy to understand and modify.

9) Rich Library
C# provides a lot of inbuilt functions that makes the development fast.

10) Fast Speed


The compilation and execution time of C# language is fast.

15 | P a g e
C# FEATURES DIGRAM

2.4.4 VISUAL STUDIO 2017

The Visual Studio interactive development environment (IDE) is a creative launching pad that you can use
to view and edit nearly any kind of code, and then debug, build, and publish apps for Android, iOS,
Windows, the web, and the cloud. There are versions available for Mac and Windows. This topic introduces
you to the features of the Visual Studio IDE. We'll walk through some things you can do with Visual Studio
and how to install and use it, create a simple project, get pointers on debugging and deploying code, and take
a tour of the various tool windows.

With Visual Studio Tools for Unity (VSTU), you can use Visual Studio to write game and editor scripts in
C# and then use its powerful debugger to find and fix errors. The latest release of VSTU includes syntax
coloring for Unity's ShaderLab shader language, better debugger visualizations, and improved code
generation for the MonoBehavior wizard. VSTU also brings your Unity project files, console messages, and
the ability to start your game into Visual Studio so you can spend less time switching to and from the Unity
Editor while writing code.

Visual Studio Tools for Unity registers a log callback so it can stream the Unity console to Visual Studio. If
you have editor scripts that log information, you can plug them into the same callback to send your messages
to Visual Studio. For more information, see the Log Callback example.
16 | P a g e
2.5 SOFTWARE REQUIREMENT SPECIFICATION

Functional Requirements

At the most basic level, the game will draw the users perspective of the game to the
monitor where the player can then use the mouse and keyboard to issue commands to different units on the
game board. After receiving a command, the unit will go about performing the corresponding actions. The
game will end when player Kills all the enemies or the enemy kills the player , or a player loses the game.

Other Nonfunctional Requirements

1. Performance Requirements

The game may get slow when runs in a system of 512 MB RAM. This can be improved by using the system
specified in the system requirement.

2. Safety Requirements

The system should warn the use to take a break after every two hours continuous play to prevent eyestrain
and repetitive strain injury. No other safety requirements have been identified

3.Security Requirements

There is no need of any kind of security.

4. Software Quality Attributes

None

17 | P a g e
CHAPTER 3

SYSTEM DESIGN

3.1 SYSTEM FUNCTIONALITY


This section describes the overall functionality of the proposed system.

3.2 SYSTEM MODULES

3.2.1 Player-Controlled Module

The player-controlled module consists of four submodules: (i) the body, (ii) the Gun, (iii)the health, and (iv)
the player controller script. The body of the Player is the 3D model that the player sees in the game
environment; this submodule also contains the colliders, which enable the player to move with respect to
objects in the game environment. The body submodule also contains a script which animates the movement
of the player as he moves backward. The health component of the player is controlled by the health.cs script,
which handles displaying the current health, power and capacity of the character to the player. Lastly, the
submodule of the player-controller script, called PlayerController.cs, handles the user input from the
keyboard and applies the appropriate movement ,jump , and killing the Game controlled character.

3.2.2 Game-Controlled Module


The game-controlled (or the AI-controlled ) consists of four submodules: (i) the body, (ii) the Gun, (iii) the
trigger area, and (iv) the AI controller script. The body and gun of the game-controlled Enemy are identical
to the body and gun components of the player-controlled . The trigger area component of the enemy is
controlled by the Aggrodetection.cs script and detects when a player enters into the trigger area. When this
happens, the AI controller script is informed so that the enemy moves towards the player and fires at him.
The AI controller script, called AICarController.cs, contains all the implemented AI techniques and
algorithms that handle the movement of the game-controlled Enemy so that it can effectively prevent and
with the player-controlled character.

3.2.3 Environment Module

The environment module consists of two submodules: (i) the racetrack and (ii) the waypoints system. The
racetrack is the road within the game environment on which the cars race, and the waypoints system
represents the key positions around the racetrack. The latter enables the game-controlled cars to navigate
18 | P a g e
around the racetrack.

3.2.4 Audio Module


The Audio Module consists of two audios: (i) The main menu music (ii) Gun shoot music.

When the main menu starts the main menu music runs and at the time of Shooting the enemy Gun shoot
music runs.

3.3 USER INTERFACE DESIGN, OUTPUT


To control the player Movement and shooting, the user inputs commands to the player
through the keyboard: the “W” key is pressed to move forward, the “S” key is pressed to
backword, the mouse is used for changing the angle of the player or you can say “player
view”. The player needs to search and kill all the enemies in order to win the game.

3.3.1 Splash Screen


This is the starting screen that comes at the start showing the name of the studio i.e Terminator’s studio.

19 | P a g e
3.3.2 Main Menu
The Main Menu has four buttons Play Game, resume game quit game and Credit. The user provides input by
clicking on buttons.

3.3.3 Player
The screen showing the player with the gun in his hand and he is at top of the hill.

20 | P a g e
3.3.4 Game scene
As shown in scene the game environment has houses, building and the player with terrain.

3.3.5 Enemy
It is showing the enemy who will cause damage to the player.

21 | P a g e
3.3.6 Credit Scene

The credit scene is showing the name of developer, artists and mentor.

22 | P a g e
CHAPTER 4

SYSTEM IMPLEMENTATION

5.1 SYSTEM CODING

5.1.1 AI control Script

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class AggroDetection : MonoBehaviour
{
public event Action<Transform> OnAggro = delegate { };

private void OnTriggerEnter(Collider other)


{
var player = other.GetComponent<PlayerMovement>();

if(player != null)
{
OnAggro(player.transform);
Debug.Log("Aggrod");
}
}
}

23 | P a g e
5.1.2 Player control Script

using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
private CharacterController characterController;
private Animator animator;

[SerializeField]
private float forwardMoveSpeed = 7.5f;
[SerializeField]
private float backwardMoveSpeed = 3;
[SerializeField]
private float turnSpeed = 150f;

private void Awake()


{
characterController = GetComponent<CharacterController>();
animator = GetComponentInChildren<Animator>();
Cursor.lockState = CursorLockMode.Locked;
}

private void Update()


{
var horizontal = Input.GetAxis("Mouse X");
var vertical = Input.GetAxis("Vertical");

var movement = new Vector3(horizontal, 0, vertical);

animator.SetFloat("Speed", vertical);

transform.Rotate(Vector3.up, horizontal * turnSpeed * Time.deltaTime);

if (vertical != 0)
{
float moveSpeedToUse = (vertical > 0) ? forwardMoveSpeed : backwardMoveSpeed;

characterController.SimpleMove(transform.forward * moveSpeedToUse * vertical);


}
}
}

24 | P a g e
5.1.3 Camera controller Script

using System.Collections;
using System.Collections.Generic;
using Cinemachine;
using UnityEngine;

public class CameraController : MonoBehaviour


{
private CinemachineComposer composer;

[SerializeField]

private float sensitivity = 1f;

private void Start()

{
composer =
GetComponent<CinemachineVirtualCamera>().GetCinemachineComponent<CinemachineComposer>()
;
}

private void Update()

{
float vertical = Input.GetAxis("Mouse Y") * sensitivity;
composer.m_TrackedObjectOffset.y += vertical;
composer.m_TrackedObjectOffset.y = Mathf.Clamp(composer.m_TrackedObjectOffset.y, -10, 10);
}
}

25 | P a g e
5.1.4 Menu Manager Script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class MainMenuFunction : MonoBehaviour


{

public AudioSource buttonPress;

public void PlayGame()


{
buttonPress.Play();
RedirectToLevel.redirectToLevel = 3;
SceneManager.LoadScene(2);
}

public void QuitGame()


{
Application.Quit();
}

public void PlayCreds()


{
buttonPress.Play();
SceneManager.LoadScene(4);
}
}

26 | P a g e
5.1.5 Gun Script

using UnityEngine;
public class Gun : MonoBehaviour
{
[SerializeField]
[Range(0.1f, 1.5f)]
private float fireRate = 0.3f;

[SerializeField]
[Range(1, 10)]
private int damage = 1;

[SerializeField]
private ParticleSystem muzzleParticle;

[SerializeField]
private AudioSource gunFireSource;

private float timer;

void Update()
{
timer += Time.deltaTime;
if (timer >= fireRate)
{
if (Input.GetButton("Fire1"))
{
timer = 0f;
FireGun();
}
}
}

private void FireGun()


{

muzzleParticle.Play();
27 | P a g e
gunFireSource.Play();

Ray ray = Camera.main.ViewportPointToRay(Vector3.one * 0.5f);

Debug.DrawRay(ray.origin, ray.direction * 100, Color.red, 2f);

RaycastHit hitInfo;

if (Physics.Raycast(ray, out hitInfo, 100))


{
var health = hitInfo.collider.GetComponent<Health>();

if (health != null)
health.TakeDamage(damage);
}
}
}

28 | P a g e
5.1.6 Health Script

using UnityEngine;
public class Health : MonoBehaviour
{
[SerializeField]
private int startingHealth = 5;

private int currentHealth;

private void OnEnable()


{
currentHealth = startingHealth;
}

public void TakeDamage(int damageAmount)


{
currentHealth -= damageAmount;

if (currentHealth <= 0)
Die();
}

private void Die()


{
gameObject.SetActive(false);
}
}

29 | P a g e
5.1.7 Enemy Script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;

public class EnemyMovement : MonoBehaviour


{

private AggroDetection aggroDetection;

private void Update()


{
aggroDetection = GetComponent<AggroDetection>();
aggroDetection.OnAggro += AggroDetection_OnAggro;

private void AggroDetection_OnAggro(Transform Target)


{
GetComponent<NavMeshAgent>().SetDestination(Target.position);
}
}

30 | P a g e
5.1.8 SplashtoMenu Script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class SplashToMenu : MonoBehaviour


{

public GameObject theLogo;

void Start()
{
StartCoroutine(RunSplash());
}

IEnumerator RunSplash()
{
yield return new WaitForSeconds(0.5f);
theLogo.SetActive(true);
yield return new WaitForSeconds(4.5f);
SceneManager.LoadScene(1);
}

31 | P a g e
CHAPTER 5

SUMMARY AND CONCLUSION

5.1 SUMMARY
Development of the game system was made easier because of the implementation tools. The Unity
game engine supports effective development of the game system of Shooting Game with its high-
level abstraction programming tools and intuitive user interface. These features support developers
in implementation of AI concepts so that they can focus on the game logic and ignore lower level
development details such as graphics rendering and physics calculations. The combined tools of
Visual Studio and Unity support the implementation processes because Visual studio consists of
auto correction features for many libraries and SDKs used in Unity. For example, the combined
tools support the developer in implementation of the waypoint system because the Unity engine
supports positioning waypoints in 3D space. Hence, the developer can use the waypoint system
instead of more traditional AI techniques in determining a path for the Enemy.
Compared to traditional AI search techniques, the Navmesh render system in the Unity platform
enables the Shooting system of the game to be more efficiently developed. If the Unity platform
was not used, the Enemy would be mapped to a set of coordinates or nodes, which represent the
3D search space that covers the Environment.

A game engine is the core of creating a game. The integration of model design, level design and
script design is the game engine, which is complex and powerful. The Unity game engine supports
visualized design, thus it is a strong game engine which is suitable for a beginner. However, it is
not very easy to learn the Unity game engine well. There are various functions to be realized.

In order to make the game to be an integrated game, two scenes were designed. One was the game
start scene and the other one was the game scene. As a result, the game start scene was achieved
with 15 textures and pictures.

5.2. LIMITATIONS OF SYSTEM


These are the limitations of the system.

 User interface – In the user interface we have not provided the options to select the mode of the
game, quit sound , setting options etc.
 Platform – The game can be played on PC ,MAC and Linux Standalone but it is not available for
other platforms like android etc.
 Artificial intelligence – The Game-controlled car is following waypoints to complete the race and it
is not aware of the surroundings like it can go outside the track.
 Multiplayer – The game can only be played by one player it does not support multiplayer to play the
game.
 Not Available in Software – The game is not available in software for downloading it is running in
unity engine.

32 | P a g e
5.3. IMPROVEMENTS

There are numerous things that can be improved and added to the game to make it better.

 Improve user interface - The user interface looks pretty good at the moment, But the options like
setting audio, Game mode to choose what type of game you want to play hard or easy, Quit Game
option etc are required to be included in the game.
 Add textures for specific platforms - at the moment the textures only officially support one
resolution. This is more clear in the background in the main menu and other screens, the image does
not stretch properly on different screens.
 Improve Artificial Intelligence - the AI is very simple at the moment; in the future I would like to
make them more intelligent. They could potentially have a better understanding of how to deal with
certain situations such as Killing the Player. At the moment it is not aware of its surroundings, it only
knows about the path it should follow. In the future it could be given a line of sight which will allow
it to see what is ahead and beside it and react accordingly, for example if there is a house or Vehicle
next to it. It can destroy it or can ignore.
 Improve physics - in the future I would like to be able to add damage to Player and Enemy by
showing the blood and real life moments. when Player attacks the enemy.
 Multiplayer feature - adding a network features would make the game much more fun.I could add
local multiplayer over Wi-Fi or Bluetooth or worldwide multiplayer over the internet.
 Interactive map - the interactive map to select where the user wants to move and kill the enemy is
something I really wanted to include, but because of time I couldn’t this would be my top priority
when continuing this project.
 Adding new Characters – At this we have only one Character ie army man but if we continue this
project we will add more Players Characters to select and to make the game more interesting.
 Adding More Environment – We are having only one Environment now where the player finds the
enemy but we are thinking to provide more Environment so that the user will be able to choose the
they desired to play with.

5.4. CONCLUSIONS

The Game was tested by over twenty users, who all reported that they thoroughly enjoyed the game. It was
observed that there was approximately equal number of players who were able to kill the enemy. This
suggests that not only did the game provide an entertaining gaming experience, it also provided a reasonably
engaging and challenging gameplay.

In general, it can be concluded that the Unity platform supported efficient development of the Third person
Shooting Game. The Unity platform supports implementing the player’s movement on the terrain with the
keyboard and mouse , the physics engine, and vector calculation functions, all of which are not available if
the implementation was done using traditional AI search techniques.

33 | P a g e
With these Unity components, We are able to implement the enemy’s search for the player with less effort
and more efficiently, and the developed Army Character can successfully mimic human shooting behaviour.

All of the game features were achieved as the Third-Person Shooting game. More game features were
looking forward to the future. The goal of the report was to demonstrate how to create a 3D game with the
Unity game engine and discuss the implementation of the scripts. The damage system was one of the special
designs. Two kinds of common damage ways were explained. The usages of the Skyboxes and the terrain
design were the characteristics in the game. The most important aspect of the game design is thinking how to
create more new playabilities. There might be more possibilities for the game in the future.

5.5. FUTURE SCOPE

The Game is designed for entertainment , enjoyment and refreshment of the mind. Furthermore, while this
game was designed for entertainment, the software can be extended to become Shooting simulator for
educational purposes. By modifying some of the parameter values of the Army Character,and by modifying
the game environment to resemble that of a Battlefield .

34 | P a g e
CHAPTER 6

REFERENCES

 Unity Game Engine


https://unity3d.com
https://unity3d.com/unity

 Unity Assets Store


https://store.unity.com
https://assetstore.unity.com/lists/free-unity-asets-for-car-game-43908

 C# Scripting
https://unity3d.com/learn/tutorials/s/scripting
https://docs.unity3d.com/Manual/CreatingAndUsingScripts.html
https://docs.unity3d.com/ScriptReference/GameObject.htm
https://unity3d.com/learn/tutorials/topics/scripting/activating-gameobjects
https://unity3d.com/learn/tutorials/projects/2d-ufo-tutorial/following-player-camera

 C# Books
The C# Player's Guide (3rd Edition)
Unity in Action: Multiplatform Game Development in C# with Unity 5
C# 6.0 and the .NET 4.6 Framework 7th Edition

 Websites
https://forum.unity.com/Community Learning & Teaching
https://www.lynda.com/Photoshop-tutorials/279-0.html
https://www.lynda.com/Animation-training-tutorials/1288-0.html
https://www.c-sharpcorner.com/beginners/
https://unity3d.com/learn/tutorials
https://unity3d.com/learn/tutorials/topics/scripting/coding-unity-absolute-beginner
https://www.pluralsight.com/courses/introduction-game-development-unity
https://www.pluralsight.com/courses/introduction-c-unity-1689

 Other Sources
A. L. Samuel, “Some studies in machine learning using the game of checkers. II—recent
progress,” IBM Journal of Research and Development, vol. 11, no. 6, pp. 601–617, 1967. View
at Publisher · View at Google Scholar
D. A. Waterman, “Generalization learning techniques for automating the learning of
heuristics,” Artificial Intelligence, vol. 1, no. 1-2, pp. 121–170, 1970. View at Publisher · View
at Google Scholar · View at Scopus
Counter-Strike: Source, http://www.valvesoftware.com/games/css.html.

35 | P a g e

You might also like