Skip to content
Maintankadin

Theck's MATLAB thread - Cataclysm/4.x

tlitp
Wed Aug 04, 2010 9:27 am

Re: Theck's MATLAB thread - Cataclysm/4.x

@ Marblehead :
  1. not an issue
  2. consumables/buff_model is a mix of WIP/NYI, don't worry about it for now; as for the dependency issues - hm, that's actually a good question
  3. introduced in r15 by Theck, it was probably an attempt to use an entity that is directly available to a player (character panel on armory profile); double floor() is redundant, of course
  4. fixed; tauren is NYI, player_model will have to be rechecked anyway (later beta builds)
  5. standard professions are now handled by PM+SM; LotP is fixed
  6. probably an oversight; cloak slot does grant base armor, but any +armor enchant counts as extra armor

Testing dependencies on b12644
- check the total stamina without gear/talent points (/spec)
- equip a stamina-heavy gear set, check the total stamina (still untalented)
- eat something (keep in mind the stamina bonus it grants), throw a BoK, check the total stamina (again, untalented)
Gaffer
Wed Aug 04, 2010 12:49 pm

Re: Theck's MATLAB thread - Cataclysm/4.x

Tested on my level 83 Dwarf Paladin
Naked, no spec: 152
Stamina Set, no spec: 3969
Stamina Set, no spec, food buff, BoK: 4209
theckhd
Wed Aug 04, 2010 2:34 pm

Re: Theck's MATLAB thread - Cataclysm/4.x

mod.AotL gets wrapped directly into a crit percentage, and doesn't show up anywhere else. If I defined it as 0.06, then I'd need to multiply it by 100 later in the one place I used it. Makes more sense to just define it as 6.

player.armorystr should spit out the STR value that you read off of your character sheet on the armory. I started using armory strength as the plot axis for the TPS Stat calculation files, because I wanted something that was easier and more universal than fully raid-buffed STR. It's a lot easier to just check your armory and see what it says your STR is than it is to round up some friends to buff you.

Since I plan on using it again, I just integrated it into the player structure in stat_model. The reasoning behind the double floors is ... well, there isn't any. I copy/pasted the player.str line, deleted the arguments that didn't go into armory strength, and changed the field name. I just forgot to get rid of the redundant floor.

Similarly with the cloak enchant - I was rushing to get the slots all implemented and typed the wrong thing without thinking. That's exactly why I asked for help looking over the code. Who knows how long that would have gone unnoticed if it was just tlitp and I working on the project!

Seperate topic: I just noticed that I've accidentally replaced the inherent mod() and dot() functions with structures. I've already renamed the dot structure, and I'm thinking we should probably rename the mod structure as well, despite the fact that I really like the name mod. I can't decide between "mdf" and "mo" but I'm leaning towards the latter. Any opinions on that?
Marblehead
Wed Aug 04, 2010 2:43 pm

Re: Theck's MATLAB thread - Cataclysm/4.x

Stat dependency testing

I'll name the following sets of formulae "Expected_1" and "Expected_2" respectively:

Expected_1:
Code: Select all
player.str=floor((base.str+gear.str+cons.str).*mod.BoK);
player.sta=floor(floor((base.sta+gear.sta+cons.sta).*(1+mod.TbtL)).*mod.BoK);

Expected_2:
Code: Select all
player.str=floor(base.str.*mod.BoK)+floor((gear.str+cons.str).*mod.BoK);
player.sta=floor(base.sta.*(1+mod.TbtL).*mod.BoK)+floor((gear.sta+cons.sta).*(1+mod.TbtL).*mod.BoK);


(I omitted mod.mining, mod.SoE, mod.PWF and extra in this test. That causes player.agi and player.int to have the same formula as player.str, thus they're not included)

Specimen: Level 83 Paladin

Tests: 1) naked, 2) heavy-stamina gear, 3) heavy-stamina gear plus consumables (+40 str/+40 sta food)

Variations for every test: a) untalented, b) untalented w/ BoK, c) talented (TbtL), d) talented /w BoK


1. Naked

a. untalented

Code: Select all
Strength   164
Stamina    152

b. untalented /w BoK

Code: Select all
          | Real | Expected_1 | Expected_2 |
----------|------|------------|------------|-
Strength  |  172 |     172    |     172    |
Stamina   |  159 |     159    |     159    |

OK

c. talented

Code: Select all
          | Real | Expected_1 | Expected_2 |
----------|------|------------|------------|-
Strength  |  164 |     164    |     164    |
Stamina   |  174 |     174    |     174    |

OK

d. talented /w BoK

Code: Select all
          | Real | Expected_1 | Expected_2 |
----------|------|------------|------------|-
Strength  |  172 |     172    |     172    |
Stamina   |  183 |     182    |     183    |

Expected_1 is off. This is caused by flooring after multiplying with mod.TbtL, before multiplying with mod.BoK. However, if we don't floor after multiplying with mod.TbtL, we'll get wrong values later on.


2. Heavy-Stamina Gear

a. untalented

Code: Select all
          | Real | Expected_1 | Expected_2 |
----------|------|------------|------------|-
Strength  | 1637 |    1637    |    1637    |
Stamina   | 3450 |    3450    |    3450    |

OK

b. untalented /w BoK

Code: Select all
          | Real | Expected_1 | Expected_2 |
----------|------|------------|------------|-
Strength  | 1718 |    1718    |    1718    |
Stamina   | 3622 |    3622    |    3621    |

Expected_2 is off. This is caused by flooring before adding.

c. talented

Code: Select all
          | Real | Expected_1 | Expected_2 |
----------|------|------------|------------|-
Strength  | 1637 |    1637    |    1637    |
Stamina   | 3966 |    3967    |    3966    |

Expected_1 is off. This is caused by adding before flooring.

d. talented /w BoK

Code: Select all
          | Real | Expected_1 | Expected_2 |
----------|------|------------|------------|-
Strength  | 1718 |    1718    |    1718    |
Stamina   | 4165 |    4165    |    4165    |

OK


3. Heave-Stamina Gear + Consumables

a. untalented

Code: Select all
          | Real | Expected_1 | Expected_2 |
----------|------|------------|------------|-
Strength  | 1677 |    1677    |    1677    |
Stamina   | 3490 |    3490    |    3490    |

OK

b. untalented /w BoK

Code: Select all
          | Real | Expected_1 | Expected_2 |
----------|------|------------|------------|-
Strength  | 1760 |    1760    |    1760    |
Stamina   | 3664 |    3664    |    3663    |

Expected_2 is off. This is caused by flooring before adding.

c. talented

Code: Select all
          | Real | Expected_1 | Expected_2 |
----------|------|------------|------------|-
Strength  | 1677 |    1677    |    1677    |
Stamina   | 4012 |    4013    |    4012    |

Expected_1 is off. This is caused by adding before flooring.

d. talented /w BoK

Code: Select all
          | Real | Expected_1 | Expected_2 |
----------|------|------------|------------|-
Strength  | 1760 |    1760    |    1760    |
Stamina   | 4213 |    4213    |    4213    |

OK


So, both sets are wrong. They must actually be a little bit more complicate that we thought.
theckhd
Wed Aug 04, 2010 2:56 pm

Re: Theck's MATLAB thread - Cataclysm/4.x

Could you give us the gear.str and gear.sta values for the different configurations so I can double-check this and mess around with possible solutions?
<edit> Nevermind, I can calculate them myself from the untalented & unbuffed configuration. BRB, need more coffee.

Also, did you try round() instead of floor() at all?