kabaddi computer game - sfit.co.in

54
KABADDI COMPUTER GAME Submitted in partial fulfilment of the requirements Of the degree of B. E. Information Technology By NamrataGharat 08 Manish Shukla 48 Akshay Singh 51 Omkar Tamhankar 71 Supervisor(s): Ms.Nazneen Ansari Associate Professor Department of Information Technology St. Francis Institute of Technology (Engineering College) University of Mumbai 2016-2017

Upload: khangminh22

Post on 30-Jan-2023

0 views

Category:

Documents


0 download

TRANSCRIPT

KABADDI COMPUTER GAME

Submitted in partial fulfilment of the requirements

Of the degree of

B. E. Information Technology

By

NamrataGharat 08

Manish Shukla 48

Akshay Singh 51

Omkar Tamhankar 71

Supervisor(s):

Ms.Nazneen Ansari

Associate Professor

Department of Information Technology

St. Francis Institute of Technology

(Engineering College)

University of Mumbai

2016-2017

Abstract

Over the recent years, many sports based games have been developed for windows

machines and other devices. Kabaddi is one of the sports which had not been developed for

virtual gaming to a considerable extent. Till date, none of the major game developing

companies has considered Kabaddi as in virtual gaming. The aim of this project is to develop

game based on Kabaddi for windows machines. The game is developed with the help of Maya

LT 2016, Unity Game Engine, and other image editing tools.

“KabaddiKabaddi” is a 3D Sport based Game with Third person genre play mode. The

project would result in large scale promotion of Indian sports, also allowing physically disabled

people to have a fun-filled experience of playing such physical game virtually. Actions

involved in this game help the player visualize how the Kabaddi game is being played.

Therefore, the game Kabaddi will have huge scope ahead considering the popularity and based

on the fact that it has been invented in India.

Contents

Chapter Contents Page

No.

1 INTRODUCTION 1

1.1 Description 1

1.2 Problem Formulation 4

1.3 Motivation 4

1.4 Proposed Solution 5

1.5 Scope of the project 5

2 REVIEW OF LITERATURE 6

3 SYSTEM ANALYSIS 10

3.1 Functional Requirements 10

3.2 Non Functional Requirements 10

3.3 Specific Requirements 11

3.4 Use-Case Diagram and description 13

4 ANALYSIS MODELLING 15

4.1 Class Diagram 15

4.2 Sequence Diagram 16

4.3 Functional Modelling 17

4.4 TimeLine Chart 18

5 DESIGN 21

5.1 Architectural Design 21

5.2 User Interface Design 23

6 IMPLEMENTATION 24

6.1 Methodology 24

6.2 Code 28

7 TESTING 35

7.1 Test Cases 35

8 RESULTS AND DISCUSSION 36

9 CONCLUSIONS & FUTURE SCOPE 42

Literature Cited……………………………………………….....................................43

Acknowledgment……………………………………………......................................44

List of Figure

Fig. No. Figure Caption Page No.

1.1 Players 2

3.3 Use Case Diagram 13

4.1 Class Diagram 15

4.2 Sequence Diagram 16

4.3.1 Level 0 DFD 17

4.3.2 Level 1 DFD 17

4.3.3 Level 2 DFD 18

4.4.1 TimeLine Chart 18

4.4.2 Timeline Chart 19

5.1 Project Flow Diagram 21

5.3 User Interface 23

6.1.1 Cube Used in Maya Lt 24

6.1.2 Final preview of stadium in MAYA LT 25

vii

6.1.3 Character Preview in Maya Lt 25

6.1.4 Import Stadium in Unity 26

6.1.5 Importing Characters in Unity 26

6.1.6 Complete Assets in Unity 27

8.1 GUI 36

8.2 Kabaddi Game top view 36

8.3 Main game scene 37

8.4 Main game scene(Back View) 37

8.5 Player Attack Scene 38

8.6 Bots Approaching Player 38

8.7 Blue Players from Front View 39

8.8 Defence Stage Start View 39

8.9 Bot player approaching Blue team 40

8.10 Bot player trapped in Defence Stage 40

8.11 Blue Team Score Increment 41

viii

List of Tables

Table No. Table Title Page No.

2.1 Review Of Literature 7

3.1 Hardware Requirements 12

3.2 Software Requirements 12

3.3 Use Case Description 14

7.1 Test Cases 35

List of Abbreviations

Sr. No. Abbreviation Expanded form

i UI User Interface

ii DFD Data Flow Diagram

Iii GUI Graphical User Interface

ix

Chapter 1

Introduction

There are various sports based games available in the market and have gained lot of

popularity. However, Indian sports have not been under the lights of virtual gaming so far.

Instead of its popularity and trend of Kabaddi, there is no such complete game on it. Gaming

is one field which can promote a particular sport at a good rate.

Thus, with our project we developed a complete kabaddi game with features which

would be entertaining for the gamers as well as result in promotion of Indian Sports.

1.1 Description

1.1.1 Game flow:

