Topic I need some maths checked.
Waniou
Dath'Remar
Waniou
85 Draenei Warrior
9815
Edited by Waniou on 2/20/12 7:57 PM (PST)
Warning: lolmaths ahead

So I've spent most of today getting ready for another mathjuggernaut thread thing. Basically, my Hold the Line thread but with what we currently know about MoP mechanics. I've got my MATLAB function ready to start crunching numbers, but I want to make sure that it works how I want it to. So, if anyone can point out any glaring mistakes, it'd be much appreciated.

Firstly, passive mitigation. This is easy and is basically the same as Cata, but without Hold the Line:
miss = 5 - moblevel * 0.2;
dodgeundr = 1/176.71899 .* dodgeRating;
parryundr = 1/176.71899 .* parryRating;

Translates dodge and parry into percents, then we apply diminishing returns and boss suppression:
dodge = 1./(1/cDR + kDR./(dodgeundr)) + 5 - moblevel * 0.2;
parry = 1./(1/cDR + kDR./(parryundr)) + 5 - moblevel * 0.2;


Block chance:
block = (1/(1.5*179.28004) .* masteryRating) + 32 - moblevel * 0.2;
avoidTotal = min(miss + dodge + parry + block,100);
blocknosb = avoidTotal - miss - dodge - parry;

The second and third lines prevent your avoidance going over 100% and start cutting down block.

Crit block chance:
critblocknosb = min(1/(1.5*179.28004) .* masteryRating + 12,100);
Same thing, it can't go over 100, so most of that is to prevent that.


Next, I figure out what exactly shield block does. Specifically, how much overflow you get when it's hit, so how much extra crit block is used. I don't figure out the block chance while shield block is up until later though:
overflow = max(0,block + 25 + dodge + miss + parry + 0.8 * moblevel - 100);
The block + 25 is because Shield Block uses the un-reduced value (For example, if your avoidance is 105%, then you hit Shield Block, you gain 30% crit block chance, if that makes sense). I also assume that Shield Block uses your base avoidance stats, not the stats modified by whatever you're fighting, hence the 0.8 * moblevel bit.

critblocksb = min(1/(1.5*179.28004) .* masteryRating + 12 + overflow,100);
Again, crit block can't go over 100.




Okay, next is the meaty bit. The stuff above, I'm fairly sure of and if there's a mistake there, I'll feel really really dumb. The stuff below is figuring out Shield Block's uptime and the block chance with Shield Block up, which is what I'm not sure of.

Firstly, figure out your accuracy:
hit = max(0,5 + moblevel - hitRating/120.1088);

expDodge = max(0,5 + moblevel / 2 - expRating/120.1088);

if moblevel >= 3
expParry = max(0,12.5 + moblevel / 2 - expRating/120.1088);
else
expParry = max(0,5 + moblevel / 2 - expRating/120.1088); EDIT: Corrected a typo
end

accuracy = 100 - hit - expDodge - expParry;

The variables are poorly named, I know, but it's the easiest way to do that. The if statement is because of the extra parry chance that boss level mobs get. This bit seems to work as expected.

Next, I just have a wee variable defined to be the chance that Shield Slam is modified by Sword and Board. This is just SS's cooldown divided by Rev's cooldown, multiplied by the proc chance:
sabchance = 6 / 9 * 0.6;

Second post coming
Waniou
Dath'Remar
Waniou
85 Draenei Warrior
9815
Edited by Waniou on 2/22/12 8:20 PM (PST)
Next, figuring out enrage uptime. This is one of the annoying bits that I'm not sure if I've done right. Basically, if enrage is up, your melee swings generate 50% more rage. Lasts for 6 seconds, procs from Berserker Rage, your own critical strikes and attacks made against you that are critical blocks.
The way I do this is basically (1 - (1 - crit chance)^attacks in 6 seconds * (1 - crit block chance)^attacks in 6 seconds * (1 - BR duration / cooldown)).
The crit chance part is:
(1 - critChance/100).^((6 .* (1+haste/100)) ./ 2.6 + (4 * 1/15)*accuracy/100)
(6 .* (1+haste/100)) ./ 2.6 represents your melee swings. Assuming a 2.6 speed weapon, there are 6/2.6 swings in Enrage's duration, modified by your haste.
(4 * 1/15)*accuracy/100 represents your special attacks. Specials are on a 2-roll system, so if the attack doesn't land, it doesn't have a chance to crit. The 1/15 represents 2 empty GCDs in a 30 second cycle (See my thread on empty GCDs).

