Is this macro correct?

Warning: Theorycraft inside.

Moderators: Fridmarr, Worldie, Aergis, theckhd

Is this macro correct?

Postby Celyn » Mon May 02, 2011 10:35 pm

A while back i came up with a formula showing exactly how much higher your UNBUFFED parry needed to be (RATINGS-wise) than dodge to account for agility and raid buffs. I came up with this formula:

====Paladin======
For when using mastery food
Parry-dodge={[(agility+549)*1.05-base agility]*0.58}-{[(str+549)*1.05-str]*0.25}

=====DK/Warrior=====
For when using mastery food
Parry-dodge={[(agility+549)*1.05-base agility]*0.41}-{[(str+549)*1.05-str]*0.25}

=====Key========
Parry=total unbuffed parry rating
dodge=total unbuffed dodge rating
str=total unbuffed strength
agility=total unbuffed agility
base agiltiy=your base agility (mouseover your agility and it will show your base agility in white)

Since then my friend Xayton asked me to make it into a macro. After a bit of help from some friends i came up with these macros (you MUST be unbuffed for these to work):


====Paladin Macro===
Code: Select all
/run local _,s,p,n=UnitStat("player",2) print("Must beunbuffed. Try to keep Parry Rating this much higher than dodge: "..string.format("%.2f", (((UnitStat("player", 2)+549)*1.05-(s-p+n))*0.58)-(((UnitStat("player",1)+549)*1.05-UnitStat("player",1))*.25)))


====DK/Warrior Macro===
Code: Select all
/run local _,s,p,n=UnitStat("player",2) print("Must beunbuffed. Try to keep Parry Rating this much higher than dodge: "..string.format("%.2f", (((UnitStat("player", 2)+549)*1.05-(s-p+n))*0.41)-(((UnitStat("player",1)+549)*1.05-UnitStat("player",1))*.25)))


However, my friends of the tanking forum are getting some strange values but for the life of me I do not see the error. Paladins using agility gear seems to be around 300parry higher than dodge, and warriors without agility gear are as low as 75 (does not account for HtL).

Are these numbers correct or did i mess up a calculation?

Any and all help is appreciated.
"When I was ten, I read fairy tales in secret and would have been ashamed if I had been found doing so. Now that I am fifty I read them openly. When I became a man I put away childish things, including the fear of childishness and the desire to be very grown up." -C.S. Lewis
User avatar
Celyn
 
Posts: 28
Joined: Mon Feb 22, 2010 12:50 pm

Re: Is this macro correct?

Postby RedAces » Tue May 03, 2011 1:07 am

hey,

Celyn wrote:====Paladin======
For when using mastery food
Parry-dodge={[(agility+549)*1.05-base agility]*0.58}-{[(str+549)*1.05-str]*0.25}

I don't understand the bolded part, why do you substract the base agi ? Then you'd have to substract the base str too ... but your macros don't substract the base str (or do they? You're doing it differently and I can't figure it out^^). But... base agi and str also contribute to dodge & parry, doesn't they?

Bye, RedAces.
Image
User avatar
RedAces
 
Posts: 500
Joined: Tue Dec 01, 2009 9:39 am
Location: Germany

Re: Is this macro correct?

Postby Celyn » Tue May 03, 2011 1:29 am

Dodge from base agility does not count toward DR. So i had to subtract the base agility out. Furthermore dodge from agility does not show on your character sheet at all so i had to convert ALL of it (once calculated for buffs) to dodge rating (100agiilty=58 dodge rating) in order to find the dodge gain from agility both before and after raid buffs.

Parry from str on the other hand does show on the character sheet so i only needed to figure out how much more parry rating i was getting from buffs only. Thats why i subtract str out but not the base str out. Thats already been calculated on your character sheet.

Once dodge from ALL your raid buffed agility (minus the base) has been calculated you subtract out the parry you get from raid buffs and you find how much parry you have to make up to balance the ratings when agility and raid buffs have been applied. This will give you (in theory) maximum avoidance.

I hope that made sense im horrible at putting my math into words >.<
"When I was ten, I read fairy tales in secret and would have been ashamed if I had been found doing so. Now that I am fifty I read them openly. When I became a man I put away childish things, including the fear of childishness and the desire to be very grown up." -C.S. Lewis
User avatar
Celyn
 
Posts: 28
Joined: Mon Feb 22, 2010 12:50 pm

Re: Is this macro correct?

Postby RedAces » Wed May 04, 2011 2:13 am

hey,

ok that agi/str thing very weird, did you confirm this?
Otherwise... just to strike out the obvious bugs, are these warriors in Def-stance / Def-specc, etc?

