In this Code/Architecture Kata you will be implementing a strategy/role-playing game using loosely based on the popular mobile game Star Wars™ Galaxy of Heroes. This Kata is supposed to be more complex than most of the well-known traditional Katas (e.g. Roman Numbers, Bowling Game or FizzBuzz) including even the EverCraft Kata or my own Kata TCG. It offers many possibilities for different focuses depending on learning goals and can be approached iteratively with TDD from different angles. The Kata is especially well suited for building extensible software because the gameplay could be extended or modified in many ways. While it is not recommended to use this Kata for TDD introduction-trainings, it should offer challenges for developers of higher experience levels.
Bot Wars is supposed to be an addictive strategy game where two players battle each other with a team of robots. Players start with a pool of pre-defined robot types. There are bots which excel as damage-dealers, tanks, supports or healers as well as some more "jack-of-all-trades"-style bots. When a game begins, both players assemble a team of robots from their roster and send them to the battlefield. The bots now take turns in attacking the enemy team or performing other actions, e.g. healing the own team. When one player's bot team is totally destroyed, the game ends.
Both the winner and the loser of the game get rewarded with experience, in-game currency and have a chance to receive upgrade-parts for their bots. Given they have collected enough resources, players can train and upgrade their bots to become more powerful and efficient in battle. Players are supposed to be able to play the game occasionally and still have their current roster of bots available.
For training purposes the game offers AI opponents to battle against. This allows players to validate their team composition and try out different strategies.
Create a high-level solution design or architecture sketch for the game, based only on what you learned from the Product Vision!
As a powerful bot I want to deal heavy damage to my opponents so that I can blast through my opponent's armor!
- Bots have a Power stat which determines their damage potential in combat.
- Bots also have an Armor stat which reduces the damage they receive in combat.
The damage calculation works like this (in pseudo-code):
damage to opponent = random(between 0,5 and 1) * power of attacker - armor of opponent
As a resilient bot I want to be able to take several hits before being destroyed to that I am more useful to my player in matches!
- Bots have an Integrity stat which is reduced by the damage received in combat.
- A bot with zero Integrity is considered destroyed.
- Bots cannot have less than zero Integrity.
As a nimble bot I want to be able to outspeed my opponent so that I attack earlier and more often than he can.
- Bots have Speed stat which influences how early and often they can attack
- Bots that participate in a battle use a Turn Meter to determine the attack order among themselves
The attack sequence should be determined and executed like this (in pseudo-code):
pre: for all bots(turn meter = 0)
loop:
for all bots(
turn meter += speed of bot
if (turn meter >= 1000) {
turn meter -= 1000
attack opponent bot
}
)
:loop
As a competitive player I want to have a team of bots fight an opponent's team so that the game becomes more interesting!
- The game is intended for 2 players
- Both players need to have a unique name
- Each player sends a team of 3 bots into the arena
- When it is a bot's turn the player chooses one opponent bot to attack
- The game ends when one player's team has been eliminated
The battle loop looks like this (in pseudo-code):
pre: both players send 3 bots into arena
loop:
determine potential attackers
randomize order(attackers)
for all attackers(
choose opponent bot to attack
attack opponent bot
if (opponent bot(integrity <= 0)) {immediately remove opponent bot from battle}
)
}
:loop until(all remaining bots belong to one player)
post: declare player with remaining bots as winner
As a strategy game player I want to have different kinds of bots at my disposal to assemble my team from so that I can best counter my opponent's team composition.
- Bots have a Name attribute that describes the type of bot they are.
- Both players have their own pool of Bots available to assemble their team from before each battle.
- A player cannot put a bot more than once into his/her team.
- Bots have an
Evasion%
-chance based on their Evasion stat to completely prevent an incoming attack from hitting them. - Bots also have a
Critical Hit%
-chance based on their Critical Hit stat to cause double damage when hitting an opponent. Critical damage multiplication happens before target armor is subtracted.
Name | Integrity | Power | Speed | Armor | Evasion | Critical Hit |
---|---|---|---|---|---|---|
Aggro Bot | 800 | 100 | 40 | 20 | 0% | 10% |
Stealth Bot | 500 | 70 | 90 | 20 | 20% | 20% |
Glass Bot | 300 | 180 | 20 | 0 | 30% | 10% |
Tank Bot | 1200 | 50 | 30 | 40 | 5% | 10% |
Beaverette Bot | 1000 | 70 | 35 | 30 | 5% | 15% |
Kamikaze Bot | 500 | 50 | 40 | 0 | 0% | 20% |
As a malevolent bot I want my attacks to put negative effects over time on my victims so that they get less useful in battle
- Some bot's attacks have a chance to inflict a Negative Effect on the target that lasts for a certain number of turns.
- A negative effect expires when its Duration counter reaches zero.
- The Duration counter is set in the turn where the effect was inflicted and decreases by one with every turn the affected bot takes.
- Negative Status Effects have a
Resistance%
-chance to be prevented based on the Resistance stat of the target bot.
Negative Effect | Description |
---|---|
Defense Down | Reduces the Armor and Resistance of a bot by 50%. Can not be inflicted on bots who are already under this effect. |
Offense Down | Reduces the Power of a bot by 25%. Can not be inflicted on bots who are already under this effect. |
Continuous Damage | Damage over Time (DoT) effect that reduces a bot's integrity by power of attacker each turn until it expires. Can be stacked multiple times on the same bot. |
Bomb | Causes random(between 0,5 and 1) * power of attacker - armor of affected bot damage to the affected bot when the effect expires. Can be stacked multiple times on the same bot. |
Speed Down | Slows the Turn Meter down by 25% which reduces the amount of actions a bot can take during battle. |
Stun | Stunned bots will miss their moves while under this effect. Furthermore a stunned bot cannot evade attacks. |
- The attacking bot first needs to beat his own Effectivity and then beat the Resistance of its target to actually inflict an effect.
- Remember that only some negative effects can be stacked multiple times on the same bot.
Bot | Resistance | Effectivity | Negative Effect | Duration |
---|---|---|---|---|
Aggro Bot | 10% | 30% | Defense Down or Stun | 1 |
Stealth Bot | 0% | 40% | Speed Down or Offense Down | 2 |
Glass Bot | 5% | 65% | Continuous Damage (*) | 2 |
Tank Bot | 20% | 25% | Bomb | 3 |
Beaverette Bot | 10% | - | - | - |
Kamikaze Bot | 0% | 65% | Bomb (*) | 2 |
- Effects marked with a (*) in the table above are (individually) inflicted on the whole enemy team instead of just the targeted bot. Each enemy bot still has its own
Resistance%
-chance to resist the effect. - If more than one effect is listed for a bot in the table above, one of the effects is randomly inflicted.
As a benevolent support bot I want special skills with positive effects so that I can buff my team in combat
- Some bots have secondary skills that buff themselves and/or teammates with a Positive Effect that lasts for a certain number of turns.
- A positive effect expires when its Duration counter reaches zero.
- The Duration counter is set in the turn where the effect was cast and decreases by one with every turn the affected bot takes.
Positive Effect | Description |
---|---|
Defense Up | Increases the Armor and Resistance of a bot by 50%. |
Offense Up | Increases all caused Damage of a bot by 50%. |
Speed Up | Grants a bot +25% speed providing faster refilling turn meters for more actions per battle. |
Taunt | Bots with taunt will force all opponents to target them until the effect expires. |
Stealth | Stealthed bots are not directly targetable unless only stealthed bots are remaining. Stealthed bots cause +30% damage. |
Retribution | A bot under this effect will immediately counter attack when attacked himself (given he survives that attack). |
- Positive effects cannot be stacked but when cast on a bot under the same effect the Duration will be reset.
- Secondary skills have a Cooldown which is the number of turns after they become available for usage again.
Bot | Cooldown | Positive Effect | Duration |
---|---|---|---|
Aggro Bot | 4 | Offense Up | 2 |
Stealth Bot | 4 | Stealth | 3 |
Glass Bot | - | - | - |
Tank Bot | 3 | Taunt and Defense Up (*) | 2 |
Beaverette Bot | 3 | Defense Up and Speed Up (*) | 2 |
Kamikaze Bot | 4 | Retribution | 1 |
- Effects marked with a (*) in the table above are cast on the whole team instead of just the bot itself.
As a tinkerer bot I want to repair my damaged teammates so that they can keep on fighting
- The new bot type Nurse Bot can cast Repair as his secondary skill which immediately repairs himself and all teammates that have not been destroyed by a considerable amount of integrity.
- Repair also comes with a chance for a Continuous Repair positive effect which keeps repairing a bot by a small amount of integrity in each turn where the effect lasts
- Furthermore the bot type Doctor Bot is introduced. He can Redistribute the team's sum of current integrity equally among all teammates and then Repair all bots by a small amount. (This is great for healing a single severely damaged bot.)
The repair mechanics work like this (in pseudo-code):
# Nurse Bot
for all bots on team(
integrity += 30% of nurse bots maximum integrity
random(0,5) -> bot receives positive effect(continuous repair -> integrity+= 10% of nurse bots maximum integrity)
)
# Doctor Bot
team integrity = 0;
for all bots on team(
team integrity += integrity
)
for all bots on team(
integrity = team integrity / team size
integrity += 10% of doctor bots maximum integrity
)
The two new repair bots have the following stats:
Name | Integrity | Power | Speed | Armor | Evasion | Critical Hit | Resistance | Negative Effect / Chance / Duration | Positive Effect / Cooldown / Duration |
---|---|---|---|---|---|---|---|---|---|
Nurse Bot | 700 | 80 | 50 | 15 | 15% | 10% | 20% | Speed Down / 30% / 1 | Repair and Continuous Repair (*) / 4 / 2 |
Doctor Bot | 950 | 30 | 35 | 25 | 10% | 10% | 25% | - | Redistribute and Repair / 5 / - |
- Effects marked with a (*) in the table above are cast on the whole team instead of just the bot itself.
Coming soon...
Coming soon...