My idea for measuring hax is what I call "variant damage". It's the difference between the damage you were expected to cause to the opponent, calculated from probabilities, and the actual damage dealt. Each player would have a running total of their variant damage, and at the end of the match, the difference between the two would tell how much the hax favored one side or the other.

To demonstrate this, suppose you and I were playing a hypothetical match, and the following turns took place.

Code:

Case 1
Your Magnezone (84%)
My Scizor (87%)
Scizor used Bullet Punch
Magnezone lost 10% of its health
Magnezone used Hidden Power
It's Super Effective
Scizor lost 87% of its health
Scizor fainted
Suppose Scizor would to 9-10.6%, without critical, and that it actually did exactly 10% to Magnezone.
Assume Magnezone's HP Fire is a guaranteed KO. In this case, Scizor's expected damage is (10.6+9)/2 *
(1+1/16) = 10.4%. So My variant damage is -.4%. Meanwhile, Magnezone had no chance of doing less
than 87% damage, so your variant damage is 0. Since there was no hax this round, the variant
damage is quite small.
Case 2
Your Magnezone (84%)
My Scizor (87%)
Scizor used Bullet Punch
A critical hit!
Magnezone lost 20% of its health
Magnezone used Hidden Power
A critical hit!
It's Super Effective
Scizor lost 87% of its health
Scizor fainted
Now my variant damage is 9.6%, while yours is still 0%. Once again, I had essentially no hax, so my
variant damage is 0. You had a minor hax in your favor, so your variant damage is mildly positive
Case 3
My Heatran (100%) (Scarfed)
Your Dugtrio (54%) (LO) (Arena Trap)
Heatran used Fire Blast
Heatran's Attack Missed
Dugtrio used Earthquake
Heatran Fainted
Suppose Heatran's attack was a guaranteed KO if it hit. Then Heatran's expected damage was 54%*.85
= 45.9%, and my variant damage is then -45.9%. Additionally, since you only had a 15% chance of
attacking this turn, your expected damage was 100%*.15 = 15%, so your variant damage for the turn is 85%.
This turn has a very large difference in variant damage (131%), which reflects the important nature
of this hax.
Case 4
My Gengar (100%)
Your Swampert (100%)
Gengar used Hypnosis
Swampert fell asleep
Swampert is fast asleep
You had selected Surf and expected to do 56% damage, so your variant damage is -56% for this
turn. Meanwhile, I would have done no damage regardless, so my variant damage is 0.
This moderate hax has a moderate effect on variant damage.
Also, if this case were replaced with an Ice Beam freeze, the chance of freeze would have to be taken
into account as well as the chance to instantly unfreeze.
Case 5
My Aerodactyl (1%)
Your Jolteon (100%) (Specs)
Jolteon used Thunderbolt
It's Super Effective!
Aerodactyl lost 1% of its health.
Aerodactyl fainted.
In this case, the result was decided on a speed tie. Supposing EQ would have KO'd Jolteon, then my
variant damage is -50%, as I had a 50% chance of dealing 100% of your HP. Your variant damage
is .5%, as you had a 50% damage of dealing 1% damage to Aerodactyl.

One problem is that I'm having trouble thinking of simple ways to deal with Burn, Poison, and Paralysis, though. While a full para is easy enough to deal with in the above model, if said paralysis was caused by Tbolt rather than Twave, should it have more weight? If so, how to implement that? Burn damage/attack loss has a similar problem, as does Poison damage when not caused by Toxic Spikes, as even Toxic has a chance to miss. A non-simple way to handle this is to assign to every pokemon the "probability that they'd have this status condition at this point in the match", which is calculable, and then factor that into the expected values. It's messy, but it would work. A similar thing could be used for stat-boosting moves, although Meteor Mash and Charge Beam are probably the only relevant ones.

Additionally, this doesn't take into account the fact that people play differently when badly haxed. Now that I'm without Heatran in Case 3, I'll have more difficulty switching into Celebii, for example. I'm not sure if it's even possible to account for that, but the issue is there. Added computational complexity is also an issue, but it seems inevitable to get any sort of reliable estimate.

Still, I think this is the correct way to go about measuring hax. The variant damage gives you an idea of how random draws affected the damage you did to your opponent. Thus, it would set be easy to say "If the winner's variant damage minus the loser's is more than X%, then the match is declared 'too haxy', and thus void.", where X is a number to be determined. And, if we did do the previous, a viable definition could be made for banning something based on randomness--if a suspect significantly raises the rate of matches being voided, then it is clearly greatly increasing the effect of hax.

Click to expand...