When the game starts the player has to select whether player wants to raid or defend

first, along with the time mode i.e. 5/10/15 minutes. The raiding time is 30 seconds. There are

five players in each team.

If the player is raiding, the player has to touch opponent bots and cross the mid-line.

The player gains point if he touches one or more defenders and crosses the mid-line. If the

player is unable to touch any of the defenders and return back within 30 seconds, the

opponent gets a point.

If the player is defending, it has to grab the opponent bot raider in order to score a

point before it crosses the mid-line. After the time finishes, the team with more points is the

winner.

Chapter 1 Introduction

2

1.1.2 Game Bible

Figure 1.1: Player Blue

Blue player or the raid player- This player can move across the stadium through the controls

A, W, S, and D (move left, move ahead, move right, move backward). It can jump to the

midline of the stadium using the spacebar key. It also touches the opponent’s body using its

hand. The control key assigned for the same is by pressing left mouse click.

1.1 Description

3

Figure 1.2: Player Red

Red player or the bot player- The red player gradually moves towards the blue player, when

the blue player comes in vicinity of the red player. The red player grabs the blue player with

upper body grab during Raid phase and tries to approach and touch blue players during

Defencephase.

Chapter 1 Introduction

4

1.2 Problem Formulation

To create a stand-alone Kabaddi game that works efficiently on Windows machines.

The game-area based on Kabaddi itself makes the project unique considering the facts about

the virtual Kabaddi game. This sport hasn’t been under the lights of virtual gaming to a

considerable extent instead of its popularity of the sport. Certain Android based Kabaddi

games are available in the market, however they are not complete and analogous to the real

Kabaddi game, thereby resulting in loss of interest of the gamer.

DesiAdda Gaming Organization had introduced the kabaddi game in their project of

‘Games of India’ for PSP gaming, but it wasn’t as successful in the Indian markets as it was

supposed to be. Also, PSP and PS2 are not affordable to each and every person.

Indian sports are not being considered in the field of virtual gaming compared to other

sports till now, irrespective of its popularity. Also, every person is not able to go out and play

Kabaddi in real scenario.

1.3 Motivation

The motivation was to create an Indian sport game, which works efficiently on

Windows machines. This sport hasn’t been under the lights of virtual gaming to a

considerable extent instead of the popularity of the sport. DesiAdda Gaming Organization had

introduced the Kabaddi game in their project of ‘Games of India’ for PSP gaming, but it

wasn’t a hugehitin the Indian markets at the expected level.

Also, games based on sports can bring up the joy and experience to the handicapped

gamers. So a simple Indian sport based game which is popular could be a good treat for all

gamers. Also, a simple game results in less cost as it would be compatible on all the computer

machines with lower configuration. The limitation of this game is that the players are not

incorporated with all the actions as seen in the real Kabaddi game.

1.4 Proposed Solution

5

1.4Proposed solution

We developed a Kabaddi game for Windows machines using Unity Game engine and

Maya Lt 2016. A complete game with more features would be more entertaining for the

gamers. Also, promotion of Indian sports in the field of virtual gaming can be achieved with

the fulfilment of this project.

Almost, everyone have computers and thus no extra cost for any device will be

incurred to play the game. Thus, it is affordable to everyone. Around 62% of handicapped

people enjoy playing games on computers and other devices. With such sports based game,

they can have a good experience to play a sport like Kabaddiin a virtual world.

1.5Scope of project

Kabaddi is presently a trending sport so game based on Kabaddi sport will draw huge

attention of the gamers.

Kabaddi sport got very famous in India after its huge success of Pro

Kabaddi,aKabaddi tournament. Pro Kabaddi is a popular sports event which was

launched by Star Channel.

Many well developed games for cricket and football has been released worldwide but

there is not even a single full-fledged Kabaddi game launched yet.

Kabaddi cannot be played by children and old aged people and therefore to enjoy the

Kabaddi sport, the game will be developed by us can bring the actual feeling and joy

out of them.

After the completion of the project in near future, professional developers can seek

interest and make the game more realistic and appealing.

Chapter 2

Review of Literature

Review of literature is an evaluative report of information found in the literature related to

selected area of study. We reviewed about 18 to 20 research papers and made use of papers

which were relevant to our project in developing strategies and implementation planning. All

papers related to gaming, virtual sports from the year 2007 till 2012 where reviewed and

following are the tabular description of papers related to our project. Papers listed over here

are published in highly popular journal/conferences like Springer Publications and IEEE.

Table 2.1: Review of Literature

Paper Title Author Published in Year Highlights

Video Games

Genres

Ted Stahl 2005 This paper mentions about the

versatility of video genres

present in the gaming market.

Shooter is a type of video

genre where the only aim of

the player to destroy the

opponents. In addition to

shooter, first-person shooter

visualizes the player into an

environment where the player

attacks its opponent enemies.

Computer Gaming

and New Media

Culture

JohhanesFromme,

Alexandar Unger

