Assigning health/attack/defense parameters to game character types $A$, $B$, $C$ so that $A$ always defeats $B$, $B$ defeats $C$, and $C$ defeats $A$?

282 Views Asked by At

I'm developing a RPG game where there're 3 types of characters, tank, warrior and assassin.

I'm wondering if it's possible to set the HP(hit points/health points/health power), attack and defense of the characters so that the tank is guaranteed to defeat the assassin, meanwhile, the assassin is guaranteed to defeat the warrior whereas the warrior is guaranteed to defeat the tank.

For example, the attribute of the assassin is {"MaxHP": 500, "Attack": 1600, "Defense": 50} and the warrior has {"MaxHP": 1100, "Attack": 300, "Defense": 300}.

The damage that a guy took is equal to their opponent's attack minus the guy's defense.

The process of a battle/combat looks like this

The assassin dealt 1300 damage to the warrior, the warrior's HP is now 0.
The warrior dealt 250 damage to the assassin, the assassin's HP is now 250.
The assassin won the battle.

It doesn't matter who attacks first, as the only condition that one guy wins is their HP is above 0 whereas the HP of their opponent is equal to or less than 0.

If both HPs are 0, no body wins. Is there a tool/model in math that I can use to solve this puzzle?

The ideal situation is where one class always KOs the opponent in just one round. If one-round is impossible, the solution to multiple rounds battle is also appreciated.

2

There are 2 best solutions below

0
On BEST ANSWER

Assasin: attack =100, health =2, defense =0.

Warrior: attack =1, health =1, defense = 98.

Tank: attack =2, health =101, defense =0.

1
On

I don't think your ideal scenario is possible. Before I explain why, I'll note that giving a character an HP of $H$ and a defense of $D$ is equivalent in this combat system to giving a character an HP of $H + D$ and a defense of $0$. So for example an HP of $100$ and a defense of $50$ is the same as an HP of $150$ and a defense of $0$. So in what follows I'll assume that there are just two stats: an Attack stat, and a "Health" stat, which, in your game, is the sum of Health and Defense. In a fight between characters $A$ and $B$, $A$ wins a fight if the attack of $A$ is greater than the Health of $B$, and $B$ wins a fight if the Attack of $B$ is greater than the Health of $A$. In principle, it is possible for both or neither of $A$ and $B$ to win a fight.

So, my argument for why I don't think your ideal scenario is possible is as follows:

  1. Assume the Assassin's attack is $10$.
  2. The Assassin cannot beat the Tank, so the Tanks Health must be greater - say: $20$.
  3. The Warrior beats the Tank, so its Attack must be greater - say: $30$.
  4. The Warrior cannot beat the Assassin, so the Assassin's Health must be greater - say: $40$
  5. The Tank beats the Assassin, so its Attack must be greater - say: $50$.
  6. The Tank cannot beat the Warrior, so the Warrior's Health must be greater - say: $60$.
  7. This is bad, since the Warrior's Health is greater than the Assassin's Attack. In a battle between the Assassin and the Warrior, no one loses.

In other words, we have a chain of inequalities:

$$ \mathrm{Assassin's\ attack} < \mathrm{Tank's\ Health} < \mathrm{Warrior's\ Attack} < \mathrm{Assassin's\ Health} < \mathrm{Tank's\ Attack} < \mathrm{Warrior's\ Health},$$ and the contradiction that arises is that we want the Assassin's Attack to be greater than the Warrior's Health.