Recently I tried to compare not just the DPS of two builds, but also plot the resource costs and cooldowns over a varying period of time. After I finished, I realized that I'd be easier to code something in PHP that does it for me automatically, so I'd be able to change the variables (Time, CDR, RCR, etc.) around and have it spit out a graphable result for me without having to manually do each step. So far it's working for the original comparison I had in mind, however I'm interested in expanding its capabilities so I can compare pretty much any DH builds in a wide variety of situations. To do this however, I need to find out some information about the way damage is calculated, such as which bonuses are additive with each other, and which are multiplicative. I'm not really sure where to find this, so I'd appreciate any and all links and information that could be provided.
The code in its current form is located here: http://pastebin.com/w2FtzNYJ if you want to get a better idea of what I'm trying to do/want to test it out for yourself. It's not finished, so there are some unused intergers and crap that are sitting around for later. Like I said, I'd appreciate any and all information on Diablo's damage calculations, no matter how obvious it may seem, just to be sure I won't miss anything.
I know that your PHP code is just for you and it really doesnt matter, but there are some things which make me cringe...
You already use indices for you elemental damage types. Why not store you elemental damage bonuses in an array? Then you don't need to make huge if then if then if then statements:
// elements in this order starting at 1: fire, cold, phys, lightning
$elementalBonuses = array(1 => 1.00, 1.00, 1.00, 1.00);
// later ...
$generator1->damage = $generator1->damage * $elementalBonuses[$generator1->element];
I dont want to make programming course out of this thread but those classes man...Just use associative arrays, if you want to want to store some data under the same name.
The only real use case for a class in your code would be for the cooldown skills Preparation and Companion:Bat. You would want to create ONE class to define the structure of a hatred-generating cooldown and then create two objects of this class.
Also you are using the interval = 1/APS for your loop. This implies, that your simulation cannot use Preparation/CompanionBat during the interval. Only at the start of a new interval...feels weird to me.
Lol I appreciate both the link and the advice. I'm aware that my shit isn't polished, I learned just by fucking around with it for the most part. I realize I'm not exactly using classes correctly, I just like using them because it helps me organize the whole thing in my head. And yea, it isn't exactly smooth the way that the cooldowns are managed, but I didn't need the to be super optimized/accurate yet. When I need them to I'll probably have to look at counting frames instead of using the system I am now.
EDIT: You wouldn't happen to know if Sentry Damage works like Hydra Damage does, would you?
I've been working on a simple spreadsheet for private use, and I was thinking about posting/not posting it, in fact, I think I had a draft for a post somewhere, if you want, I can share the spreadsheet with you (or at least the formulas to double-check). Be aware that it's very simple, you input two different itemizations and it tells you which one is better and how much.
e:
The only downside about that kind of programs is that if you don't put a limit on the constrains, they are always going to tell you 90% RCR and 90% IAS is the best option, but that itemization is not achievable, so you need to, using brute force, explore all possibilities and discard the ones that are unachievable or define the constrains perfectly when using some optimizations algorithms like SIMPLEX.
Another kind of limit is representing the results, as sometimes the number of variables is so great that creating a graph is really hard.
I'd appreciate you sharing the formulas, thanks for the offer.
EDIT: Another thing I'm looking for is the proc rate of Immolation Arrow, if anybody know that answer to that.
Recently I tried to compare not just the DPS of two builds, but also plot the resource costs and cooldowns over a varying period of time. After I finished, I realized that I'd be easier to code something in PHP that does it for me automatically, so I'd be able to change the variables (Time, CDR, RCR, etc.) around and have it spit out a graphable result for me without having to manually do each step. So far it's working for the original comparison I had in mind, however I'm interested in expanding its capabilities so I can compare pretty much any DH builds in a wide variety of situations. To do this however, I need to find out some information about the way damage is calculated, such as which bonuses are additive with each other, and which are multiplicative. I'm not really sure where to find this, so I'd appreciate any and all links and information that could be provided.
The code in its current form is located here: http://pastebin.com/w2FtzNYJ if you want to get a better idea of what I'm trying to do/want to test it out for yourself. It's not finished, so there are some unused intergers and crap that are sitting around for later. Like I said, I'd appreciate any and all information on Diablo's damage calculations, no matter how obvious it may seem, just to be sure I won't miss anything.
EDIT: You wouldn't happen to know if Sentry Damage works like Hydra Damage does, would you?
EDIT: Another thing I'm looking for is the proc rate of Immolation Arrow, if anybody know that answer to that.