2012 This paper mentions about the

fears originated due to deep

diving into the realms of

internet computer games.

According to the game

developers, these games are

made to enhance the skills of

the gamer and also the

aptitude.

Chapter 2 Review of Literature

7

Applications

between sport

management and

game theory: A

case study on 21st

Summer

Deaflympics

Hochengchou,

ChihChen Hsiao

2010 In a multi-choice game each

player has several activity

levels. Hence, multi-choice

games constitute a

generalization of standard

coalition TU games. In a

traditional TU game, each

player is either fully

involved or not involved at

all in participation with

some other agents, while in

a multi-choice TU game,

each player is allowed to

participate with finite many

different activity levels.

Advanced

Intelligent

Paradigms in

Computer Games

Norio Baba, Lakhmi

C. Jain, HisashiHanda

2007 The evolution of

technologies has greatly

changed the basic structure

of our industry and nature

of our daily lives. Industries

which did not exist several

decades ago have made

remarkable progress in

recent years and

flourishedintelligence

techniques and internet

technology in computer

games.

Chapter 2 Review of Literature

8

Serious Sports:

Game-Based

Learning in Sports

MajaPivec, Benjamin

Hable,

DarraghCoakley

2011 All tested games have

shown potential to be used

either for

formal or informal sport

related learning of different

Competences. Different

sports games could be used

as an

Introduction to activities,

without the requisites, such

asequipment or location.

The rules of a sport could

be illustratedwith the game,

before entering the actual

environment for the

First time.

Artificial

Intelligence

for Computer

Games

Pedro Antonio

González-Calero,

Marco Antonio

Gómez-Martín

2011 Much research on artificial

intelligence in games has

been devoted to creating

opponents that play

competently against human

players, while an alternative

goal is to try to deliver the

best possible experience

within the context of the

game. This novel goal is

much more attainable by

approaching AI reasoning

for games as “storytelling

reasoning.”

Chapter 2 Review of Literature

9

Game based

approach to learn

Martial Arts

forbeginners

ConnsynnChye,

TatsuoNakajima

2012 Long hours of

training are required

to achieve perfect

motion in certain

sports such as martial

arts and dance. In this

paper, we are trying

to develop a game-

based learning

system for martial

arts that required

emphasis of gesture

movement with the

aid of Kinect sensor.

Emergence of

controller-less

sensors in gaming

industry was said to

exhibit the potential

of bringing joy and

fun to teach.

Chapter 3

System Analysis

System Analysis is process of identifying certain aspects of project with reference to the

complete system. Here, we defined the functional, non-functional and technical (hardware and

software) requirements of our project. Also, Use-case for the system is defined and useful in

development of system.

3.1 Functional Requirement:

1. Game Working:The game should work in correct flow, starting from selecting

game modes to playing of actual game.

2. Game Controls: The game should have user-friendly controls for every specified

action.

3. Game handling: Game should work properly after taking inputs for modes and

play controls at any point of time.

4. Support various versions: Game should run on various versions of Windows.

3.2 Non Functional Requirement:

1. Availability: The game should be available for various versions.

2. Reliability: Proper controlling and handling should be provided for providing

good gaming experience.

3. Scalability:Providing multiple inputs through controls during the game should not

result in any sort of hang or lag.

4. Maintainability: Game should be developed in a way that is easy to understand

and maintain.

3.3 Specific Requirements

11

3.3 Specific Requirements (Hardware and software requirements)

3.3.1 Technical Feasibility

Hardware Requirements

Processor : 1 gigahertz (GHz) or faster 32-bit or 64-bit processor

RAM : 2 GB RAMDDR3 or more

Hard Disk : 20 GB available hard disk space

Display Driver : DirectX 11 graphics driver.

Software Requirements

Operating System: Windows 7/8/8.1/10

Maya Lt 2016

Unity Game Engine

Maya LT 2016

Maya LT is a 3D modeling and animation tool, offering a powerful set of creative tool

and workflows.

It lets you model, texture, light and animate 3D characters and environments for your

game.

Features:

Maya LT lets you create efficient 3D models for better performance.

Maya LT lets you create and transfer level of detail data for 3D game assets.

Maya LT animation tools help indie game artists bring life to their characters and

environments to create more vibrant, dynamic games.

Maya LT includes global illumination, material modelling and texture baking tools

that help make the less glamorous parts of the 3D creative process easier for game

makers.

Unity Game Engine

Unity is a cross-platform game engine developed by Unity Technologies and it is used to

develop video games for PC, consoles, mobile devices and websites.

Features:

Excellent balance of ease of use and power.

Performance scales extremely well from simple games for low end mobile to complex

games for high end consoles.

Built in physical based rendering and extendable rendering pipeline all very high end

graphics performance.

Workflows support 2D, 3D and hybrid games effortlessly.

C# and JavaScript is an expressive and powerful programming language that is

relatively easy to learn.

Built in Mechanism animation system is very powerful, lets you drive any value with

animation.