The crit block chance is annoying, because it depends on shield block's uptime (Which is what we're currently calculating). I've basically just got a small loop here that finds out uptime, then adjusts crit block chance and repeats until it's stable. But basically, it's this:
(1 - (sbuptime * critblocksb * blocksb + (1-sbuptime) * critblocknosb * blocknosb) / 100).^(6 ./ swingSpeed)
swingSpeed here refers to the boss's swingSpeed.

The code in full looks like this:
critBRPart = (1 - critChance/100).^((6 .* (1+haste/100)) ./ 2.6 + (4 * 1/15)*accuracy/100) .* (1 - 6/30);
enrageUptime = 1 - (critBRPart .* (1 - (sbuptime * critblocksb + (1-sbuptime) * critblocknosb) / 100).^(6 ./ swingSpeed));


Lastly, we use this enrage uptime to figure out how quickly we fill our bucket of rage so we can dump it out on shield blocks:
rageBucket = 10/(1+haste/100) * (100 - hit) / 100 * 1.5 * enrageUptime + 10 / 6 * accuracy/100 * sabchance + 20/60;

10/(1+haste/100) * (100 - hit) / 100 / 100 * 1.5 * enrageUptime is your contribution from melee swings. 10 rage per second, modified by haste, your accuracy and enrage's uptime. Only missed attacks fail to generate rage, dodged and parried ones still do, lowering avoidance's contribution to melee swings.

10 / 6 * accuracy/100 * sabchance is Shield Slam's contribution.

20/60 is simply the 20 rage every 60 seconds from Battle/Commanding Shout.

The last part is to figure out how the free bonus block is added on. Since this will always happen when shield block is up, I basically add this to your block chance with shield block:
swingSpeed / (60 / rageBucket)
60/rageBucket is the time it takes to get 60 rage, so swingSpeed divided by that should be how many attacks get the free bonus block. So, the code looks like:

avoidTotalsb = min(miss + dodge + parry + block + 25 + swingSpeed / (60 / rageBucket),100);

blocksb = avoidTotalsb - miss - dodge - parry;



Lastly! Add it all together to get what your total damage reduction from avoidance is:
reduction = miss + dodge + parry + 0.3 * blocknosb .* (1 - sbuptime) .* (1 + critblocknosb / 100) + 0.3 * blocksb .* sbuptime .* (1 + critblocksb / 100);


So. That was long and mathy. Feel free to be confused and point out any obvious herp de derp mistakes I made.
-----
Attack tables, CTC, diminishing returns and you!
http://us.battle.net/wow/en/forum/topic/2489160859
Fasc
Korgath
Fasc
85 Night Elf Druid
12465
I personally have a huge aversion to MATLAB but I'll look it over later and see if I spot anything.
Ahanss
Thrall
Ahanss
85 Tauren Druid
7575
else
expParry = max(0,5 + moblevel - expRating/120.1088);

Should be the same as expDodge for that part, in other words it should be moblevel/2.
I have no idea what to make of the second post, so.... yeah.

Would also like some confirmation that exp even affects rage gen. Hitting a dummy:
hit: Generates 25 rage (50% from sentinel added).
Dodge/parry: Generates 16/17 rage (sentinel not added)
miss: Generates 0 rage.

For all I know it could be different on something that, well, isn't a target dummy.
Waniou
Dath'Remar
Waniou
85 Draenei Warrior
9815
Edited by Waniou on 2/20/12 7:58 PM (PST)
Nono, you could be right, I was just acting under the assumption that an attack that doesn't land generates no rage. But yeah, that's a typo there. Nice spot.