Mh... I don't understand your problem, you're saying paladins with high agi need much more parry than warriors with almost no agi ? That's to be expected!
Paladins gain much more dodge from agi, so we need more parry to offset this. So if a warrior and a paladin has the exact same agility - we'd still need more parry than him (~40% more?)
Paladins and warriors without much agi won't need much parry to offset this.
Have you checked their rating #s ?
From what you tell, there's nothing wrong with your macro (if this weird str/agi thing is real^^)

Bye, RedAces.
Image
User avatar
RedAces
 
Posts: 500
Joined: Tue Dec 01, 2009 9:39 am
Location: Germany

Re: Is this macro correct?

Postby RedAces » Wed May 04, 2011 2:45 am

hey,

just tested it: I have 339 agi (245 from gear) and 3284 str (3119 from gear) and your macro says I need 301.11 more parry than dodge.
Without any agi-gear (94 agi and 3504 str) it says: 149.15 more parry than dodge.
I think the 149 comes from the 549 Agi/Str Buff you'll get in a raid, Agi is more than twice as effective as str (pre DR).
I can't say if this numbers are 100% true but they are in the right ball park (for me).

Bye, RedAces.
Image
User avatar
RedAces
 
Posts: 500
Joined: Tue Dec 01, 2009 9:39 am
Location: Germany

Re: Is this macro correct?

Postby Celyn » Wed May 04, 2011 3:19 am

Thanks for the thorough fact check thats mainly what im looking for. That or someone telling me my formula is all wrong =P.

My friend has the prot paladin guide sticky on the official forums and i want to make 100% sure im not messing something up before he posts it >.<

Thank you for tanking so much time out to test it =D
"When I was ten, I read fairy tales in secret and would have been ashamed if I had been found doing so. Now that I am fifty I read them openly. When I became a man I put away childish things, including the fear of childishness and the desire to be very grown up." -C.S. Lewis
User avatar
Celyn
 
Posts: 28
Joined: Mon Feb 22, 2010 12:50 pm

Re: Is this macro correct?

Postby Cavalorn » Wed May 04, 2011 7:20 am

The formula seems to be correct, I use the same one for my selfmade-spreadsheet.
I'm not a macro-specialist, but spent many hours with programming in school.

Did I miss/missunderstand a part of the macro, but where do you fill the variables s and p with values?
N is filled with charsheet-agi at the beginning.
Variables with no specific value will be filled with random numbers. Perhaps there is a command to pull out base-agi from the charsheet. I think gathering base-agi from the race wouldn't fit in this macro.
Cavalorn
 
Posts: 18
Joined: Tue Apr 14, 2009 4:00 am
Location: Austria

Re: Is this macro correct?

Postby Zalaria » Wed May 04, 2011 7:33 am

Cavalorn wrote:The formula seems to be correct, I use the same one for my selfmade-spreadsheet.
I'm not a macro-specialist, but spent many hours with programming in school.

Did I miss/missunderstand a part of the macro, but where do you fill the variables s and p with values?
N is filled with charsheet-agi at the beginning.
Variables with no specific value will be filled with random numbers. Perhaps there is a command to pull out base-agi from the charsheet. I think gathering base-agi from the race wouldn't fit in this macro.


It's something about how LUA works.

Code: Select all
local _,s,p,n=UnitStat("player",2)

UnitStat returns 4 values, which he stores in the underscore, s, p, and n. (The underscore is unused, but is needed for positioning)
Dovie'andi se tovya sagain - It's time to roll the dice
User avatar
Zalaria
Maintankadonor
 
Posts: 647
Joined: Tue Sep 11, 2007 7:27 am

Re: Is this macro correct?

Postby Cavalorn » Wed May 04, 2011 8:15 am

Interresting notation, I thought C++ was dirty ;)
If I read this right, the macro put the returnvalue vor base-agi in the _ variable.

Hmm, will be easier to check this ingame :D
Cavalorn
 
Posts: 18
Joined: Tue Apr 14, 2009 4:00 am
Location: Austria

Re: Is this macro correct?

Postby Celyn » Wed May 04, 2011 9:52 pm

Lol yeah the numbers are stored in s, p, and n at the start of the macro. I had to do that to make it compute base agility from the formula.

Being new to script macros i had another friend help me and he formed the basis of the macro for me but could not get it to work. I used that (mainly the unitstat command) and the CTC macro as a basis and thru trial and error formed my macro. However, when i got to base agility i had no clue how to pull that up. I had to make a post on the macro forums to figure it out:

http://us.battle.net/wow/en/forum/topic/2456479769
"When I was ten, I read fairy tales in secret and would have been ashamed if I had been found doing so. Now that I am fifty I read them openly. When I became a man I put away childish things, including the fear of childishness and the desire to be very grown up." -C.S. Lewis
User avatar
Celyn
 