Chapter 3 System Analysis

12

3.3.2 Economic Feasibility

Hardware Requirements

Table 3.1: Hardware Requirements

Requirements Details Cost

Processor Core 2 Duo E8400 799/-

RAM 2GB 999/-

Hard Disk 80GB 950/-

Display Driver DirectX 9 Free

Total Cost: Around 2750 /-

Software Requirements

Table 3.2: Software Requirements

Requirements Details Cost

Windows OS 7 or higher Freely available

3.4 Use-Case diagram and Description

13

3.4 Use-Case Diagram and description

Figure 3.3: Use Case diagram

Use case diagrams are usually referred to as behaviour diagrams used to describe a set of

actions (use cases) that some system or systems (subject) should or can perform in

collaboration with one or more external users of the system (actors). Each use case should

provide some observable and valuable result to the actors or other stakeholders of the system.

Use case diagrams are in fact twofold – they are both behaviour diagrams, because they

describe behaviour of the system, and they are also structure diagrams– as a special case of

class diagrams where classifiers are restricted to be either actors or use cases related to each

other with associations.

Chapter 3 System Analysis

14

Use case diagrams are used to specify:

External requirements, required usages of a system under design or analysis (subject) – to

capture what the system is supposed to do.

The functionality offered by a subject – what the system can do.

Requirements the specified subject poses on its environment– by defining how

environment should interact with the subject so that it will be able to perform its services.

Below given is detailed study of the Use-Case Diagram for Kabaddi Computer Game

Table 3.4: Use Case Description

Use Case Kabaddi Computer Game

Primary Actor Player

Goal in Context Allows the Player to enter Game options and play the game

Preconditions Bot players and user should be ready to play

Trigger On tracking player moves, bot could perform game actions.

Scenario User observes the bot moves and performs accordingly.

Priority Essential for gameplay.

Secondary Actor System(Bot)

Exception

condition

Unless the moves are tracked, no action is performed.

Chapter 4

Analysis Modelling

Analysis Modelling is representing project in diagrammatic format using different UML

diagrams. It is used to show different entities in project and the relationship between them.

Also, the timeline chart for the project implementation is developed for proper work-flow of

project.

4.1 Class Diagram:

Figure 4.1: Class diagram

Class Diagram provides an overview of the target system by describing the objects and

classes inside the system and the relationships between them. It provides a wide variety of

usages; from modelling the domain-specific data structure to detailed design of the target

system. With the share model facilities, you can reuse your class model in the interaction

diagram for modelling the detailed design of the dynamic behaviour. The Form Diagram

allows you to generate diagram automatically with user-defined scope.

Chapter 4 Analysis Modelling

16

Our System has player and bot as main class or entity. The player has a name and belongs to

team. It has controls to start game and play. The bot also belongs to the opposite team and

responses to the player moves.

4.2 Sequence Diagram

Figure 4.2: Sequence diagram

A sequence diagram shows object interactions arranged in time sequence. It depicts the

objects and classes involved in the scenario and the sequence of messages exchanged between

the objects needed to carry out the functionality of the scenario. Sequence diagrams are

typically associated with use case realizations in the Logical View of the system under

development. Sequence diagrams are sometimes called event diagrams or event scenarios.

4.3 Functional Modelling

17

4.3 Functional Modelling

Context level DFD/ Level-0 DFD:

Figure 4.3.1: Level-0 DFD

In this level 0 data flow diagram, the whole system is represented with the help of input,

processing and output. The input to the Game system is the process of player selecting options

and making game moves. The game system gives response for the moves in the game.

Level 1 DFD:

Figure 4.3.2: Level-1 DFD

In level 1 data flow diagram, the game flow is explained in further details. Initially, the player

starts the game by providing input for game mode, team and time. Then the game starts and

the result is obtained at the end of time.

Chapter 4 Analysis Modelling

18

Level 2 DFD:

Figure 4.3.3: Level-2 DFD

In the level 2 data flow diagram, the game play is described more precisely. The phases in the

game are described.

4.4 TimeLine Charts

Figure 4.4.1(a): Semester VII Timeline Chart

4.4 Timeline Chart

19

Figure 4.4.1(b): Semester VII Timeline Chart

Figure 4.4.2(a): Semester VIII Timeline Chart

Chapter 4 Analysis Modelling

20

Figure 4.4.2(b): Semester VIII Timeline Chart

Figure 4.4.2(c): Semester VIII Timeline Chart

The timeline chart is developed using WBS application software which covers various tasks in

project. The tasks were completed according to the schedule.

Chapter 5

Design

In this chapter, the implementation tasks and output is being described. The stages of design of

project and other tasks are included in a flowchart. This helps to work in the project

sequentially with all tasks performed rightly.

5.1Architectural Design of Kabaddi Computer Game

Figure 5.1: Project Flow diagram

The major tasks in project were game design and implementation. The game design is

performed using two main software i.e. Maya LT and Unity Game Engine. Stadium

