PageRenderTime 48ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/SDK/docs/en/GAME.md

https://bitbucket.org/ehvattum/draugr_contrib
Markdown | 263 lines | 215 code | 48 blank | 0 comment | 0 complexity | 9693ad35e2d4f07b3c03379a2f4932ee MD5 | raw file
  1. SKYPORT REV 1 GAME RULES
  2. ========================
  3. NOTE
  4. ----
  5. If you have obtained this file through downloading the SDK, make sure you have
  6. the latest versions. New versions of the SDK may be continuously released up
  7. until the competition. You can read a brand-new, in-development version of this
  8. document online at
  9. https://github.com/Amadiro/Skyport-logic/blob/master/docs/en/GAME.md
  10. SYNOPSIS
  11. --------
  12. This file describes the game rules as implemented by the server.
  13. MAP
  14. ---
  15. The map is a hexagonal grid of tiles. See PROTOCOL/MAP-OBJECT for an exact description
  16. of the map format used. In short, the tiles have a normal coordinate system
  17. imposed on them:
  18. J-coordinate K-coordinate
  19. \ /
  20. \ /
  21. \ _____ /
  22. \ <0> / \ <0>
  23. \ / \
  24. \ ,----( 0,0 )----.
  25. <1> / \ / \ <1>
  26. _____ / 1,0 \_____/ 0,1 \_____
  27. <2> / \ / \ / \ <2>
  28. / \ / \ / \
  29. ( 2,0 )----( 1,1 )----( 0,2 )
  30. \ / \ / \ /
  31. \_____ / 2,1 \_____/ 1,2 \_____/
  32. \ / \ /
  33. \ / \ /
  34. `----( 2,2 )----'
  35. . \ / .
  36. . \_____/ .
  37. . .
  38. Positions are always written in J,K notation, i.e. the J-coordinate comes first,
  39. the K-coordinate second. For instance, you may send the server a message
  40. such as "go to 1,0" and then "fire mortar at 2,2". The server would then
  41. first move you one tile in the J-direction, and then perform your mortar shot,
  42. assuming it is in range.
  43. You can move from tile to tile in the fashion you would expect (crossing edges),
  44. and you can move up to 3 tiles in one round.
  45. There are seven different types of tiles, as described in the next section.
  46. TILES
  47. -----
  48. ### ACCESSIBLE TILES (These tiles can be moved onto)
  49. * **GRASS** - normal grassland. No effect. May come in various forms and colors, but
  50. robots don't care about aesthetics.
  51. * **EXPLOSIUM** - If you stand on this tile, you can use one action or more to mine
  52. explosium. An explosium tile has 2 explosium, which you mine at a rate of
  53. one explosium per action. After it is depleted, it turns into grass.
  54. * **RUBIDIUM** - If you stand on this tile, you can use one action or more to mine
  55. rubidium. An rubidium tile has 2 rubidium, which you mine at a rate of
  56. one rubidium per action. After it is depleted, it turns into grass.
  57. * **SCRAP** - If you stand on this tile, you can use one action or more to mine
  58. scrap. An scrap tile has 2 scrap, which you mine at a rate of
  59. one scrap per action. After it is depleted, it turns into grass.
  60. ### INACCESSIBLE TILES (These tiles cannot be moved onto, but the server may place you on them.)
  61. * **VOID** - No tile at all.
  62. * **SPAWN** - protected spawn area. Once you move away from it, you can't re-enter. Cannot be attacked, and can't be attacked from.
  63. * **ROCK** - A rock is blocking the way.
  64. TURNS
  65. -----
  66. Each round, each player gets three turns. In a turn, he may move to any
  67. adjacent tile, covering a maximal distance of three tiles per turn. A
  68. player may chose to use an action for something else, such as firing a
  69. weapon or simply waiting. Firing a weapon immediately ends the turn, but
  70. any left-over actions give your attack an extra damage bonus.
  71. After a players turn is over, the gamestate is sent to all clients, and
  72. the next player may make his turn.
  73. WEAPONS
  74. -------
  75. There are three basic weapons, the laser, the mortar and the battle droid.
  76. Each weapon may be upgraded three times, to increase its range and damage,
  77. see the next sections.
  78. Leftover unused actions in your turn (e.g. if you shoot your weapon right
  79. away without moving first) will give your weapon extra bonus damage. See
  80. the end of this document.
  81. MORTAR
  82. ------
  83. The mortar is the easiest to use; it simply has a radius/range, and it
  84. hit any tile inside that range. An alternative interpretation (resulting
  85. in the same tiles) is to say "the mortar can move a fixed number of steps
  86. in any direction. Any tile it can reach in that number of steps, is in
  87. range". The mortar is unaffected by gaps and rocks, but shooting at them
  88. has no effect (both void tiles and rocks will simply absorb the damage
  89. completely, and no AoE damage will ocurr). The mortar carries an explosive
  90. load, and hence has a strong AoE bonus damage at a radius of one tile.
  91. Note that you can use the mortar to damage yourself, both with a direct
  92. hit and with AoE damage. You are not awarded any points for damaging or
  93. killing yourself.
  94. * Range at level 1: 2 tiles
  95. * Range at level 2: 3 tiles
  96. * Range at level 3: 4 tiles
  97. See the bottom of this document for damage.
  98. See the following image for a visualization:
  99. ![range of the mortar](../range-mortar.png)
  100. LASER
  101. -----
  102. The laser has the longest range, and shoots straight. That means there
  103. are tiles it cannot reach, without moving into a different position first.
  104. The laser can shoot over gaps, but not through rocks.
  105. * Range at level 1: 5 tiles
  106. * Range at level 2: 6 tiles
  107. * Range at level 3: 7 tiles
  108. See the bottom of this document for damage.
  109. See the following image for a visualization:
  110. ![range of the laser](../range-laser.png)
  111. DROID
  112. -----
  113. The droid requires the player to send a list of directional steps.
  114. It has a fixed number of steps it can walk, after which it will explode,
  115. whether it has reached its target or not. The droid cannot walk over gaps
  116. or rocks, so it has to navigate around them. The droid carries an
  117. explosive payload and induces an AoE damage bonus, at a radius of
  118. one tile.
  119. Note that you can use the droid to damage yourself, both with a direct
  120. hit and with AoE damage. You are not awarded any points for damaging or
  121. killing yourself.
  122. * Range at level 1: 3 steps
  123. * Range at level 2: 4 steps
  124. * Range at level 3: 5 steps
  125. See the bottom of this document for damage.
  126. See the following image for a visualization:
  127. ![range of the droid](../range-droid.png)
  128. RESOURCES
  129. ---------
  130. There are three basic types of resources: rubidium, explosium and scrap.
  131. rubidium is used to upgrade lasers, explosium is used to upgrade the
  132. mortar, and scrap is used to upgrade the battle droid.
  133. Resources are obtained by standing on a resource-tile and using an action
  134. to mine the resource. If a player has collected enough of one type of resource,
  135. he can use a turn to upgrade his weapon to the next-highest tier. Once a weapon has
  136. reached level 3, it cannot be upgraded anymore.
  137. LOADOUT
  138. -------
  139. Upon gamestart, the AI can chose two weapons to use for the entire game.
  140. Any combinations of weapons can be chosen. Some maps may contain an un-
  141. even distribution of resources, having more resources of one type on one
  142. end, or lacking a resource alltogether. It is hence probably wise to
  143. scan the map thoroughly before chosing a loadout.
  144. STARTING
  145. --------
  146. Upon gamestart, each AI is set to a protected starting-tile. A starting-
  147. tile can be moved off of, but cannot be moved onto. Hence only the server
  148. may place a player on a starting tile.
  149. A player standing on the starting tile, may not attack, and cannot be
  150. attacked. Remaining on the starting tile when the round is over, incurrs
  151. a penality of -10 points.
  152. ACTIONS
  153. -------
  154. Each round, each client gets three actions to use. An offensive move
  155. immediately terminates the players turn, and uses up the remaining
  156. moves (if any) for a damage bonus.
  157. MOVEMENT
  158. --------
  159. An action may be used for moving in one of the six cardinal directions.
  160. Only accessible tiles may be moved onto, attempting to move onto an
  161. inaccessible tile is an invalid move and hence discarded by the server.
  162. POINTS
  163. ------
  164. Damaging a player awards you with the amount of points equivalent to
  165. the damage you inflicted on the player. This means that "overdamage"
  166. is counted, e.g. if your enemy has 1 health point left, and you hit
  167. him for 16 damage, you will be awarded 16 points for the damage inflicted.
  168. Killing another player in addition awards you with a 20 bonus points bounty.
  169. Dying gives you a point penality of -40 points.
  170. Standing on the spawn-tile incurrs a -10 point penality at the end of each
  171. round. To avoid any penalities, move away from the spawn-tile immediately
  172. upon spawning.
  173. Not performing any actions at all during your turn, incurs a -10 point
  174. penality as well. The intention of this rule is to make crashed AIs quickly drop
  175. to the bottom of the score bracket. If you wish to not make a move due
  176. to tactical reasons, you may simply perform a shot in any direction, or
  177. move up a tile and then back down, forfeiting your last action. This will
  178. not incur any penality.
  179. After a fixed amount of time has passed,
  180. the round ends, and the player with the highest score wins.
  181. DESTRUCTION
  182. -----------
  183. Each player starts with a certain amount of health. Health does not
  184. replenish, but upon destruction, a player may respawn from his spawn-
  185. point and continue playing without losing their upgraded weapons.
  186. Respawning takes one full turn, so you have to skip one round. Once
  187. you have died, the server will simply move past you in the player
  188. order, so that you don't get your next turn. The next time after
  189. that, the turn order will be resumed as normal.
  190. Death incurs a -40 points penality.
  191. ARITHMETIC & STATS
  192. ------------------
  193. Damage is always rounded to the nearest int, with 0.5 rounding to 1.
  194. * Upgrading a weapon from lvl 1 to lvl 2: 4 resources
  195. * Upgrading a weapon from lvl 2 to lvl 3: 5 resources
  196. * hp = -dmg
  197. * Player at full health: 100hp
  198. * laser lvl 1: 16dmg
  199. * laser lvl 2: 18dmg
  200. * laser lvl 3: 22dmg
  201. * mortar lvl 1: 20dmg
  202. * mortar lvl 2: 20dmg
  203. * mortar lvl 3: 25dmg
  204. * mortar AoE damage: 18dmg
  205. * droid lvl 1: 22dmg
  206. * droid lvl 2: 24dmg
  207. * droid lvl 3: 26dmg
  208. * droid AoE damage: 10dmg
  209. * player_damage = weapon_damage + AoE_damage + unused_turns*(0.2*weapon_damage) + unused_turns*(0.2*AoE_damage)
  210. For this last equation, notice that either AoE_damage = 0 or weapon_damage = 0, since a tile cannot be hit
  211. simultaneously by the weapons main damage and its AoE damage.
  212. Example:
  213. Player A hits a tile X with a lvl 3 mortar and 2 unused turns left.
  214. Damage incurred to player on X: player_damage = 25 + 0 + 2*(0.2*25) + 2*(0.2*0) = 35
  215. Damage incurred to players on adjacent tiles: player_damage = 0 + 18 + 2*(0.2*0) + 2*(0.2*18) = 25