Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am trying to design a game for a project I have, The main idea is:

3 Types of heroes
3 Stats per hero

There are no levels involved so the differences must be located on stats.

Fight logic - The logic of fight is that type1hero has good chances winning type2hero, type2hero has good chances type3hero and type3hero has good chances winning type1hero.

For over a week I am trying to find a stats based formula that will allow me to fix this but I can't, I was meddling with numbers yesterday and it was decent but I can't extract the formula out of it.

Could you please guide me or give me hints on how should I start creating formulas on a Non lvl game that fulfills the fight logic?

share|improve this question
1  
"For over a week i am trying to find a stats based formula that will allow me to fix this" - Fix what? This is a Rock-paper-scissors mechanic; you can't describe it mathematically, because there's no x, y, z for x > y ∧ z > x ∧ y > z at least not in basic maths I know and use. –  Markus von Broady Nov 1 '12 at 12:42
2  
While you've received a great answer, this question is not very good. –  Byte56 Nov 1 '12 at 18:08
    
@MarkusvonBroady: The usual way to mathematically describe an ordering like this is with a directed graph/intransitive relation. You're right that you won't be doing this with real numbers. –  Joren Nov 1 '12 at 19:31
5  
@Byte56: While I agree it is not presented in a very nice way, the question hidden behind remains interesting: how to modulate a 3-way fighting system in a generic manner, much like rock-paper-scissors, as expressed in the answers below. Not worth a -1, imho. –  Jesse Emond Nov 1 '12 at 20:06
    
@JesseEmond In the one answer below*. The problem is very simple, as I commented on the answer, it's just various armors and attack types disguised as a rock-paper-scissors mechanic. Though the formula provided is very neat. –  Markus von Broady Nov 1 '12 at 22:57
show 1 more comment

2 Answers 2

Each hero trains up in Melee Combat (M), Dodge (D), and Wizardry (W).

Dodging evades melee combat very well, and magical attacks less well.

Each round, a hero deals damage equal to (M-D) + (W - 0.5D) (M and W are from the attacker's stats, D is from the defender's stats.)

So a Warrior might have the stats:

M: 100, D: 20, W: 0

A Rogue could have the stats:

M: 30, D: 80, W: 30

And a Wizard might have stats like:

M: 10, D: 10, W: 80

Warrior vs. Rogue, the warrior deals 20 DPS, while the rogue deals 30 DPS. Advantage Rogue! Rogue vs. Wizard, the rogue deals 20 DPS, while the wizard deals 40 DPS. Advantage Wizard! Wizard vs. Warrior, the wizard deals 70 DPS, while the warrior deals 90 DPS. Advantage Warrior!

share|improve this answer
    
This answer doesn't add anything beyond Sam's. Also, the rogue has the smallest advantage (30 - 20 == 10 compared to 40 - 20 == 90 - 70 == 20 for the other two). Surely this means rogues are inherently disadvantaged? –  Anko Jan 23 '13 at 21:39
    
The beauty of these nontransitive systems is that they balance out almost automatically. Disadvantaged rogues mean fewer people will play them, leaving fewer targets for the wizard to defeat and fewer opponents for the warrior to be defeated by. Yet if everyone picks the warrior: return of the rogue. –  Marcks Thomas Jan 24 '13 at 10:53
add comment

Your game is a nontransitive game. You can implement it with 3 stats R, P and S, using the rock-paper-scissors logic. Call these stats whatever you want, but I'll stick with the RPS logic.

Now suppose you have two heroes, with stats R1/P1/S1 and R2/P2/S2. We need to compute how much damage they will do to each other.

You want rocks to deal damage to scissors. That means hero 1 deals « rock » damage to hero 2 if R1 > 0 and if S2 > 0. One formula that works is simply min(R1, S2).

Which immediately gives us the damage formulas:

Damage(hero1 on hero2) = min(R1, S2) + min(S1, P2) + min(P1, R2)
Damage(hero2 on hero1) = min(R2, S1) + min(S2, P1) + min(P2, R1)

Let's see what happens with a real example:

    Hero1  Hero2
R    120     50
S     30    130
P     15     30

Given the stats, hero 1 is clearly a « rock » type and hero 2 is clearly a « scissor » type. Here are the results:

Damage(hero1 on hero2) = min(120, 130) + min(30, 30) + min(15, 50)
                       = 120 + 30 + 15
                       = 165
Damage(hero2 on hero1) = min(50, 30) + min(130, 15) + min(30, 120)
                       = 30 + 15 + 30
                       = 75

Final results: 165 versus 75. Hero 1 wins, as expected.

There are many shortcomings with these formulas, but I hope they give you an idea of how to implement intransitive combat rules.

share|improve this answer
2  
+1, I would describe it simply as various types of attacks and armors (poision, elemental, physical) –  Markus von Broady Nov 1 '12 at 13:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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