and character making is done in Maya LT software. The collaboration of entities and

control definition is done using Unity Game Engine.

Requirements: The required software is Unity Game Engine and Maya Lt, which

needs to be installed on the desktop/computer.

Game Design: It consists of designing all the characters (blue and red players) and the

stadium in which Kabbadi is tobe played. This work of designing is done in Maya Lt.

Chapter 5 Design

22

Modelling: It is the process of developing a mathematical representation of any

three dimensional surface of an object via specialized software (in this project it’s

Maya Lt).

Rigging: It is the process of creating a skeleton for a 3D model so it can move.

Animation: It is the method of giving actions to the respective players, which

consist of walking, moving left etc.

Texturing: The object which is created after the process of rigging is given a

texture, which is combination of different colours to different parts of an object.

Shading: It is a collection of connected rendering nodes that defines how colours

and textures contribute to the final look of an object.

Importing entities: The characters along with their respective animation made in Maya

Lt are being imported to Unity Game Engine.

Control Logic: Here the players imported are assigned keyboard key controls so that

they can move around the stadium.

Implementation: The characters imported are programmed with Artificial Intelligence

functions so that the raid and defence phase takes place.

Integration: Different scenes created in Unity Game Engine i.e. Game Over Screen,

Start Screen, Raid Scene are being merged to function as full complete game.

5.2 User Interface Design

23

5.2 User Interface Design

Figure 5.2: User Interface

This is the first screen in game for user input. The player has to select the time and option

(raid/defence) is to be selected. The player clicks on select to start the game.

Chapter 6

Implementation

In implementation phase, characters and stadium isdeveloped in Maya LT and later imported

to Unity Game Engine. After integration of the above work, controls and logic of the game is

defined using the logic stated below in Unity Game Engine.

6.1 Methodology Used

In Maya Lt, we developed characters and the stadium for the Kabaddi Game. The starting

stage for any development is with cube.

Fig 6.1.1 Cube used in MAYA LT

6.1 Methodology Used

25

Fig 6.1.2 Final preview of stadium in MAYA LT

Fig 6.1.3 Character Preview in MAYA LT

Chapter 6 Design

26

Initially we imported all the developed entities of MAYA Lt in the Unity game engine. The

import process is simply done with drag and drop process from one source window to unity

assets window.

Fig 6.1.4 Imported the stadium in Unity Engine

Fig 6.1.5 Imported the character in Unity Engine

6.1 Methodology Used

27

Fig 6.1.6 Complete importing of all Assets in Unity Game Engine

Chapter 6 Design

28

6.2 Code

Code for Main Start Screen:

This code is about how the Start Screen is implemented and also about the control and

movements of the player.

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class start : MonoBehaviour {

public void onclickpause()

{

Application.LoadLevel ("animationdone");

}

}

Code ForPlayer Control:

using UnityEngine;

namespace UnityStandardAssets.Characters.ThirdPerson