EDIT: Oh? You suggest anything better, Fasc?
-----
Attack tables, CTC, diminishing returns and you!
http://us.battle.net/wow/en/forum/topic/2489160859
Ahanss
Thrall
Ahanss
85 Tauren Druid
7575
Ah, sorry if I'm coming off as confrontational, I'm just interested in it. It does seem like a common (and sensible) assumption.
Waniou
Dath'Remar
Waniou
85 Draenei Warrior
9815
No, you didn't come across like that. I posted this here because I want people to pick it to pieces. Any mistakes you spot are appreciated.
-----
Attack tables, CTC, diminishing returns and you!
http://us.battle.net/wow/en/forum/topic/2489160859
Arianity
Mal'Ganis
Arianity
85 Blood Elf Priest
2665
I don't suppose you have commented code you could post to pastebin or something, for those of us who can't stand the forum's formatting? (if not it's fine)

02/20/2012 07:25 PMPosted by Waniou
The variables are poorly named, I know, but it's the easiest way to do that


It's better than "chips". ;)


I'm more offended by your camel caps.
Deathtime
Hyjal
Deathtime
85 Orc Death Knight
2070
Edited by Deathtime on 2/20/12 8:05 PM (PST)
Have you thought about checking landsoul's spreadsheet to look at how he calculates rage?

Though I guess that wouldn't include the new enrage mechanic in there which is probably the most difficult part about this.
Waniou
Dath'Remar
Waniou
85 Draenei Warrior
9815
Edited by Waniou on 2/20/12 8:03 PM (PST)
Camel caps are awesome because camels make me laugh for no decent reason. I just find camels funny. Hence, camel caps. Also, I meant they're poorly named because "hit" is actually calculating your miss chance. They're all somewhat backwards. And I do have code, but it's not that much different than that, except some of the comments are briefer in my actual code.

EDIT: Also, I've wanted to check out his spreadsheets but they all require a paid version of Excel, which I don't have.
-----
Attack tables, CTC, diminishing returns and you!
http://us.battle.net/wow/en/forum/topic/2489160859
Euliat
Gilneas
Euliat
85 Draenei Death Knight
8665
I have nothing to contribute other than I support using MATLAB. :P

It's what I did my simulator on.

And that I hate probabilities with a passion.
Deathtime
Hyjal
Deathtime
85 Orc Death Knight
2070
02/20/2012 08:40 PMPosted by Euliat
I have nothing to contribute other than I support using MATLAB. :P


We used data desk in my statistics class. Though MATLAB was on the computers.
Fasc
Korgath
Fasc
85 Night Elf Druid
12465
02/20/2012 07:56 PMPosted by Waniou
EDIT: Oh? You suggest anything better, Fasc?


For this? No. I just hate MATLAB over Mathematica for what I had to use them for in college, nothing more.
Waniou
Dath'Remar
Waniou
85 Draenei Warrior
9815
Fair enough. I always hated Mathematica because it had an annoying habit of doing weird crap that I didn't expect.
-----
Attack tables, CTC, diminishing returns and you!
http://us.battle.net/wow/en/forum/topic/2489160859
Krinu
Crushridge
Krinu
85 Night Elf Death Knight
9010
Not a huge fan of Matlab; I'd probably just write out an application in Java or C#. But I'm weird like that.

It's super late here, so I'll go over your numbers in the morning.
Celyndrashad
The Scryers
Celyndrashad
85 Blood Elf Paladin
7115
Edited by Celyndrashad on 2/21/12 2:38 AM (PST)
Sorry wani no time currently to check your maths but ill try and come back to this thread later.

02/20/2012 07:45 PMPosted by Fasc
I personally have a huge aversion to MATLAB but I'll look it over later and see if I spot anything.


They are making me use MathCad and i hate it with a passion. But then again i dislike most problems that i cant do by hand or excel. >.>
Dellingr
Doomhammer
Dellingr
85 Night Elf Warrior
13950
Other than the obvious things that are difficult to cover outside of a full simulation, It should mostly be accurate from what I can tell (short of typos that I'm too tired to spellcheck for.. ;p)
Communism
Boulderfist
Communism
85 Human Death Knight
8330
I think you're missing Battle Shout in the rage generation.
Muspel
Korgath
Muspel
85 Human Warrior
10840
02/20/2012 07:56 PMPosted by Waniou
Nono, you could be right, I was just acting under the assumption that an attack that doesn't land generates no rage.

Dodges, parries, and glancing blows all generate full rage. According to Landsoul, anyways.

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Click here to view the Forums Code of Conduct.

Report Post # written by
Reason
Explain (256 characters max)

Reported!

[Close]