Comparing two sets of numbers

This topic is 3018 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

My issue involved comparing two sets of data: Set 1: Player 1's attack and defense Set 2: Player 2's attack and defense In a normal battle, the attacker's attack is compared to the defender's defense. If the attack was greater than the defense, the attack would win. In a head-on-head on battle, I am trying to figure out how to compare the two sets of numbers so that there is only one winner. I need to compare Player 1's attack against Player 2's defense. Then I need to compare Player 2's attack against Player 1's defense. Any ideas on how I should go about this?

Share on other sites
If you subtract a.attack from b.defense, you get a value that is proportional to how much stronger a is over b.

So you can simply compare these relative values.

You may want to make it more interesting though, by adding some randomness or multiple rounds where players damage each other. Simply comparing scores and having the highest win sounds a little dull.

Share on other sites
Alright, thanks for the suggestion!

Share on other sites
If it happens that both players have a higher attack than the opponents defence you could decide the winner on who has the greatest difference, i.e.,

Player 1 -- A = 10, D = 5
Player 2 -- A = 12, D = 1

The difference between P1's attack and P2's defence is 9
The difference between P2's attack and P1's defence is 7

So P1 would win in this case (this also leads to the possibility of a draw).

Is it possible to add another attribute such as speed?
If this is the case you could do one normal battle where the player with the highest speed attacks first, if that attack doesn't win the slower player has a turn to attack.

[EDIT]
ninja'd by rip-off :)

1. 1
2. 2
3. 3
4. 4
Rutin
17
5. 5

• 12
• 9
• 12
• 37
• 12
• Forum Statistics

• Total Topics
631419
• Total Posts
2999985
×