DEFENCE OF THE ANCIENTS

Transcription

DEFENCE OF THE ANCIENTS
DEFENCE OF THE ANCIENTS
Assignment submitted in partial fulfillment
of the requirements for the degree of
MASTER OF TECHNOLOGY
in
Computer Science & Engineering
by
SURESH P
Entry No. 2014MCS2144
TANMAY GUPTA
Entry No. 2014MCS2145
Under the guidance of
Dr. HUZUR SARAN
Department of Computer Science and Engineering,
Indian Institute of Technology Delhi.
November 2014.
Certificate
This is to certify that the assignment 3 DOTA Game being submitted by
Suresh P and Tanmay Gupta as a part of the course CSP701 in Computer Science & Engineering is a record of bona fide work carried out
by them under my guidance and supervision at the Department of Computer Science & Engineering. The work presented in this assignment
has not been submitted elsewhere either in part or full, for the award of any
other degree or diploma.
Dr. Huzur Saran
Department of Computer Science and Engineering
Indian Institute of Technology, Delhi
Abstract
The DOTA game is a strategy game which can be played as a multiplayer
over the network or as a single player where the number of human players can
be between 1 and 4. Rest of the players will be BOT . The 4 players will be
divided into two teams (with 2 players in each team) namely Galacticos and
Aracadians. Each of these teams defends their own regions as well as their
temple and the team that is first successful to destroy the enemy team’s Temple wins the game. Whole game depends on the hero and strategy choosen
by the player that either to attack the temple or destroy the temple.
Each hero has some attributes different from the other which make the
game unique and there are items in the map to increase the ability.The game
screen is divided horizontally into two parts. One of the parts contains the
map and the other part displays the details about the player. The second
part also contains details about the opposing player(s) including the image
of the hero, its abilities and health.
Acknowledgments
First and foremost, we thank to the Power of Almighty for showing us inner
peace and for all blessings. Special gratitude to our Parents, for showing
their support and love always. We like to acknowledge the constant support
provided by the Course Coordinator Dr. Huzar Saran for his consistent
motivation in pursuing our project.
We express our sincere thanks to our seniors for providing us their valuable
guidance, untiring patience and diligent encouragement during the entire
span of this project.
We extend our gratitude to our friends especially Kaleeswaran and we feel
proud in sharing this success with friends, who helped directly or indirectly
in completing this project successfully.
SURESH P (2014MCS2144)
TANMAY GUPTA (2014MCS2145)
Contents
1 Introduction
1
2 User Interface
2
3 Map
4
4 Hero
6
5 Item
7
5.1
Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7
5.2
Magical Powers . . . . . . . . . . . . . . . . . . . . . . . . . .
9
6 Game
10
6.1
Game play . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
6.2
BOTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
7 Conclusion
13
List of Figures
2.1
Hero selection . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1
Game screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
c 2014, Indian Institute of Technology Delhi
3
List of Tables
5.1
Magical Power . . . . . . . . . . . . . . . . . . . . . . . . . . .
9
Chapter 1
Introduction
The DOTA game is a strategy game which can be played as a multiplayer
over the network or as a single player where the number of human players
can be between 1 and 4. Rest of the players are BOT . The 4 players are
divided into two teams (with 2 players in each team) namely Galacticos
and Aracadians. Each of these teams defends their own regions as well as
their temple and the team that is first successful to destroy the enemy team’s
Temple wins the game. Whole game depends on the hero and strategy chosen
by the player that either to attack the temple or destroy the temple.The game
is designed in C++ and OpenGL, features of OpenGL is used to provide game
graphics and also handling the mouse and keyboard.
Each hero has some attributes different from the other which make the
game unique and there are items in the map to increase the ability.The game
screen is divided horizontally into two parts. One of the parts contains the
map and the other part displays the details about the player. The second
part also contains details about the opposing player(s) including the image
of the hero, its abilities and health.
User Interface is provided to allow user to pick his team and also the hero
from the selected list of player. The user makes choices in the menus to pick
his team and hero.
c 2014, Indian Institute of Technology Delhi
Chapter 2
User Interface
DOTA game is played either as a single player game or multiplayer game.
In both the format it requires lot of interactivity with the user. Interactivity
is provided through keyboard and mouse. Right from the beginning of the
game, a game selection prompt is there which allows user to play game either
as a single player or multi player. User can go through the menu either
through the mouse or by use of keyboard
If user selects the multiplayer game he has the option to create server or to
join the existing server. If user joins the game a menu is displayed in which
he can enter the IP address of the server to whom he wants to connect to
in order to join the game this input is taken through the keyboard. He can
enter the game then by pressing enter.
At any stage if user wants to go to the main menu, he can do so by clicking
on the main menu button provided in every screen. Through main menu user
can quit the game by clicking exit button or by pressing ESC key.
Once user has entered into the game he can select team of his choice by
clicking on the team icon. After that user is redirected to the Hero selection
screen through which he can select the hero of his choice by simply clicking on
the desired hero. Hero selection screen is divided horizontally to allow user
to see the detail of each hero and accordingly a user can select his favourite
Hero by comparing them through there ability and type.
In the game user interacts with the game through both mouse and keyboard. User can move within the map through Right mouse click and can
attack enemy team or temple and pick item through left mouse click. A user
c 2014, Indian Institute of Technology Delhi
3
Figure 2.1: Hero selection
can activate and deactivate his hero magical power through SPACEBAR key.
User can also pause the game or quit the game by pressing quit button on
the right side the screen. On clicking the button a screen appears asking the
user whether to resume game or quit game.
Over all the game has great aesthetic sense which user will like and everywhere through the game user will find great interactivity while playing the
game as well as moving in the game menu.
c 2014, Indian Institute of Technology Delhi
Chapter 3
Map
Game screen is divided into two parts horizontally, with one part containing
the information about the attributes of hero, and the enemy team hero. The
other part contains the map. The whole map is split into equal size rectangular imaginary tiles implemented as a set such that the tiles are arranged
to form a grid. The map is divided into two regions along the diagonal. The
region belonging to a team is only visible to itself, whereas the region of the
other team is hidden with cloud. However, the war region (including the
temples) is visible to both the teams. Each team has a spawn area from
where the two players of the team starts and if killed while in the game,
again starts the game from the spawn area.
Map is divided in a set of rectangular tiles and only the portion of map
where the tile is available the hero can move. Map contains obstacles like
water, wooden logs, rocks, fires and trees. These obstacles are distributed in
one-third of the player’s region excluding the war zone and the spawn area.
Both the regions are similar in terms of obstacles, spawn area, war zone and
temple. The place where the obstacles are placed, Hero can not move there
and if user clicks on the obstacle he will move to the nearby place where the
obstacle is not present.
At a time five items will be in a team’s area so that the heroes can pick
them up, until their bags become full. Each item is placed on a tile. There
are random location on the temple where the item can appear, hero has to
click on the item to reach at that place and then again left click to pick the
item. In the game two temples occupy a set of tiles clicking on that region
will decrease the health of the temple.
c 2014, Indian Institute of Technology Delhi
5
Within the map player moves in the shortest path possible. Shortest path
algorithm is implemented using the Breadth first search.
Shortest path is computed in the following manner given the starting and
final position of the player.
• An Empty Queue is created.
• All the nodes in the map are mark as unvisited.
• If Queue becomes empty or if we cross the screen coordinates it returns
null indicating that there is no shortest path.
• Otherwise we mark the node as visited and enqueue its adjacent nodes
excluding the diagonal nodes into the Queue.
• This process is repeated until we find the shortest available node or the
path is unreachable.
• Here we consider the distance of the feasible path from the start to
destination.
• Finally We generate the stack from the node information stored during
the shortest path computation.
Finally when the shortest path is computed The hero within the map move
towards the destination in the shortest path, in between if player clicks again
at different location, again the shortest path is computed and hero moves
towards the new destination.
c 2014, Indian Institute of Technology Delhi
Chapter 4
Hero
There are 6 heroes in the game all with different abilities and uniqueness
which gives user the options to compare and choose the Hero according to
his/her liking. Out of the 6 heroes 3 have more defending abilities and they
are tagged as defenders. Other 3 have more attacking abilities and they are
tagged as attackers. User have the option to choose either both attackers or
both defenders in his team or any other combination of player he/she wants.
The Heroes with more attacking abilities are Maverick, Conjurer and Talisman and the Heroes with more defending abilities are Dante, Sting and
Proteger. Each player can choose one among these 6 heroes. The two members of the team selects the hero and enters the game.
Each hero has One unique magical power. An item bag that can contain
maximum of three item at a time, by default at the start a hero has a default
item in his bag, hero can add use item from his item bag while in the game.
Out of the items available hero can use only one item at one time which he
can select by clicking on the item on the side bar. Other than that each hero
has ability to damage other team hero or the temple, Each hero has attack
speed and movement speed and health point.
c 2014, Indian Institute of Technology Delhi
Chapter 5
Item
The game includes items which can be picked by the hero in the map to
increase his ability, different item in the map has different special attribute
which can enhance the hero capability. All hero in the game has a default
item from which they begin the game, while in the game hero has the choice
to pick some item and go their temple and/or other’s.
In a map at a time there will be only 5 items available in the map, a hero
can pick any of the item by simply going to the location where item is present
and the clicking left mouse button over it. Hero has an item bag which can
contain maximum of 3 items at a time and to use a item hero can click the
item over the item in the bag and use it accordingly. If the item is attacking
item then hero after selecting the item in the item bag has to click on other
hero or the temple.
Item that are available in the map are random and also the location of the
item in the map is random so it gives a unique randomness to the game which
make the game fun to play and quite enjoyable, as hero can adopt various
strategy to win the game. Item in the game add and increase attribute to
the hero by either increasing movement speed, attack speed, health, damage
etc. Hero can select the item according to his or her requirement during the
game.
5.1
Items
Potion of Health
The potion when picked will increase the health of the hero (who picked
it) by 25
c 2014, Indian Institute of Technology Delhi
5.1 Items
8
Temple Healer
This temple healer is used to fix the damages caused in the temple. Fixing
the damaging will lead to increasing the health of the temple by 10
Speedy Shoes
This item is used to increase the movement speed of the hero. After
picking, the shoes will remain with the hero for 20 units of time.
Feather of Fury
This raises the attack speed of the heroes by 1 hit per unit time. Once
picked, this item will last with the hero only for 5 units of time.
Items that cause damage
Spear of Devil When thrown over the target (temple or hero), it will have
a damage and decrease their health by 10
War Hammer When hit by hammer, the impact will be more than hitting
with bare hands. The damage will add up 20
Blade of Demise It is a sword that can be used to damage the target to a
greater extent, which will increase the basic damage capability of the heroes
by 10
Amazing Arrow When thrown on a target, it will cause a damage on it
and decrease its health by 3
c 2014, Indian Institute of Technology Delhi
5.2 Magical Powers
9
Armour of Indemnity This gives a protective layer to the heroes so that
the attack has effect on the shield instead of having effect on the heroes
themselves. Once the shield has lost its health, the shield will be destroyed
and any further impact will be over the hero unless he picks another shield.
The starting health of armour will be 25
5.2
Magical Powers
The following table gives the list of the available magic powers, duration
for which they will be active after applying them and the duration between
the successive usages of the magic power.
Magic Power
Burst Damage
Slower
Disabler
Stunner
Active time
(units of time)
2
3
5
1
Recovery time
(units of time)
15
15
15
20
Table 5.1: Magical Power
c 2014, Indian Institute of Technology Delhi
Chapter 6
Game
Player can play this game either as single player that is with bots or with
other human player that is by selecting the multiplayer mode. After selecting
the team and hero of his liking the game will be played between two teams
both containing two heroes each and both have to defend there temple and
destroy the enemy temple before the other team destroy there temple. Game
will get over one team destroys the temple of other
6.1
Game play
If a user has selected a single player game then all the other heroes will be
BOTS otherwise number of BOTS depend on the number of human player,
if all the four are human player then no BOTS will be selected in any other
case slot will be filled by the BOT. If in between one of the player leaves the
game after some amount of time that place will be taken by the BOT and
game will resume from the previous point.
After the start of the game a hero can either first select the items and fill
his item bag and then go to temple or he can directly go to his temple or the
enemy team temple. Being a strategy game whole strategy depends on the
hero what he wants to select either do a full on slaught attack on the other
team temple or defend his temple.
To attack a temple or a hero of other team, player has to click on the hero
or temple by left mouse click, but for that first he has to reach at the location
near to the temple or hero, which is the war zone, that is the zone where
the other team hero are visible if they are available there, this location also
contains the temple. The area of the other team other than the war zone is
not visible to the player.
c 2014, Indian Institute of Technology Delhi
6.1 Game play
11
Figure 6.1: Game screen
To move to a particular location, either to pick an item or attacking a hero
or temple player has to click with right mouse button over the place where
he wants to go. Over the side bar hero can see the details about his item in
the item bag, his health as well as enemy players health to give him the idea
what he can do. Also over the temple a health bar is there which depicts the
current health of the temple.
Each hero in the game has unique magical power associated with him,
each magical power has some time over which it is active on the victim and
once used over the enemy it takes some time to rejuvenate. Hero can use
his magical power by pressing space bar, once hero presses the space bar he
can see that in the Side bar that magical power is activated the next time he
clicks with the left mouse button over the enemy team player, the magical
power will be cast over the other player, but with ”burst damage” magical
power hero can click anywhere and power will be applicable over a radius
and it can affect multiple player.
while in the game player can quit at any time by clicking on the quit button
and he will be replaced by the BOTS.
c 2014, Indian Institute of Technology Delhi
6.2 BOTS
6.2
12
BOTS
As game can be played with BOTS they are coded so that the game still
remains interesting and fair and enjoyable to play. BOTS are coded such
that one of the BOT will go to defend his temple and the other BOT will go
to attack the enemy team player. While moving towards the temple BOT can
pick item in the path and BOT will use the item according to requirement.
The BOT which is attacking the temple if an enemy team hero comes switches
his attack to the other hero and if he kills the player, he again start attacking
the temple. In the start of the game BOT are assigned random hero.
c 2014, Indian Institute of Technology Delhi
Chapter 7
Conclusion
We have successfully developed a strategy game in C++ language and used
OpenGL for providing graphics and keyboard and mouse handling. We have
tried to include all the features that are required for a game to be interesting,
fair, enjoyable as well as user friendly. The game is highly interactive in
nature and is enjoyable to play. This game includes the networking feature
to play in multiplayer. The game can be played in two mode single player
with bots or in mulitplayer over network.
c 2014, Indian Institute of Technology Delhi