{

[RequireComponent(typeof(Rigidbody))]

[RequireComponent(typeof(CapsuleCollider))]

[RequireComponent(typeof(Animator))]

public class ThirdPersonCharacter : MonoBehaviour

{

[SerializeField] float m_MovingTurnSpeed = 360;

[SerializeField] float m_StationaryTurnSpeed = 180;

[SerializeField] float m_JumpPower = 12f;

[Range(1f, 4f)][SerializeField] float m_GravityMultiplier = 2f;

[SerializeField] float m_RunCycleLegOffset = 0.2f; //specific to the character in sample assets, will need to

be modified to work with others

[SerializeField] float m_MoveSpeedMultiplier = 1f;

[SerializeField] float m_AnimSpeedMultiplier = 1f;

[SerializeField] float m_GroundCheckDistance = 0.1f;

Rigidbody m_Rigidbody;

Animator m_Animator;

bool m_IsGrounded;

float m_OrigGroundCheckDistance;

const float k_Half = 0.5f;

float m_TurnAmount;

float m_ForwardAmount;

Vector3 m_GroundNormal;

float m_CapsuleHeight;

Vector3 m_CapsuleCenter;

CapsuleCollider m_Capsule;

bool m_Crouching;

void Start()

{

m_Animator = GetComponent<Animator>();

m_Rigidbody = GetComponent<Rigidbody>();

m_Capsule = GetComponent<CapsuleCollider>();

m_CapsuleHeight = m_Capsule.height;

m_CapsuleCenter = m_Capsule.center;

m_Rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotatio

nY | RigidbodyConstraints.FreezeRotationZ

m_OrigGroundCheckDistance = m_GroundCheckDistance;

6.2 Code

29

}

public void Move(Vector3 move, bool crouch, bool jump)

{

// convert the world relative moveInput vector into a local-relative

// turn amount and forward amount required to head in the desired

// direction.

if (move.magnitude > 1f) move.Normalize();

move = transform.InverseTransformDirection(move);

CheckGroundStatus();

move = Vector3.ProjectOnPlane(move, m_GroundNormal);

m_TurnAmount = Mathf.Atan2(move.x, move.z);

m_ForwardAmount = move.z;

ApplyExtraTurnRotation();

// control and velocity handling is different when grounded and airborne:

if (m_IsGrounded)

{

HandleGroundedMovement(crouch, jump);

}

else

{

HandleAirborneMovement();

}

ScaleCapsuleForCrouching(crouch);

PreventStandingInLowHeadroom();

// send input and other state parameters to the animator

UpdateAnimator(move);

}

void ScaleCapsuleForCrouching(bool crouch)

{

if (m_IsGrounded && crouch)

{

if (m_Crouching) return;

m_Capsule.height = m_Capsule.height / 2f;

m_Capsule.center = m_Capsule.center / 2f;

m_Crouching = true;

}

else

{

Ray crouchRay = new Ray(m_Rigidbody.position + Vector3.up * m_Capsule.radius * k_Half, Vector3

.up);

float crouchRayLength = m_CapsuleHeight - m_Capsule.radius * k_Half;

if (Physics.SphereCast(crouchRay, m_Capsule.radius * k_Half, crouchRayLength, Physics.AllLayers,

QueryTriggerInteraction.Ignore))

{

m_Crouching = true;

return;

}

m_Capsule.height = m_CapsuleHeight;

m_Capsule.center = m_CapsuleCenter;

m_Crouching = false;

}

}

Chapter 6 Design

30

void PreventStandingInLowHeadroom()

{

// prevent standing up in crouch-only zones

if (!m_Crouching)

{

Ray crouchRay = new Ray(m_Rigidbody.position + Vector3.up * m_Capsule.radius * k_Half, Vector3

.up);

float crouchRayLength = m_CapsuleHeight - m_Capsule.radius * k_Half;

if (Physics.SphereCast(crouchRay, m_Capsule.radius * k_Half, crouchRayLength, Physics.AllLayers,

QueryTriggerInteraction.Ignore))

{

m_Crouching = true;

}

}

}

void UpdateAnimator(Vector3 move)

{

// update the animator parameters

m_Animator.SetFloat("Forward", m_ForwardAmount, 0.1f, Time.deltaTime);

m_Animator.SetFloat("Turn", m_TurnAmount, 0.1f, Time.deltaTime);

m_Animator.SetBool("Crouch", m_Crouching);

m_Animator.SetBool("OnGround", m_IsGrounded);

if (!m_IsGrounded)

{

m_Animator.SetFloat("Jump", m_Rigidbody.velocity.y);

}

// calculate which leg is behind, so as to leave that leg trailing in the jump animation

// (This code is reliant on the specific run cycle offset in our animations,

// and assumes one leg passes the other at the normalized clip times of 0.0 and 0.5)

float runCycle =

Mathf.Repeat(

m_Animator.GetCurrentAnimatorStateInfo(0).normalizedTime + m_RunCycleLegOffset, 1);

float jumpLeg = (runCycle < k_Half ? 1 : -1) * m_ForwardAmount;

if (m_IsGrounded)

{

m_Animator.SetFloat("JumpLeg", jumpLeg);

}

// the anim speed multiplier allows the overall speed of walking/running to be tweaked in the inspector,

// which affects the movement speed because of the root motion.

if (m_IsGrounded && move.magnitude > 0)

{

m_Animator.speed = m_AnimSpeedMultiplier;

}

else

{

// don't use that while airborne

m_Animator.speed = 1;

}

}

void HandleAirborneMovement()

{

// apply extra gravity from multiplier:

Vector3 extraGravityForce = (Physics.gravity * m_GravityMultiplier) - Physics.gravity;

m_Rigidbody.AddForce(extraGravityForce);

m_GroundCheckDistance = m_Rigidbody.velocity.y < 0 ? m_OrigGroundCheckDistance : 0.01f;

}

6.2 Code

31

void HandleGroundedMovement(bool crouch, bool jump)

{

// check whether conditions are right to allow a jump

if (jump && !crouch && m_Animator.GetCurrentAnimatorStateInfo(0).IsName("Grounded"))

{

// jump!

m_Rigidbody.velocity = new Vector3(m_Rigidbody.velocity.x, m_JumpPower, m_Rigidbody.velocity

.z);

m_IsGrounded = false;

m_Animator.applyRootMotion = false;

m_GroundCheckDistance = 0.1f;

}

}

void ApplyExtraTurnRotation()

{

// help the character turn faster (this is in addition to root rotation in the animation)

float turnSpeed = Mathf.Lerp(m_StationaryTurnSpeed, m_MovingTurnSpeed, m_ForwardAmount);

transform.Rotate(0, m_TurnAmount * turnSpeed * Time.deltaTime, 0);

}

public void OnAnimatorMove()

{

// we implement this function to override the default root motion.

// this allows us to modify the positional speed before it's applied.

if (m_IsGrounded && Time.deltaTime > 0)

{

Vector3 v = (m_Animator.deltaPosition * m_MoveSpeedMultiplier) / Time.deltaTime;

// we preserve the existing y part of the current velocity.

v.y = m_Rigidbody.velocity.y;

m_Rigidbody.velocity = v;

}

}

void CheckGroundStatus()

{

RaycastHit hitInfo;

#if UNITY_EDITOR

// helper to visualise the ground check ray in the scene view

Debug.DrawLine(transform.position + (Vector3.up * 0.1f), transform.position + (Vector3.up * 0.1f) + (V

ector3.down * m_GroundCheckDistance));

#endif

// 0.1f is a small offset to start the ray from inside the character

// it is also good to note that the transform position in the sample assets is at the base of the character

if (Physics.Raycast(transform.position + (Vector3.up * 0.1f), Vector3.down, out hitInfo, m_GroundChec

kDistance))

{

m_GroundNormal = hitInfo.normal;

m_IsGrounded = true;

m_Animator.applyRootMotion = true;

}

else

{

m_IsGrounded = false;

m_GroundNormal = Vector3.up;

m_Animator.applyRootMotion = false;

Chapter 6 Design

32

}

}

}

}

