4
$\begingroup$

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.

$\endgroup$
3
  • 1
    $\begingroup$ Are you expecting KOs to happen after one round of combat or over multiple rounds of combat? Does it matter how "badly" one class beats the other? $\endgroup$ May 19, 2021 at 12:47
  • 1
    $\begingroup$ @eyeballfrog Thank you. 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. $\endgroup$
    – JakeMZ
    May 19, 2021 at 13:05
  • 3
    $\begingroup$ I have no idea what's going on here, but maybe this is a version of "intransitive dice", where you have three dice, and die A beats die B, B beats C, and C beats A. If you look at the triples $A=(1,6,8)$, $B=(3,5,7)$, and $C=(2,4,9)$, A beats B five times out of nine, B beats C five times out of nine, and C beats A five times out of nine. Maybe you could use something like this to construct what you want. $\endgroup$ May 20, 2021 at 3:42

2 Answers 2

4
$\begingroup$

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.

$\endgroup$
1
  • 5
    $\begingroup$ +1 This rules out ideal solutions in which all battles only take one round. And your observation that the distinction between health and defense is irrelevant applies regardless. But if we expand to multiple-round fights then there are solutions, as in Karagounis Z's answer. $\endgroup$
    – Mark S.
    May 21, 2021 at 0:35
3
$\begingroup$

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

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

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.