Posts: 28
Joined: Mon Feb 22, 2010 12:50 pm

Re: Is this macro correct?

Postby Cavalorn » Wed May 04, 2011 11:00 pm

Maybe I have enough time in the evening to check this for my dwarf.
If it works correctly I would like to put this macro in the german Prot-Guide and ajust my self-made spreadsheet....if this is ok for you.
Cavalorn
 
Posts: 18
Joined: Tue Apr 14, 2009 4:00 am
Location: Austria

Re: Is this macro correct?

Postby Celyn » Thu May 05, 2011 12:00 am

If you like it sure!!!

Thats what i made it for to help people. On the official forums people are asking about dodge and parry all the time and its for them that i made it!
"When I was ten, I read fairy tales in secret and would have been ashamed if I had been found doing so. Now that I am fifty I read them openly. When I became a man I put away childish things, including the fear of childishness and the desire to be very grown up." -C.S. Lewis
User avatar
Celyn
 
Posts: 28
Joined: Mon Feb 22, 2010 12:50 pm

Re: Is this macro correct?

Postby Cavalorn » Fri May 06, 2011 2:51 am

Got a few strange values yesterday >300 Rating where ~16 should be the right answer for my gear.
Taking off the agi-items reduced the rating needed to ~100 instead of a negative value due to dropping dodge under parry with raidbuffs.
Need some more testing this weekend.
Cavalorn
 
Posts: 18
Joined: Tue Apr 14, 2009 4:00 am
Location: Austria

Re: Is this macro correct?

Postby RedAces » Fri May 06, 2011 3:11 am

hey,

errm ... you need base agi and current agi, right ? UnitStat returns base, current, positiveBuffs, negativeBuffs, so you'll just need to first 2 return-vals: base = current-positiveBuffs+negativeBuffs ?? (Login-servers are down, so I can't check it -.-)
And if you do things like a=UnitStat(..) or just UnitStat(..) it will always take the first return-val given, so UnitStat(1) will give you the base str! You can use select(2, UnitStat("player")) to get the 2nd return-val of UnitStat("player").

Code: Select all
/run local b_a,a=UnitStat("player",2) local _,s=UnitStat("player",1) print("Must be unbuffed. Try to keep Parry Rating this much higher than dodge: "..string.format("%.2f", ((a+549)*1.05-b_a)*0.58)-(s*0.0125+144.1125))


This macro will (almost*) ALWAYS report positive values, it will just output how much more parry you need to offset your agi. It doesn't factor in your current dodge / parry ratings!

*: the breakpoint would be at [(agi+549)*1.05-base_agi]*0.58 = [(str+549)*1.05-str]*0.25
Assuming you have only 55 agi from gear (the Leg enchant) and 94 base agi:
(698*1.05 - 94)*0.58 = ((str+549)*1.05 - str)*0.25
699.32 = (str*0.05 + 576.45)*0.25
str = 44416.6
At 44416.6+ strength you'll get negative results.

If you want to know how much more parry rating you need in your current setup (e. g. for reforging or gemming) you'll need something like this:
Code: Select all
/run local b_a,a=UnitStat("player",2) local _,s=UnitStat("player",1) print("For perfect avoidance you need this much more parry rating: "..string.format("%.2f", ((a+549)*1.05-b_a)*0.58+GetCombatRating(3))-(s*0.0125+144.1125+GetCombatRating(4)))



Bye, RedAces.
Image
User avatar
RedAces
 
Posts: 500
Joined: Tue Dec 01, 2009 9:39 am
Location: Germany

Re: Is this macro correct?

Postby RedAces » Fri May 06, 2011 8:06 am

hey,

apparantly UnitStat returns
current, current, positive, negative - why I'm not sure!

Both macros corrected:
Code: Select all
/run local _,a,p,n=UnitStat("player",2) print("Must be unbuffed. Try to keep Parry Rating this much higher than dodge: "..string.format("%.2f", ((a+549)*1.05-p+n)*0.58)-(UnitStat("player",1)*0.0125+144.1125))


Code: Select all
/run local _,a,p,n=UnitStat("player",2) print("For perfect avoidance you need this much more parry rating: "..string.format("%.2f", ((a+549)*1.05-p+n)*0.58+GetCombatRating(3))-(UnitStat("player",1)*0.0125+144.1125+GetCombatRating(4)))


Bye, RedAces.
Image
User avatar
RedAces
 
Posts: 500
Joined: Tue Dec 01, 2009 9:39 am
Location: Germany

Next

Return to Advanced Theorycraft and Calculations

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 1 guest

Who is online

In total there are 3 users online :: 2 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 380 on Tue Oct 14, 2008 6:28 pm

Users browsing this forum: Exabot [Bot], Google [Bot] and 1 guest