Code For Bot Player(AI):

This code is about how the bot player responds to the movement of the opposition player

movements and actions.

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class chase : MonoBehaviour {

public Transform player;

static Animator anim;

// Use this for initialization

void Start () {

anim = GetComponent<Animator> ();

}

// Update is called once per frame

void Update () {

if (Vector3.Distance (player.position, this.transform.position) < 5) {

Vector3 direction = player.position - this.transform.position;

direction.y = 0;

this.transform.rotation = Quaternion.Slerp (this.transform.rotation, Quaternion.LookRotation (direction),

0.1f);

anim.SetBool ("IsIdle", false);

if (direction.magnitude > 2) {

this.transform.Translate (0, 0, 0.05f);

anim.SetBool ("IsWalk", true);

anim.SetBool ("IsGrab", false);

} else {

anim.SetBool ("IsGrab", true);

anim.SetBool ("IsWalk", false);

}

}

else {

anim.SetBool ("IsIdle", true);

anim.SetBool ("IsWalk", false);

anim.SetBool ("IsGrab", false);

}

}

}

Code for Score Point:

This code is about how the score of an individual team is calculated on the basis of enemy

player touching user player or vice versa.

using System;

usingUnityEngine;

usingUnityStandardAssets.CrossPlatformInput;

usingSystem.Collections;

usingUnityEngine.UI;

6.2 Code

33

namespaceUnityStandardAssets.Characters.ThirdPerson

