BSC CSIT Final Year Project Report On Sword of Warrior Game Project Report
BSC CSIT Final Year Project Report On Sword of Warrior Game Project Report
The success and final outcome of this project required a lot of guidance and assistance
from many people, and we feel extremely fortunate to have got all this along the
completion of our final year project. Whatever we have done is only due to such guidance
and assistance and we would not forget to thank them. We could not have completed this
project without help from our college “NIST COLLEGE” which gave the supportive
hands before us academically, also regarding other activities related to Information
Communication Technology as well as extra curriculum activities that we got to
participate in. It gave us family like environment.
We take this opportunity to express our profound gratitude and deep regards to our
supervisor Mr. Samish Shrestha for his exemplary guidance, monitoring, and constant
encouragement throughout the course of this thesis.
We could also like to appreciate the help of various people for providing us essential data
required for our project as well as their time in guiding us so to how our project will be
more effective in users prospective. We are also grateful to our teachers for their constant
support and guidance.
Finally, we would like to express our sincere thanks to all the friends and others who
helped us directly or indirectly during this project work. This project has been a wonderful
experience where we have learnt and experienced many beneficial things.
iii
Abstract
iv
Table of Contents
Acknowledgement iii
Abstract iv
Table of Contents v
List of Abbreviations ix
Chapter 1: Introduction 1
1.1. Introduction 1
1.2. Problem Statement 2
1.3. Objectives 2
1.4. Scope, Goals and Limitation 2
1.5. Development Methodology 3
1.6. Report Organization 4
Chapter 2: Background Study and Literature Review 5
2.1. Background Study 5
2.2. Literature Review 6
Chapter 3: System Analysis 8
3.1. System Analysis 8
3.1.1. Requirement Analysis 8
i. Functional Requirements 8
ii. Non-Functional Requirements 12
3.1.2. Feasibility Analysis 13
i. Technical Feasibility 13
ii. Operational Feasibility 14
iii. Economic Feasibility 14
iv. Schedule Feasibility 15
v
3.1.3. Analysis 16
• Sequence Diagram 16
• Activity Diagram 16
• State Diagram 18
Chapter 4: System Design 19
4.1. System Design 19
• Class Diagram 21
• Component Diagram 22
• Deployment Diagram 23
5.2. Testing 31
5.2.1. Test Cases for Unit Testing 31
Appendices 38
vi
List of Figures
vii
List of Tables
viii
List of Abbreviations
AA Action-Adventure
AP Adventure Platformer
PLAT Platform
2D Two-Dimensional
UX User Experience
C# C Sharp
ix
Chapter 1: Introduction
1.1. Introduction
The 2d platformer video game genre is the genre of video games, consisting of action-
adventure platformer, side scrolling role playing platformer, player controller platformer.
The core objective of this genre is to move the player character from A to B points through
obstacles and enemies in each stage. A platformer games have levels that consists
platforms, game environment, coins, enemies, obstacles, weapons and many more. On
game environment player can jump through platforms, climb to platforms, collect the
coins as reward, fighting with enemies, explore the environment, tackles the obstacle,
fighting with boss enemy, completing the present level-go to next level.
The Unity Editor enables you to create 2D and 3D games, apps and experiences. It is
very popular game engine and also many game developers used it for completing their
handy projects. So that we created our game by using this software. Human Interaction
is the major part of any system. Project look and feels are designed and created so that
every player can easily be interacted with system.
A lot of work was done on it. This project covers the area of Graphics, Physics, Audio,
User Interface, Animations, Scripting, Unity Services.
1
1.2. Problem Statement
Design a 2D platformer game that offers engaging gameplay mechanics, challenging
level designs and an immersive visual and audio experience. The game should allow
players to control a character that can jump, run and interact with the game environment
to navigate through various levels, overcome obstacles, defeat enemies and ultimately
reach the end goal. The game should also offer collectibles, some puzzles, challenges and
rewards to keep players motivated and engaged. The game must be designed to provide
a fair level of challenge while avoiding frustration for the players. The game should be
optimized for desktop/pc and should be enjoyable for players of all ages and skill levels.
1.3. Objectives
The objective of “Sword Of Warrior” can be summarized into following points:
Our project has made it easier for everyone to create their own digital games. Playing
video games fulfills a purpose in their lives. This could include gaming for: relaxation,
opportunities to exert control, enjoyment, creativity, socialization, prevent boredom,
challenges, and achievement. Main purpose of video games is for entertainment.
Goals
This final project report is designed to build a 2D game for entertainment and for practice
purpose.
2
Limitation
• Single Player
• May not have appropriate Sound Effects
• Risk of copyright claim on Music
• Required to improving the details in Level Design
Even if one can prepare a well-thought -out design document, some features do not give
the same effect in gameplay as on the paper. During implementation phase many features
are added, removed, or modified. Accordingly, one needs to make some modifications on
game design and requirement analysis. Thus, one of the most suitable development
methodologies for game development is iterative development process. Most of game
developers have the same idea about the advantages of iterative development process for
game developers.
3
1.6. Report Organization
Chapter 1: Consists of overview, introduction, problem statement, objectives, scope,
goals and limitation, development methodology of the proposed system.
Chapter 4: Design of Sword of Warrior project is explained in detailed with all the
necessary diagrams and brief functionality.
Chapter 5: Process of implementation and testing is described along with all the tools
used for the development.
4
Chapter 2: Background Study and Literature Review
In 1980, Thomas W. Malone states: “In some senses, computer programming itself is one
of the best computer games of all. In the ‘Computer programming game,’ there are
obvious goals, and it is easy to generate more. There is unique relationship between
digital games and Computer science since computer science is the foundation of such
games. But more than that, the programming process itself contains many of the same
elements found in games.
Sword of Warrior is 2D Action-Adventure PLAT game which has five main parts:
a) Game Mechanics
Our game has various actions that the player can perform such as jumping,
climbing, attacking, throwing projectiles etc. It is essential to study popular
action-adventure games to understand how they use these mechanics to create
engaging gameplay.
b) Level Design
Our game level design offers a balance of exploration, combat, puzzles, and
platforming. It is essential to understand how to create diverse and challenging
levels that keeps the player engaged.
5
c) Story Telling
Our game has simple and sweet story which motivate players to play.
d) Art Style
Our game art style complement the gameplay and storytelling.
e) Audio Effects
Background music, Sfx, Voice over are may be used to enhance the players
experience and create an immersive environment.
Shovel Knight is a platform video game developed and published by Yacht Club Games.
The game received critical acclaim, with critics considering it one of the greatest “one of
the greatest video games ever made”. This game meta critic rating is 85 and steam rating
is 10 out of 10.
Sword of xolan is an action platformer game that includes the juice of pixel art style.
Xolan is a young and brave man who fight for justice no matter what the cost. This game
apple app store rating is 4.6 out of 5 and have positive reviews, google play store rating
is 4.5 out of 5.
Celeste is a 2D platform game developed and published by indie studio Matt Makes
Games. This game is based on player controller. This game meta critic rating is 88 and
steam rating is 10 out of 10.
6
Some theories, articles and their conclusion
“The Design and Play of Platform Games” by Jesper Juul: This paper examines the
mechanics of platform games, including character movement, level design, and enemy
behavior. The author argues that the player’s interaction with the game environment is
key to the success of the game.
“Building Successful 2D Action Games” by Dave Voyles: This article provides tips and
best practices for designing and developing 2D Action Games. It covers topics such as
game mechanics, level design, art style and sound design.
“The Design of Super Mario Bros.” by Shigeru Miyamoto: In this article, the creator of
Super Mario Bros. discusses the design philosophy behind the game’s mechanics and
level design. He emphasizes the importance of creating a game that is easy to understand
but difficult to master.
7
Chapter 3: System Analysis
• Player Controls
• Game Physics
• Level Design
• Enemy AI
• User Interface
• Audio and Visuals
i. Functional Requirements
Very beginning of the game, there is Game Intro and scene transit to the Main
Menu. Details of the menu are listed below:
• Main Menu
• Level Selection
• Pause Menu
• Gameplay Module
8
1. Main Menu
• Player should be able to start the game.
• Player should be able to exit the game.
• Player should be able to continue the game from where he left.
2. Level Select
• Player should be able to select the next level after completing the
previous one.
• Player should be able to see the progress of their gameplay on each
level.
3. Pause Menu
• Player should be able to resume the game.
• Player should be able to go to level select menu.
• Player should be able to go to main menu.
4. Gameplay Module
• Player should be able to run/walk, jump, double jump, climbing the
ladder.
• Player should be able to attack the enemies, damaging their health
and kill them through the sword attack and fire ball as projectile.
• Player can die and respawn at various checkpoints available.
9
Use Case Diagram
10
Use Case Diagram Description
11
Stakeholders and Interests Player:
Player can Select the Specific Level
after completing the Previous One.
Pre-Condition Game Must be in running mode.
Post-Condition Specific Level Selected
Main Success Scenario • Player Start New Game
• Player Complete the Level-1
• Level Select Menu Display
Successfully
• Player Select the Next Level
• Player Selected the level
successfully
Special Requirements • User friendly UI and game
should be played easily in
landscape mode.
• Language should be
international (English)
Open Issues • Low RAM can Crashed the
Game.
Technology and Data Variations List • Game should be played on
Desktop/Pc and OS must be
Windows.
1. Usability
The usability requirements for Sword of Warrior are following:
• All the elements of the games must be designed in accordance to a
naïve user’s perspective; however, the gameplay is required
beginner level knowledge of platformer games.
12
• The game should provide key points or instruction how to play the
game.
• This game can be played by all types of gamers so the game will be
easy to learn and play.
2. Performance
The performance requirements for the game are:
• The game should run at minimum of 30 frames per second.
• The latency overall should be less than 200 milliseconds.
The scope of this project is to build pc game application which can be accessed by user
through at any time, from any place (if device is available). In feasibility study phase of
this Unit 2D game we had undergone through following steps:
i. Technical Feasibility
Technical feasibility assess whether the current technical resources are
sufficient for the new system. The tools and technology that will be used in
making the Sword of Warrior are Unity game engine, Microsoft visual studio,
programming language C#, Adobe Photoshop, Audacity, Adobe Premiere Pro
are completely free for students.
Unity itself also has animation editor which can be used to make simple
animation that is related to moving objects, changing sprites, and sprite editor
which can separate sprites which is good enough for our game.
The simplicity of the project along with the facts mentioned above proves that
this software is also technically feasible.
13
Hardware Specification
• Laptop, Desktop
• 2GB RAM, 1GB ROM/SSD
Software Specification
• Windows OS
The tools and technology that where used in the making of the Sword of
Warrior are:
Programming Language: C#
14
iv. Schedule Feasibility
Time is important and most valuable factor. The completion of this project with
the cooperation of team members and resources within time. Schedule
feasibility is a measure of how reasonable the project timetable is. So, our
project feasible schedule had been managed through proper time schedule.
24-Oct 13-Nov 3-Dec 23-Dec 12-Jan 1-Feb 21-Feb 13-Mar 2-Apr 22-Apr
Report Writing
15
3.1.3. Analysis
Using Object-Oriented Approach
• Sequence Diagram
Sequence diagram shows the sequence of object interactions. It represents the flow
of messages in the system and is also termed as an event diagram. It helps in
envisioning several dynamic scenarios
The above sequence diagram shows the player start the game, main menu showed
up. Player play the game, he can pause and continue the game, he can also go to
level select map and can exit the game.
• Activity Diagram
16
.
17
• State Diagram
A state diagram is a type of diagram used in computer science and related fields to
describe the behavior of systems. State diagrams require that the system described
is composed of a finite number of states; sometimes, this is indeed the case, while
at other times this is a reasonable abstraction.
Above diagram shows the state of game play after player load the game.
18
Chapter 4: System Design
The System consists of many Modules that work simultaneously with each other. The
User interacts with the program with the help of an Environment (Interface). The
Environments is Rendered using the Rendering modules with gets most of its information
from Collision and Physics module while rendering as well as in-game play. When the
player interacts the environment other modules also start to pitch in inputs such as
movement modules moves the player character and due to this interaction, the
environment changes accordingly.
Main Menu
Player
Environment/In
Game
Physics
Game State
Collision
Movement Rendering
19
Object Oriented Approach
Define game entities and behaviors: Start by identifying the game entities and their
behaviors, such as the player character, enemies, items, and obstacles. Define their
attributes and methods that describe their behavior and how they interact with each other.
Create game classes: Create classes for each game entity that encapsulate their behavior
and attributes. For example, create a Player class with attributes such as health, speed,
and position, and methods such as move(), jump(), and attack(). Create similar classes for
other game entities such as enemies and items.
Implement game mechanics: Use the classes and their methods to implement game
mechanics such as movement, collision detection, combat, and scoring. Use design
patterns such as the observer pattern to create event-based mechanics such as triggering
an action when a specific event occurs in the game.
Test and iterate: Test the game mechanics and the classes, and iterate on the
implementation based on feedback from testing. Refactor the code to improve
performance and maintainability.
Implement game levels: Create game levels and use the classes and their methods to
implement the game logic for each level. Use scripting languages such as Lua or Python
to create level-specific behaviors such as spawning enemies, triggering events, and
setting the level objectives.
Polish and deploy: Polish the game by adding sound effects, music, and additional
assets. Deploy the game on various platforms such as desktop, mobile, and consoles.
20
• Class Diagram
The class diagram depicts a static view of an application. It shows the attributes,
classes, functions, and relationships to give an overview of the software system. It
constitutes class names, attributes, and functions in a separate compartment that
helps in software development. Since it is a collection of classes, interfaces,
associations, collaborations, and constraints, it is termed as a structural diagram.
21
• Component Diagram
A component diagram is used to break down a large object-oriented system into the
smaller components, so as to make them more manageable. It models the physical
view of a system such as executables, files, libraries, etc. that resides within the
node.
Above diagram shows the components of our project as Game Play, Player Records,
Level Map, Main Menu etc. This helps project more manageable.
22
• Deployment Diagram
The deployment diagram visualizes the physical hardware on which the software
will be deployed. It portrays the static deployment view of a system. It involves the
nodes and their relationships.
23
4.2. Algorithm Details
• Information
A* search Algorithm is a simple and efficient search algorithm that can be used to
find optimal path between two nodes in a graph. It will be used for the shortest path
finding. It is informed search using heuristic function h(n), and cost to reach the
node n from the start state g(n). This search algorithm expands less search tree and
provides optimal result faster.
In A* search algorithm, we use search heuristic as well as the cost to reach the node.
Hence, we can combine both costs as following, and this sum is called as a fitness
number.
Cost to reach
from node n to
Estimated cost Cost to reach goal node
of the cheapest node n from
solution start state
Cost to reach
Estimated cost from node n to
Figure Figure
4.5: A* 4. 5:
Algorithm Component
goal node
of the cheapest
Enemy Eagle
solution
and Enemy
FireCost to
Algorithm reach node n
from start state
Step 1: Place the starting node in the OPEN list.
Step 2: Check if the OPEN list is empty or not, if the list is empty then return failure
and stops.
Step 3: Select the node from the OPEN list which has the smallest value of
evaluation function (g + h), if node n is goal node then return success and stop,
otherwise
24
Step 4: Expand node n and generate all of its successors, and put n into the closed
list. For each successor n, check whether n is already in the OPEN or CLOSED list,
if not then compute evaluation function for n and place into Open list.
Step 5: Else if node n is already in OPEN and Closed, then it should be attached to
the back pointer which reflects the lowest g(n) value.
They follow the player in game after game starts and damage the health of the
player. They choose the shortest path to reach the destination. They ignore the
unnecessary collisions towards the game objects, so this helps them to reach
their destination optimally.
25
Chapter 5: Implementation and Testing
Before starting the development process, you need to have a clear idea of the game
concept. Create a prototype that includes the basic features of the game, such as character
movement, level design, and enemy behavior. This prototype will help you identify any
potential issues and adjust your development plan accordingly.
Once you have a prototype, you can identify the features that you want to add to the game.
Prioritize the features based on their importance and feasibility. Focus on implementing
the core features first and then move on to the secondary ones.
26
Develop the core features:
Start developing the core features of the game, such as player movement, level design,
and enemy behavior. Implement these features and test them thoroughly to ensure that
they are working correctly.
Test the game regularly to identify any bugs or issues that need to be fixed. Address these
issues promptly and iterate on the game design as necessary. Keep testing and iterating
until you have a solid foundation for your game.
Once you have the core features in place, start adding the secondary features, such as
power-ups, collectibles, and boss battles. These features can enhance the gameplay
experience and make the game more enjoyable.
Test the game again after adding the secondary features. Make sure that everything is
working as intended and iterate on the game design as necessary.
After all the features are in place and working correctly, it's time to polish the game. Add
sound effects, music, and visual effects to enhance the game's overall quality.
Test the game thoroughly one last time before releasing it to the public. Make any final
adjustments and fixes as necessary. Once everything is working correctly, release the
game to the public.
27
2. TextMeshPro: is a powerful text rendering tool that offers advanced
typography, text styling, and layout control.
Back End
• C#
C# (pronounced C sharp) is a general-purpose high-level programming
language supporting multiple paradigms. C# encompasses static typing, strong
typing, lexically scoped, imperative, declarative, functional, generic, object-
oriented (class-based), and component-oriented programming disciplines.
Features
1. Simple
2. Modern Programming Language
3. Object oriented
4. Type safe
5. Interoperability
6. Component oriented
• Unity 2021.3.16f1
The Unity Editor enables you to create 2D and 3D games, apps and
experiences. It is very popular game engine and also many game developers
used it for completing their handy projects. So that we’re going to create our
game by using this software. Human Interaction is the major part of any system.
Project look and feels are designed and created so that every player can easily
be interacted with system.
28
Code Editor
Audio Editor
• Audacity
Image Editor
• Adobe Photoshop
Video Editor
29
3. Enemy AI and NPC system: If your game includes non-player characters, you
would need an AI system to control their behavior and interactions with the
player.
4. Level Design: This module would allow you to design and create the levels for
your game, including terrain, obstacles, and enemies.
5. Audio engine: This module would handle the game's sound effects and music.
6. User interface: This module would handle the game's menus, HUD, and other
user interface elements.
7. Animation system: This module would handle the animation of characters and
objects in the game world, bringing them to life and adding visual flair to the
game.
8. Special effects system: This module would handle the game's special effects,
such as explosions, particle effects, and lighting.
9. A* Search Algorithm for Enemy AI: The A* search algorithm is a popular
choice for implementing enemy AI in games because it allows the enemy to
make intelligent decisions about how to move and attack in order to reach their
target, while avoiding obstacles and other hazards.
30
Figure 5. 2: Implementation of A* Path Finding Algorithm
5.2. Testing
Testing is the process of determining whether the system works effectively and
efficiently. Testing does not only include debugging. It also checks for quality assurance,
validation and verification, reliability and estimation.
Objective: To ensure that the Player Controller is working as intended and the animations
are running smoothly.
31
Table 5. 1: Test Case for Player Controller and Animations
No. Test Case/Test Script Attribute and Value Expected Result Result
1. Player controller such as Using input manager Player will move Pass
Movement, jumping, to use input keys to according to the
running, and other thing move the player Keys: input provided to
related are working W,A,S,D the input manager
correctly. by the user
2. Player movement such as Using input manager Player movement Pass
movement body, jumping, to determine which feels much more
climbing. animation to play. realistic and natural
Objective: To ensure that the Player Combat is working as intended and the animation is
running smoothly.
Objective: To ensure that the selected level runs, and no error is encountered.
32
Table 5. 3: Test Case for Selecting Level
Objective: To ensure that the A* Path Finding Algorithm works properly in Enemy AI,
and no error is encountered.
Objective: To verify that the game starts without any errors or crashes.
33
Table 5. 5: Test Case for Game Start
Objective: To ensure that the game’s main menu is user friendly and easy to navigate.
Objective: To ensure that the game’s Checkpoint and Respawn System works without
any errors.
34
2. Respawn Player get the checkpoints and Player respawn Pass
System he died at some point, he will be successfully.
respawn at recent checkpoint.
35
Chapter 6: Conclusion and Recommendation
6.1. Conclusion
In this game, we have implemented Responsive character controlling system, various
types of Enemies AI with different behavior and activities, Checkpoints and Respawn
system, Health system for both enemies and player so they can receive damage, engaging
and realistic Level design, Player reward system like treasure chest and collectibles, Level
Selection System, adding different effects to most of the player’s intractable objects and
also added animations to all of the possible game objects including the user interface.
This game is solely made for the user’s entertainment purpose and it’s principle objective
was to make a game that is similar to old Pixel Art Action-Adventure games but yet to
have modern vibe.
Better user experience is the go-to-goal for every industry related to computer science
including the computer gaming industry of the World. The game will provide the user
with an immersive user interface and a better gameplay.
Some of the plans for the future of this application could possibly be:
36
References
[1] K. Eby, “The Power of Iterative Design and Process” January 2, 2019[Online].
Available: https://www.smartsheet.com/iterative-process-guide
[2] J. Jul, “The Design and Play of Platform Games” published in 2010 by MIT Press.
Available: https://www.jesperjuul.net/text
Available: https://learn.unity.com/project/2d-platformer-template
Available: https://www.youtube.com/@gamesplusjames
https://www.youtube.com/@PandemoniumGameDev
https://www.youtube.com/@Brackeys
Available: https://docs.unity.com/
Available: https://shmuplations.com/supermarioworld/
37
Appendices
Appendix 1: Screenshots
38
39
Appendix 2: Source Code
MainMenu.cs
void Start()
{
if (PlayerPrefs.HasKey(startScene + "_unlocked"))
{
continueButton.SetActive(true);
}
else
{
continueButton.SetActive(false);
}
}
// Update is called once per frame
void Update()
{
}
public void StartGame()
{
SceneManager.LoadScene(startScene);
PlayerPrefs.DeleteAll();
}
public void ContinueGame()
{
SceneManager.LoadScene(continueScene);
}
public void QuitGame()
{
Application.Quit();
Debug.Log("Quiting Game");
40
}
PlayerCombat.cs
void Start()
{
anim = GetComponent<Animator>();
}
void Update()
{
if (!PauseMenu.instance.isPaused)
{
if (Time.time >= nextAttackTime)
{
if (Input.GetMouseButtonDown(0)&&!PlayerController.instance.OnLadder)
{
//isAttacking = true;
Attack();
nextAttackTime = Time.time + 1f / attackRate;
}
}
}
/*if (!anim.GetCurrentAnimatorStateInfo(0).IsName("Attack"))
{
isAttacking = false;
}*/
}
void Attack()
{
//play an attack animation
anim.SetTrigger("Attack");
AudioManager.instance.PlaySFx(5);
41
//detect all enemies in range of attack
Collider2D[] hitEnemies = Physics2D.OverlapCircleAll(attackPoint.position,
attackRange, enemyLayers);
//damage enemy
foreach (Collider2D enemy in hitEnemies)
{
//Debug.Log("We hit" + enemy.name);
42
Enemy AI with A* Path Finding Algorithm (Custom Script that use the reference of
Path.cs)
EnemyAI.cs
using Pathfinding;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
int currentWaypoint = 0;
bool reachedEndOfPath = false;
Seeker seeker;//seeker instance for showing the green connector between the source
and target game object
Rigidbody2D rb;
// Start is called before the first frame update
void Start()
{
seeker = GetComponent<Seeker>();
rb = GetComponent<Rigidbody2D>();
//reachedEndOfPath = false;
InvokeRepeating("UpdatePath", 0f, .5f);
}
void UpdatePath()
43
{
if (seeker.IsDone())
seeker.StartPath(rb.position, target.position, OnPathComplete);
}
void OnPathComplete(Path p)
{
if (!p.error)
{
path = p;
currentWaypoint = 0;
}
}
// Update is called once per frame
void FixedUpdate()
{
if (path == null)
return;
if (currentWaypoint >= path.vectorPath.Count)
{
reachedEndOfPath = true;
return;
}
else
{
reachedEndOfPath = false;
}
Vector2 direction = ((Vector2)path.vectorPath[currentWaypoint] -
rb.position).normalized;
Vector2 force = direction * speed * Time.deltaTime;
rb.AddForce(force);
float distance = Vector2.Distance(rb.position, path.vectorPath[currentWaypoint]);
if (distance < nextWayPointDistance)
44
{
currentWaypoint++;
}
if (force.x >= 0.01f)
{
enemySprite.localScale = new Vector3(-1f, 1f, 1f);
}
else if (force.x <= -0.01f)
{
enemySprite.localScale = new Vector3(1f, 1f, 1f);
}
45