ccbrown / xiv-sim

Simulator for Final Fantasy 14.
MIT License
13 stars 11 forks source link

DoT and Critical Hit Rate #34

Open asmoranomar opened 10 years ago

asmoranomar commented 10 years ago

Before I identify the issue, let me start by explaining what it is I was trying to do. I was in the middle of scripting a rotation for bard that consists of checking for "internal-release" aura and applying "windbite" and "venomous-bite" accordingly, so that my "bloodletter" has a higher chance of resetting. In the game, I often re-apply my DoTs just as internal release is wearing off so that my DoTs benefit from the extra crit chance even though I am no longer under the effect of internal release. This is what I was attempting to achieve in the script. Unfortunately, the damage calculator shows a negligable difference in the number of bloodletter procs and I was confused why.

My investigations found that (and I am no programming expert so I could be wrong) what appears to be a possible bug in the Base::tickCriticalHitChance function. It appears that critical hit chance is calculated every tick based on the buffs you currently have at the time of the tick. This is not the case in the game - damage and, more importantly, crit chance is based on the buffs you had at the time they were applied.

This could be one of the reasons why the BRD parse is on the low end. Internal release is 15s long, but you could extend the chance for bloodletter procs by an additional 18s if you time your skills correctly.

For reference, this is the section of the script I was trying to use:

if (AuraTimeRemaining(self, "internal-release", self) > 0.0) {

if (AuraTimeRemaining(self, "internal-release", self) < 2.5) use "venomous-bite";

if (AuraTimeRemaining(self, "internal-release", self) < 5.0) use "windbite";

if (AuraTimeRemaining(self, "internal-release", self) < 7.5) use "straight-shot";

if (AuraTimeRemaining(self, "internal-release", self) < 10.0) use "heavy-shot";

if (AuraTimeRemaining(self, "internal-release", self) < 12.5) use "venomous-bite";

if (AuraTimeRemaining(self, "internal-release", self) < 15.0) use "windbite"; }

ccbrown commented 10 years ago

I believe the critical hit chance is snapshotted correctly. If you look in Actor::applyAura, you'll see that the tickCriticalHitChance at the time that the aura is applied is stored along with the application:

application.tickCriticalHitChance = source->_configuration->model->tickCriticalHitChance(source);

Then when the tick damage is generated later, we use this value:

ret.isCritical = (distribution(*_rng) < application.tickCriticalHitChance);

asmoranomar commented 10 years ago

Hrmm...

Alright, I figured my lack of programming experience would backfire on me. So let me throw this one at ya:

I've run thru several cases with the same seed. One would expect to see a significan't number of bloodletters over the initial template (esp since the initial template might never apply buffed DoTs during the window that internal release is up), but in most cases the number of bloodletter procs decreases. This is just baffling and shouldn't be the expected result out of a better crit management rotation.

Also, and this might be a seperate issue, but I've noticed that in-game i can easily weave 2 off gcd abilities between my on gcd. The calculator on the other hand, does not (when using my stats).