{

[RequireComponent(typeof (ThirdPersonCharacter))]

public class ThirdPersonUserControl : MonoBehaviour

{

privateThirdPersonCharacterm_Character; // A reference to the ThirdPersonCharacter on the

object

private Transform m_Cam; // A reference to the main camera in the scenes

transform

private Vector3 m_CamForward; // The current forward direction of the camera

privateVector3 m_Move;

private bool m_Jump; // the world-relative desired move direction, calculated

from the camForward and user input.

staticint count=0;

staticintrcount=0;

private bool r1;

private bool r2;

private bool r3;

private bool r4;

private bool r5; private bool t;

public Text counttext;

publicintTimeLeft = 30;

public Text Timer;

private void Start()

{ r1 = false;r2 = false;r3 = false;r4 = false;r5 = false;

t = false;

SetCountText ();

StartCoroutine ("Ls");

// get the transform of the main camera

if (Camera.main != null)

{

m_Cam = Camera.main.transform;

}

else

{

Debug.LogWarning(

"Warning: no main camera found. Third person character needs a

Camera tagged \"MainCamera\", for camera-relative controls.",gameObject);

// we use self-relative controls in this case, which probably isn't what the user

wants, but hey, we warned them!

}

// get the third person character ( this should never be null due to require component )

m_Character = GetComponent<ThirdPersonCharacter>();

}

private void Update()

{

Timer.text = ("Time Left:" +TimeLeft);

if (TimeLeft<= 0) {

StopCoroutine ("Ls");

Timer.text = "Time Up";

if (t == true) {

rcount = rcount + 1;

}

Chapter 6 Design

34

Newl();}

}voidOnTriggerEnter(Collider other) {

if (other.gameObject.CompareTag("r1t"))

{

r1 = true; t=true;

}

if (other.gameObject.CompareTag("r2t"))

{

r2 = true; t=true;

}

if (other.gameObject.CompareTag("r3t"))

{

r3=true;t=true;

}

if (other.gameObject.CompareTag("r4t"))

{

r4 = true; t=true;

}

if (other.gameObject.CompareTag("r5t"))

{

r5 = true; t=true;

}

if (other.gameObject.CompareTag("line"))

{ SetCountText ();

Newl();

}

} void SetCountText ()

{ if (r1 == true)

{ count=count+1;}

if (r2 == true)

{ count=count+1;}

if (r3 == true)

{ count=count+1;}

if (r4 == true)

{ count=count+1;}

if (r5 == true)

{ count=count+1;}

counttext.text = "Team Blue : " + count.ToString () + " Team Red : " +

rcount.ToString (); }

voidNewl()

{ Application.LoadLevel("try1");

}

}

Chapter 7

Testing

7.1 Test Cases

Table 7.1: Test Cases

Test

Case

ID

Module Test Data Expected results Actual results

1. Start Game Click Play Game New game should start from a new

scene.

New game starts from a new scene.

2. Move player Movement Arrow keys move player accordingly.

Arrow keys move player accordingly.

3 Game Over

Resume to the current level.

The current level is loaded.

The current level is loaded.

4 Score Score Increases when the

raid or defence takes place.

Increases when the raid or defence

takes place.

5 Game Over Time is over. End Game. End Game.

6 Quit Click Quit Exit Game

Exit Game.

7 Time Click on Time(5,10,15 minutes)

Game starts with the selected timer.

Game starts with the selected timer.

Chapter 8

Results and Discussion

Figure 8.1 GUI

Figure 8.2 Kabaddi game top view

Chapter 8 Results and Discussion

37

Figure 8.3 Main Scene

Figure 8.4 Raid Mode

Chapter 8 Results and Discussion

38

Figure 8.5 Bots approaching player

Figure 8.6 Blue Players from Front View

Chapter 8 Results and Discussion

39

Figure 8.7 Defence Phase Start Stage

Figure 8.8 Red Bot approaching Blue Players (Defence Phase)

Chapter 8 Results and Discussion

40

Figure 8.9 Red Bot trapped between Blue Players (Defence Phase)

Figure 8.10 Score Increment (Defence Phase)

Chapter 8 Results and Discussion

41

Figure 8.11 Game Over Screen with Final Score

Chapter 9

Conclusion and Future Scope

We implemented an action based game i.e. “KabaddiKabaddi” which truly reflects the

Kabaddi game, in the sense of being seen on the Televisions by the public around the world

and watched by the spectators live on the stadium. Especially, the game was developed

keeping in mind about the drawbacks of the available games in the market.

Some of the drawbacks were the game present in the Android Market is a simple 2D game,

which doesn’t replicates the gameplay of the Kabaddi game. The graphics were too simple

making the gamer feel like the game is very monotonous and thereby resulting into the loss of

interest of many gamers who would actually like to play the Kabaddi based game.

This game was developed keeping in mind about various facts like cost involved in building

the entire game and the way how gamers would be able to relate and enjoy the gameplay of

this game as compared to the real Kabaddi game. DesiAdda: Games of India, who had

launched their collection of video games (which included Kabaddi Game as well) in the

market for PlayStation Network, had only limitation that the games would run on PlayStation

2.

Thus, by development of this game all the gamers in the world with minimal set of computer

configuration will be able to play this game. In addition to the current game features and

actions like hand-touch for the raiding part, we aim to add further kabaddi game actions like

leg-touch, upper body grab in the developed game, thus making it one of the huge game hits

in the gaming market.

Future Scope:

1. Creating more advanced movements or actions.

2. Adding more player models.

3. Adding different stadium and audience variant.

4. Adding more Strategy Logic.

Literature Cited

[1]Hochengchou, Chih Chen Hsiao, “Applications between sport management and game

theory”, IEEE, 2010.

[2]JohhanesFromme, Alexandar Unger, “Computer Gaming and New Media Culture”,

Springer, 2012.

[3]Norio Baba, Lakhmi C Jain,”Advanced Intelligent Paradigms in Computer Games”,

Springer ,2007.

[4]ConnsynnChye, Tatsuo Nakajima,”Game based approach to learn Martial Arts for

beginners”, IEEE, 2012.

[5]Marco Antonio, “Artificial Intelligence for Computer Games”, Springer, 2011.

[6]Ted Stahl, “Video Games Genres”, IRMA,2005.

[7]MajaPivec, Benjamin Hable, DarraghCoakley, “Serious Sports: Game-Based Learning in

Sports”, IEEE, 2011.

Websites: http://www.giantbomb.com/profile/wehrmacht/lists/games-using-unreal-engine-

4/85929/

http://staraban.com/en/undeal-engine-4-overview-features-cons-and-pros/

Game Architecture and Design By Andrew Rollings& Dave Morris

https://www.researchgate.net/publication/282185969_Game_Design_Research

Acknowledgement

We hereby take the privilege to present our project report on “Kabaddi Computer Game”.

We are very grateful to our Project Supervisor Ms.Nazneen Ansari for guiding us and

providing support in project development process throughout the entire Semester.

Our Special thanks to Ms.Prajyoti Lopes&Ms.PurnimaKubde for providing valuable inputs

on our project.

Our special thanks to our Director Bro. Tom Melchior, Our Head of Department Ms Joanne

Gomes, staff members and lab assistants for their co-operation.

Many people, especially our classmates, have made valuable contribution in building up our

project.

33