Just to be sure, impetus adds 1% criticial hit rate per successive attack, or per successive pair of attack ? If it's the first case, then you shouldn't be averaging 9% but 17% ish. I think something is wrong in there and I'm sure I mentionned it on alla too.
It's 1% per attack. I think you are making a mistake in your calculations pchan. Motenten originally had the average bonus at 95% hit rate as 17ish, but that was a mistake in the formula. Think of it like this @ 95% accuracy on average, you hit 19 times and miss once. First hit gets no Bonus, so it goes:
1st hit=+0 crit, 2nd hit=+1 crit ......... 18th hit=+17 crit, 19th hit=+18 crit, 20th(miss)
Now that 20th hit actually does have a +19% crit, but it misses so it may as well be 0 from a damage stand point.
If you Average attacks 1-19 you get an average bonus of 9% crit, if you use 1-20 you get 8.55% crit.
Nah I'm right and I can prove it through 3 methods, but I guess the best of it is one of my parse on hpende that was done on alla on the 2/5/2011.
link here http://ffxi.allakhazam.com/forum.htm...5141608363&p=2
Spoiler: show
The test was spamming impetus on hpende every 1 sec for a whole night with a 203 delay weapon. Basically you parse the average crit% between uimpetus up and down and find 16.5% with 9% being the base crit rate outside of impetus (merits and 5% base).
On a side note the delay of the weapon seems to be important ; obviously with a 203 delay (like that club) you benefit less from impetus than capped H2H delay. Now with this club (and not a H2H), the following programm will simulate impetus behaviour
explanation : delta is the delay of the weapon (203 in the test). c represent the varying critical hit rate. N the number of rounds total (100k). y represents the number of crits total; hit represents the number of hits that connected bypassing the accuracy check. Therefore y/hit will give the average crit rate. z is the same except it counts crits while impetus is up. This program givesCode:delta:=203;x:=0;y:=0.0;z:=0.0:zz:=0.0:impetus:=0;c:=9;hit:=0;N:=100000; > for n from 1 to N do > x:=stats[random,uniform[0,1]](2); > if x[1]<=0.95 then hit:=hit+1; > > if impetus<=3*60*59 then zz:=zz+1: end if: > end if; > > if (x[2]<=c/100) and (x[1]<=0.95) then y:=y+1; > if impetus<=3*60*59 then z:=z+1: end if: > > > end if: > > if impetus<=3*60*59 then > if x[1]<0.95 then c:=min(c+1,50); else c:=9; end if: > else c:=9; end if: > > impetus:=impetus+delta: > if impetus>5*60*59 then impetus:=0; end if: > end do: y/hit; z/zz;
y/hit=16.359% critical hit rate globally just like in the test.
z/zz=20.82% critical hit rate when impetus is up.
That means impetus averages to +11.82% crit rate for that club.
you can build a similar program for H2H weapon. Let's try to be simple : with capped acc and normal merit / gear a monk/war is averaging 2.8 swings per round I think. If you have capped delay you get 106. Make it 106/2.8 delay per swing or an equivalent of a 38 delay weapon. Use the same procedure as above with delta=38 instead. You will find a global critical hit rate of 18.48% and an impetus critical hit rate of 24.62%. That means impetus averages out to +15.62% in this case. All this is done at capped accuracy.
It seemed wierd that the bonus doesn't depend on weapon delay anyway.
I honestly don't know shit about programming, so I really can't comment on your little test program there at all. I am quite confused however that it shows different delay weapons getting different average crit rate bonuses. As far as I know, delay of a weapon shouldn't effect something like that when talking about averages.
I suppose I'll have to wait for Motenten to pop up as either he'll notice something wrong, or your shit is a better way to represent average bonus and he will explain it in more layman's terms.
Obviously it does because you don't do the same number of rounds while impetus is up. To exagerate if I have no haste on something like RDM99/MNK00, that's 8 seconds per round or 22 rounds only while impetus is up. The delay doesn't matter only when you consider delay very small, but that's not your (only) mistake ; you are lacking a multiplication by 2 somewhere. As show in the example of lady bell and the parse you can't average it to 9% ; even if the delay was "low enough" to act as if impetus last for ever that would give
9+3/5*9=14.4% crit average
you find a 2% rate difference and the parse as 15k+ sample so basically has a very low condifence interval, so it doesn't match.
Well I got an approximate formula assuming the crit rate doesn't cap at +50% (it's unlikely to reach that much crit anyway). In this case I find the actual crit rate to be
p is the accuracy rate and N is the number of rounds that you can do while the 3 minutes of impetus are up.Code:(N-(1-p^N)/(1-p)) / ( 1/p -1 ) percent
If you have a delay d, then N=floor( 180*59 / d ).
When the delay is small enough, this formula approximates to p/(1-p).
If you apply this to p=0.95 (capped accuracy) and d=203 you find 12.3% crit rate added during impetus which matches about the simultaion and the parse.
Now to accurately handle H2H, considering the criterate can reset during a ws which is 4+ hits, you have to consider things like average rounds per WS and average hits per WS as well as the average number of WS per impetus session.
With standard gear it takes between 6 and 7 rounds per WS. Make it 6.5 rounds per WS. So the time it takes to do one ws plus one TP phase is (6.5*delay + 60). During this time you do ~2.8 swings per round plus ~4.5 hits during WS with verethragna. Make it 22.7 swings during (6.5*delay + 60) delay. You get an effective delay of (6.5*delay + 60)/22.7.
This gives 33 delay with a capped haste build. Inputting in the formula above that would give, with 95% accuracy, a +17.8% crit rate while impetus is up. This is slightly surestimated since the crit rate bonus actually caps at +50%. Comparatively, if you only had 40% haste that would give 16.9% crit rate. If you only had 25% haste that would be 16.44. If you had 0% haste that would be 15.6%.
Here is a table for haste equalling 0%, 25%, 40%, 60%, capped and accuracy being [50%,60%,70%,80%,90%,95%]
Code:haste=0% => crit(%)=0.9822238538, 1.466669726, 2.264203877, 3.822238538, 8.200079109,15.63305829 haste=25% => crit(%)=.9865455213, 1.474772852, 2.281010361, 3.865455213, 8.394548555, 16.44489713 haste=40% => crit(%)=.9891385218, 1.479634728, 2.291094252, 3.891385218, 8.511233480, 16.93648233 haste=60% => crit(%)=.9925958558, 1.486117230, 2.304539439, 3.925958558, 8.666813509, 17.59321393 haste=cap=> crit(%)=.9938897047, 1.488543196, 2.309571074, 3.938897047, 8.725036711, 17.83904393
1) Wrote a program to simulate what happens, and it generally confirms what pchan's saying.
F# code:
Spoiler: show
Modelled result for 100,000 samples with 9% base crit rate and 203 delay weapon, after including downtime, was about 16.25%. That matches the parsed data from the Alla post.
The number of hits landed within the time period increases the overall average. With a delay of 1, crit rate bonus seems to max out at around 17.5%. That matches the spreadsheet's model number (assuming the 2x value is applied) of 17.48%. Thus the spreadsheet's model can be considered valid only for infinitely high attack speeds.
The number of attacks made within the impetus time period is an increasingly significant factor as delay per hit goes up. However for mnk we generally have a rough minimum: ~21% haste in gear and a non-war subjob, giving about 2.5 attacks per round on average. With a +86 delay weapon (Spharai-class), that works out to an average delay per hit of about 115, and an average crit bonus (with capped accuracy) of 14.4%.
Now, the next question is why 17.5% instead of 8.75%? My original model had the 17.5% value, but discussions with diasetsu led me to believe that that was incorrect, so I changed it. At present it calculates the probability of getting exactly N hits in a row, and multiplies that by the average bonus provided during a sequence of N hits (which will generally be half of the maximum bonus), then sums up the products for the first 100 hits.
If I run the simulation on a set of 40, and get all 40 hits in a row, the average bonus is the expected 20% (one half the number of sequential hits). p^n calculation says I should expect to get 40 hits in a row 12.85% of the time. In the simulator, I got it 3 times in a row, 3 where there were misses in the sequence, then another instance of 40 in a row.
Since it looks like I'm getting 40 in a row about half the time (5 or 6 instances out of about a dozen tries), I need to take another look at how I'm generating the probability spread for N-hit sequences.
... Meh, too tired right now to work out what I did wrong. Will come back to it tomorrow.
Well it's kind of a problem when comparing AF3+2 body vs other body. We do agree on the 17.5% crit rate global so far, and for normal monk use, so that's a good start. I'm looking right now on the impact on critdmg, because crit% up and critdmg are no independent so even averaging both to 17.5% doesn't sound fair. Also there is attack which comes on top of it and multiplies the effects.
Ok well I worked out the effect of "critical damage up +1%" and "critical hit rate up" when combined through a basic simulation like above. I ran 100k rounds and compared the total damage during impetus for a setup with or without the "+1% crit damage per successful". It turns out that depending on the initial critrate, impetus averages out to
~+17% critical hit rate (9% on the spreadsheet)
~+21% to +25% crit damage (9% on the spreadsheet) depending on the initial crit% value.
It's not surprising seeing as crit% up and crit rate up happen at the same time.
Next step is to modelize the effect of attack combined with critrate, and even accuracy..
nvm
After checking how attack changes I get that for normal monk setups it's ~ +28 attack during impetus.
In the RDM spreadsheet, when I change my offhand weapon to a dagger, I go to the data tab and in the K-20/K-21 cells the values for W2 Damage and W2 Delay are both 0. Is that normal? It's only that way for offhand daggers. When my offhand is a sword or my mainhand is a dagger, those cells show the weapons' actual damage and delay.
just wanted to say thank you for the work that went into making these.
On Impetus:
@pchan:
Eh, crit damage should have nothing to do with the issue I'm trying to figure out.
For that matter, the crit damage increase should be identical to crit rate -- both go up by 1% per hit, so logically they should end up with absolutely identical average increases (aside from hitting caps due to different base values). Having such a dramatic difference between them in your simulation sounds like a red flag to me.
Also, your formula as written does not give the results you describe.
tl;dr of my meandering thoughts on what's going on, to figure out how I screwed up; can skip
Spoiler: show
Ok, continuing on the modelling project. It's taken a while, since it's been a lot of work writing it (learning how to use functional programming, and trying to avoid old programming idioms).
So now I have two different versions of the model: the first one, that I posted code for before, and a second one that generates lists that I can examine more closely.
The new version makes it much easier for me to be sure that the calculations are being run on the right values, and that the samples are being generated properly, etc. I trust it more than the first model, but at the same time I'm getting different results, so I'm not entirely sure.
Running 1 million samples on a low delay weapon, I consistantly get results that have shorter sequences in the new model, but higher bonuses.
EG (delay 35):
New: 18.63 average sequence length, 17.60 average bonus
Old: 19.67 average sequence length, 16.64 average bonus
The results are extremely consistant across runs (as might be expected with 1 million samples), with variance of maybe +/- 0.1.
If I put delay at 203, the average bonus converges, though the average sequence length remains different.
EG (delay 203):
New: 14.74 average sequence length, 12.30 average bonus
Old: 15.64 average sequence length, 12.26 average bonus
Overall, as weapon delay approaches 0, average bonus in the new code approaches (average sequence length - 1). I'm inclined to believe that value, given how the bonus is calculated.
On the other hand, the old code seems to converge on 16.66 as the bonus, which is a value that matches what I ended up with in Excel using this approach:
@ -- I basically went back to an older formulation (with some tweaks). Instead of working on average bonus per sequence, I just take the bonus ascribed to a given hit, combined with the probability that the hit N will occur. Probabilities are limited based on the maximum number of hits possible. As N grows large, the probability sum approaches 16.66.
So at this point I'm still not sure which one actually represents the system better.
Going to try a very simplistic version. Setting weapon delay to exactly 1 minute. This should result in 4-hit sequences most (81%) of the time, and generally approach the max bonus possible for the highest hit sequence much better than a low-delay model would.
Bonus is very easy to list:
1 hit: 0 (avg: 0.0)
2 hit: 1 (avg: 0.5)
3 hit: 2 (avg: 1.0)
4 hit: 3 (avg: 1.5)
So what is the model average?
New: Avg Bonus: 1.38 Avg Sequence: 3.48
Old: Avg Bonus: 0.93 Avg Sequence: 2.90
Average bonus of a 4-hit sequence would be 1.5. Being reduced slightly is expected since there will be occasional misses. 1.38 seems like a reasonable result. 0.93 seems too low. So generally seems to support the new code model as being the correct approach.
So now we need a way of formulating that result. pchan's formula results in a value of 5.51, which is way off. Will need to give it more thought.
If anyone wants the new version of the code to experiment with:
Spoiler: show
I went back and it seems I made an error when typing the formula (dividing by N it seems). Let me rewrite it
N=numbers of swings during impetus
a=accuracy rate (0.95 with capped accuracy)
main assumption is that there is no cap in crit%
The the rate of crit average is
In the case of when the weapon delay is 1 minute, N=4, a=0.95 and the formula gives 1.38% crit rate.Code:critrate=((1-a^N)/(1-a)-N)/ ( (1-1/a)*N )
I explain it below but you'll need basic probability understanding
Spoiler: show
There is a fundamental difference between the two in that crit is a chance to happen and critdmg always happen, also they do not vary independently. Anyway it's easy to input in a simulation and double check it, that is how I found it.@pchan:
Eh, crit damage should have nothing to do with the issue I'm trying to figure out.
For that matter, the crit damage increase should be identical to crit rate -- both go up by 1% per hit, so logically they should end up with absolutely identical average increases (aside from hitting caps due to different base values). Having such a dramatic difference between them in your simulation sounds like a red flag to me.
I need to think more about your problems, i find it mathematically interresting for modeling impetus anyway.
The way I see it, we have two methods for modeling impetus: Pchan's and Motenten's.
Motenten's consists in listing the different sequences of consecutive connected hits, calculating the probability of it apearing, and for each lists calculating the probability of a crit appearing, then averaging. Doing this method I effectively find something close to 9% critical hit rate bonus.
Pchan's consists in listing all hit and miss during the impetus duration, then for each swing attach to it a number equal to the crit % for that hit, then averaging. The simulation and his formula finds indeed 16% ish bonus, and is backed up by a parse.
I think the problem is : is accuracy checked before critical hit rate during impetus or not. Motenten's checks first accuracy then crit, pchan's checks first crit then accuracy... or something like that.
Normally, accuracy and critical hit rate are independent: in order to estimate your crit % you count the crits and divide by the connected hits. But during impetus, crical hit rate and accuracy are strongely connected by definition of the JA.
Now that I have understood both models of Pchan and motenten, I can give a clue as to why motenten's (on the spread sheet) is not right. Take the ideal situation of an infinite duration impetus with an uncapped critical hit rates and critical damage, where you also have a base critical hit rate of zero.
Here is the formula you'll get with motenten's model: if 'a' is your accuracy (a=0.95 for capped accuracy), your critical hit rate is
http://i224.photobucket.com/albums/d...impetus1-1.jpg
for a=0.95 that's +9.025% bonus.
Explaination:
Spoiler: show
Here is the forumula you get with Pchan's ( or simulations) model:
http://i224.photobucket.com/albums/d...z/impetus8.jpg
for a=0.95, that's +19%.
Spoiler: show
TL;DR: the error in montenten's spreadsheet is to approximate (average number of crits in long sequences of hit and misses)/(average number of hits in those sequences) by average(crits/hits inside one sequence of successful hits). The former is > to the latter (and in our case almost the double).
You can also find formulas for the critical hit damage.
Honestly, doing a simulation corresponding to the reality of finite length impetus, is much faster. This small Maple procedure works:
http://i224.photobucket.com/albums/d...z/impetus9.jpg
The program simulates 10,000 impetus, each having 300 attack rounds (so 3 million swings in total). Takes 10min to execute. The base critical hit rate was set to 30% (capped dDEX, 10% merits, rancor collar), and accuracy to 95%. You find:
+16.58% bonus to critical hit rate and +21.24% bonus to critical damage.
All right ! It took me some time but I got the exact formula (I think) that account for :
* +50% critrate cap
* the given of an initial critical hit rate
* super high delay (like 1 minute) and normal delay
On thing to note is that it's not enough to consider that if you start from c% critical hit rate, impetus always adds the same amount on average. Another thing to consider is that if your number of rounds during the 3 minutes of impetus is <50 or >= 50, the formula must be different since it caps out at 50. Here are the formula :
Let N=numbers of swings during 3 minutes.
Let a=accuracy rate.
Let c=your normal critical hit rate without impetus.
First formula : 1<=N<=50
It's not too frightening of a formula after all. This gives your critical hitrate as a global value, so in order to find the impetus bonus average you must substract c.Code:critrate=(N*a^2*c-a+N*a+a^(N+1)-N*a^2+N*c-2*N*a*c)/(-1+a)^2/N
Second formula : N>50
Way more complicated, because this time I accounted for the +50% critical rate cap.Code:critrate=((50*c*a^2+49*a+a^51-50*a^2+50*c-100*c*a)/(-1+a)^2+(N-50)*(a^49*c-a^50*c+49*a^49-48*a^50-c+c*a-a)/(-1+a)+(50+c)*a^50*(N-1/(-1+a)*a^N-50+1/(-1+a)*a^50))/N
If you want to apply it to H2H you will have to guess a number of hits during impetus. I think 320 is a good number (100 rounds with capped delay, used 2.8 swings on average per round, and added some for weapon skills - technically you can easily compute this in a spreadsheet).
eg :
for H2H, N=300 , 0% base crit rate, 95% accuracy : 16.42%
for H2H, N=300, 10% base crit rate, 95% accuracy : 26.39% (+16.39%)
for H2H, N=300, 15% base crit rate, 95% accuracy : 31.37% (+16.37%)
for H2H, N=300, 20% base crit rate, 95% accuracy : 36.35% (+16.35%)
for H2H, N=300, 30% base crit rate, 95% accuracy : 46.31% (+16.31%)
imaginary situations (infinite duration impetus) :
for H2H, N=30000000000, 30% base crit rate, 95% accuracy : 47.21% (+17.21%)
for H2H, N=30000000000, 0% base crit rate, 95% accuracy : 17.34%
Lower haste situations (40% haste, 150 swings)
for H2H, N=150, 0% base crit rate, 95% accuracy : 15.51%
for H2H, N=150, 15% base crit rate, 95% accuracy : 30.46% (+15.46%)
for H2H, N=150, 30% base crit rate, 95% accuracy : 45.41% (+15.41%)
Lower accuracy situations, capped haste
for H2H, N=300, 15% base crit rate, 90% accuracy : 23.34% (+8.34%)
for H2H, N=300, 15% base crit rate, 85% accuracy : 20.41% (+5.41%)
for H2H, N=300, 15% base crit rate, 80% accuracy : 18.86% (+3.86%)
for H2H, N=300, 15% base crit rate, 70% accuracy : 17.28% (+2.28%)
for H2H, N=300, 15% base crit rate, 50% accuracy : 15.98% (+0.98%)
60 sec delay weapon (imaginary)
4 hits, 0% base crit, 95% acc, 1.378%