Item Search
     
BG-Wiki Search
+ Reply to Thread
Page 5 of 47 FirstFirst ... 3 4 5 6 7 15 ... LastLast
Results 81 to 100 of 930

Thread: DPS Spreadsheets     submit to reddit submit to twitter submit to tumblr

  1. #81
    Banned.

    Join Date
    Jun 2007
    Posts
    2,590
    BG Level
    7

    Quote Originally Posted by Motenten View Post
    It's more that it's considering melee accuracy to limit the value of the possible bonus during weaponskills. If you have an 80% melee hit rate and a 95% weaponskill hit rate, the average expected bonus you'd get during the weaponskill is not the same as it would be if your melee hit rate was 95%.
    Got it.

  2. #82
    Banned.

    Join Date
    Jun 2007
    Posts
    2,590
    BG Level
    7

    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.

  3. #83
    New Spam Forum
    Join Date
    Jun 2010
    Posts
    183
    BG Level
    3
    FFXI Server
    Quetzalcoatl

    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.

  4. #84
    Banned.

    Join Date
    Jun 2007
    Posts
    2,590
    BG Level
    7

    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

    [QUOTE]
    Quote Originally Posted by lynnminmay
    I parsed the whole night with lady bell, on monk, spaming impetus every 1 second to be certain I don't miss any.

    So far I average 16.39% critrate (10k hits, 95% accuracy)


    Against Om'hpende with 62 str and 62 dex so I hit for 0 with a D1 club and I have a base 9% crit (crit rate floored + merits).

    The following program simulates an infinite duration impetus and calculates the global crit rate bonus over time
    [pre]
    x:=0;y:=0.0;impetus:=0;c:=0;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; end if;
    > if (x[2]<=c/100) and (x[1]<=0.95) then y:=y+1; end if:
    > if x[1]<=0.95 then c:=min(c+1,50); else c:=0; end if:
    > end do: y/hit;
    [/pre]

    with 100k rounds we find 17.4% on average

    The following program simulates the use of impetus every 5 minutes and calculates the global crit rate bonus over time (203 delay = what I get with lady bell and 6% haste, and crit bonus capping at 50%)

    [pre]
    restart;delta:=203;x:=0;y:=0.0;impetus:=0;c:=0;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; end if;
    > if (x[2]<=c/100) and (x[1]<=0.95) then y:=y+1; end if:
    >
    > if impetus<=3*60*59 then
    > if x[1]<0.95 then c:=min(c+1,50); else c:=0; end if:
    > else c:=0; end if:
    >
    > impetus:=impetus+delta:
    > if impetus>5*60*59 then impetus:=0; end if:
    > end do: y/hit;
    [/pre]

    With 100k rounds we find 7.5%

    7.5% + 9%=16.5% so I think it's correct that impetus is +1% per crit. Unsure about the actual cap value since using 30% or 70% in the simulation doesn't give much difference.


    I will post the final parse later.


    [pre]

    Melee Damage
    Player Melee Dmg Melee % Hit/Miss M.HR % M.Acc % M.Low/Hi M+0.Avg M-0.Avg #Crit C.Low/Hi C-0.Avg Crit%
    Pimpchan 0 0.00 % 15483/802 95.08 % 95.08 % 0/0 0.00 NaN 2562 0/0 0.00 16.55 %



    [/pre]





    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
    Code:
    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;
    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 gives
    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.

  5. #85
    New Spam Forum
    Join Date
    Jun 2010
    Posts
    183
    BG Level
    3
    FFXI Server
    Quetzalcoatl

    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.

  6. #86
    Banned.

    Join Date
    Jun 2007
    Posts
    2,590
    BG Level
    7

    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.

  7. #87
    Banned.

    Join Date
    Jun 2007
    Posts
    2,590
    BG Level
    7

    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

    Code:
    (N-(1-p^N)/(1-p)) / ( 1/p -1 ) percent
    p is the accuracy rate and N is the number of rounds that you can do while the 3 minutes of impetus are up.
    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

  8. #88
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    1) Wrote a program to simulate what happens, and it generally confirms what pchan's saying.

    F# code:
    Spoiler: show
    Code:
    open System.Text
    
    // object for getting random numbers
    let rnd = System.Random()
    
    // static values for testing
    let cap = 50
    let impetusInterval = 3 * 60 * 59
    let reuseInterval = 5 * 60 * 59
    
    // user values for testing
    let weaponDelay = 203
    let hitRate = 95
    let critRate = 9
    
    let samples = 100000
    let totalDelay = weaponDelay * samples
    
    // All swings
    let delayPoints = [ 0 .. weaponDelay .. totalDelay ]
    
    // Only interested in the swings while Impetus is up, grouped by instance of Impetus use
    let delayGroups =
        delayPoints
        |> Seq.filter ( fun x -> (x % reuseInterval) < impetusInterval )
        |> Seq.groupBy ( fun x -> x / reuseInterval )
        
    // Generate random values for each swing to be checked, for each Impetus swing set
    let getHitSeq swings = 
        seq { for x in swings -> rnd.Next(100) }
    
    let builder = StringBuilder()
    
    // Get the average crit rate for a given hit sequence
    let getCritRate hits =
        let mutable impCrit = 0
        let mutable sumCrit = 0.0
        let mutable countHits = 0
        for eachSwing in hits do
            if eachSwing < hitRate then
                builder.AppendFormat("{0} ", impCrit) |> ignore
                sumCrit <- sumCrit + float(impCrit)
                countHits <- countHits + 1
                if (impCrit < cap && (impCrit + critRate) < 100) then
                    impCrit <- impCrit + 1
            else
                builder.Append("0 ") |> ignore
                impCrit <- 0
        builder.Append("\n") |> ignore
        sumCrit / float(countHits)
        
    
    // Run the calculations on each Impetus instance
    let listOfCritRates = Seq.map (fun x -> getCritRate (getHitSeq (snd x)) ) delayGroups
    let AvgCritRate = Seq.average listOfCritRates
    
    // Output results info
    let firstGroup = Seq.nth(0) delayGroups
    printfn "Swings in set: %i\n" (Seq.length (snd firstGroup))
    
    //printfn "Crit rates: \n%s\n\n" (builder.ToString())
    
    printfn "Impetus Bonus Crit Rate: %f (%f with downtime)" AvgCritRate (AvgCritRate * 0.6)
    printfn "Net Crit Rate: %f (%f with downtime)" (AvgCritRate + float(critRate)) ((AvgCritRate * 0.6) + float(critRate))




    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.

  9. #89
    Banned.

    Join Date
    Jun 2007
    Posts
    2,590
    BG Level
    7

    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.

  10. #90
    Banned.

    Join Date
    Jun 2007
    Posts
    2,590
    BG Level
    7

    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..

  11. #91

    nvm

  12. #92
    Banned.

    Join Date
    Jun 2007
    Posts
    2,590
    BG Level
    7

    After checking how attack changes I get that for normal monk setups it's ~ +28 attack during impetus.

  13. #93
    CoP Dynamis
    Join Date
    Jun 2010
    Posts
    252
    BG Level
    4
    FFXI Server
    Siren

    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.

  14. #94
    Salvage Bans
    Join Date
    Sep 2008
    Posts
    912
    BG Level
    5
    FFXI Server
    Leviathan

    just wanted to say thank you for the work that went into making these.

  15. #95
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Quote Originally Posted by shen View Post
    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.
    Whoops, typo. Fixed and new version uploaded.

  16. #96
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    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

    Anyway, for an average crit rate bonus of +17.5%, that implies that the average number of sequential hits is 36. The 36th hit would have a bonus of +35% crit rate, and the average for the entire sequence of hits would be half of that.

    While there should be 1 miss in 20 swings, I suppose if the distribution is not guaranteed to be uniform. One could have something like:

    [1 miss 19 hits] [19 hits 1 miss] [1 miss 19 hits] etc., such that even though you're still missing 1 in 20, the misses tend to be clustered together, and the hits tend to form long sequences.

    I did a quick check of the hit/miss distribution, and I'm getting a 95% hit rate, as expected, so the randomizer is working fine.

    So let's measure the average length of sequential hits.

    With 115 delay (from previous low-end case), 100,000 samples, 95% hit rate, and base crit rate of 10%, I get the following:

    Typical number of hits per Impetus cycle (ignoring any interrupting actions): 93
    Total number of sequences of hits while Impetus was up: ~3273
    Average number of hits landed per sequence: 17.1 - 17.8
    Average bonus crit rate: 14.2% - 14.8%

    So we're ending up with sequences that are basically in line with expectations -- a bit under 19 hits, given a 95% hit rate. But that doesn't explain why the average expected bonus is approaching 1:1 with the number of hits. It should still be half of that.

    So suppose we consider a situation with a 5-hit sequence and a 30-hit sequence. 35 total hits, for an average of 17.5 hits per sequence. The average bonus rate of the 5-hit sequence is 2% (0 to 4), while the average bonus on the 30-hit sequence is 14.5%. Of course we can't just average those together (which would give us a 8.25% bonus, and is basically the flaw in my spreadsheet) since we want the average per hit.

    Total crit sum for the 5-hit sequence is 10 points. Total crit sum for the 30 hit sequence is 435 points. Net overall average per hit would be (435 + 10) / (30 + 5) = 12.71%.

    If we add in an 18-hit sequence (roughly equal to the average), it would have an 8.5% bonus on its own. Added to the other two, however, the overall average would be 11.28%.

    So even though the distribution of sequence lengths is pretty much as expected, that doesn't translate directly to equally weighted average bonus values. I need to figure out how to weight the result relative to the maximum number of hits that can occur within the time period. The greater the maximum hits, the more likely for there to be a sequence with a high number of hits, which will pull the overall average up.



    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
    Code:
    open System.Text
    
    // object for getting random numbers
    let rnd = System.Random()
    // Utility
    let printSeq seq1 = Seq.iter (printf "%A ") seq1; printfn ""
    
    let printSeqBound mark seq1 = printf mark; Seq.iter (printf "%A ") seq1; printfn ""
    let printAllSeq seq1 = Seq.iter (printSeqBound "-> " ) seq1; printfn ""
    
    // static values for testing
    let cap = 50
    let impetusInterval = 3 * 60 * 59
    let reuseInterval = 5 * 60 * 59
    
    // user values for testing
    let weaponDelay = 5
    let hitRate = 95
    let critRate = 10
    
    // careful of taking the number of samples too high if delay is also high
    let samples = 1000000
    let totalDelay = weaponDelay * samples
    
    // All swings
    let delayPoints = [ 0 .. weaponDelay .. totalDelay ]
    let swingChecks = List.init (List.length delayPoints) ( fun x -> rnd.Next(100) )
    
    // Zip them into a list of tuples
    let swingZip = List.zip delayPoints swingChecks
    
    // Split the swings into lists of sequential hits
    let splitSwingSequences2 (h : (int * int)) (accum : (int * int) list list) =
        // If the swing is when Impetus is down, skip it and create a new list
        if ((fst h) % reuseInterval) > impetusInterval then
            [ [] ] @ accum
        // If the swing isn't a miss, add it to our accumulator
        elif (snd h) < hitRate then
            // Swings are stored in reverse order, so get the first one
            let swing = List.head accum
            // And add this swing at the beginning
            let updatedSwings = h :: swing
            // Finally put this updated word at the beginning of our accumulator
            updatedSwings :: (List.tail accum)
        // If the swing missed then add a new list of swings
        else  
            [ [] ] @ accum
    
    
    // Get a list of lists of sequential hits (within Impetus periods) from all possible swings
    let swingSeqs = List.foldBack splitSwingSequences2 swingZip [ [] ]
    // Clear out all the empty lists generated by the above function
    let swingSeqsClean = List.filter (fun x -> not (List.isEmpty x)) swingSeqs
    
    // debug info
    //swingZip |> printSeq
    //printfn "\n"
    //swingSeqsClean |> printSeq
    
    
    let seqCount = List.length swingSeqsClean
    let totalHits = List.fold (fun tot x -> tot + (List.length x)) 0 swingSeqsClean
    let seqAvgLength = float(totalHits) / float(seqCount)
    let critBonusSeq = List.map (fun x -> List.mapi (fun i (delay,hit) -> (delay,hit,i) ) x ) swingSeqsClean
    let totalCrits = List.fold (fun tot x ->
        tot + (List.fold (fun totC (_,_,bonus) -> totC + bonus) 0 x) ) 0 critBonusSeq
    let avgBonus = float(totalCrits) / float(totalHits)
    
    
    if samples < 100 then
        critBonusSeq |> printAllSeq
    
    printfn "New model:\n"
    
    printfn "Sequences: %i      Hits: %i    Avg Seq Length: %f" seqCount totalHits seqAvgLength
    printfn "Total bonus: %i  Avg Bonus: %f\n" totalCrits avgBonus

  17. #97
    Banned.

    Join Date
    Jun 2007
    Posts
    2,590
    BG Level
    7

    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
    Code:
    critrate=((1-a^N)/(1-a)-N)/ ( (1-1/a)*N )
    In the case of when the weapon delay is 1 minute, N=4, a=0.95 and the formula gives 1.38% crit rate.


    I explain it below but you'll need basic probability understanding

    Spoiler: show

    Let X(n) bet the crit rate on n-the swing (first swing is n=0, last swing is n=N-1).
    Let Y(n) bet a sequence of bernouilli variables of parameter a (a for accuracy rate)
    The one can modelize X(n+1)=0 if Y(n)=0 and X(n+1)=X(n)+1 if Y(n)=1.

    Then in order to count the crits, let Z(n) and Z'(n) be uniform and independent on [0,1]

    Let B=number of cirts among the N swings. One can modelize
    B= number of intergers 0<=i<=N-1 such that Z(i)<X(i) and Z'(i)<a
    As such the expectation of B is E(B)=a(E( X(1) + X(2) + X(3) +....+ X(N-1) ) )
    similarily the number of hits among the first N swing would have an expactation of Na

    Considering that impetus sequences are independent from each other you can apply the law of large numbers. The average crit rate over all impetus sequences would then be

    a(E( X(1) + X(2) + X(3) +....+ X(N-1) ) ) / (Na)=(E( X(1) + X(2) + X(3) +....+ X(N-1) ) ) / N

    (which btw seems fairly logic, don't really needed math to achieve this)

    One can actually compute those expectations as there is a simple recurrence formula
    E( X(n+1) )=a+aE( X(n) )
    which can be solved to
    E(X(n))=(a^n-1)/(1-1/a)
    Then you have to sum it all for n=0 to n=N-1, using geometric series formula ...

    (E( X(1) + X(2) + X(3) +....+ X(N-1) ) ) / N = ( (1-a^N)/(1-a) - N)/( N(1-1/a) )




    @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.
    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.

  18. #98
    Relic Shield
    Join Date
    Jun 2007
    Posts
    1,627
    BG Level
    6

    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.

  19. #99
    Relic Shield
    Join Date
    Jun 2007
    Posts
    1,627
    BG Level
    6

    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

    Let 'N' be the number of successive connected hits. It can take any values 0,1,2,3,... The probability that 'N' equals 'n' is a^n*(1-a).

    Once the length of this sequence of hits is fixed, the first hit has 0% chance of crits, the second has 1%, the third has 2%.... the n-th has (n-1)% chance of crits. The chance of doing a critical hit for that sequence is thus (in %)

    http://i224.photobucket.com/albums/d...impetus2-1.jpg

    Now you average all these numbers, with each probabilities that 'N=n' given above:

    http://i224.photobucket.com/albums/d...z/impetus3.jpg





    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

    you consider the (infinite) sequence of hits and misses, and attach to it the probability of doing a critical hit. For example (0=miss, 1=hit):

    0,1,1,1,0,1,1,1,1,1,1... to which you attach the probabilities

    0%,0%,1%,2%,0%,0%,1%,2%,3%,4%,5%,...

    Let N1 be the numbers of hits in the first sequence, N2 the numbers of hits in the second sequence,, etc... inside each sequence, critical hits will occur, and you get X1 number of crits in the first sequence, X2 in the second sequence, etc... The Nk are independant variables with same probability distribution, so are the Xk. Your overal critical hit rate is thus, for 'n' sequences, with 'n' large:

    http://i224.photobucket.com/albums/d...z/impetus5.jpg

    which converges as 'n' tends to infinity to the quotient of the expectations, by the law of large numbers: E(X)/E(N), which is computed as follows:

    http://i224.photobucket.com/albums/d...z/impetus7.jpg



    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.

  20. #100
    Banned.

    Join Date
    Jun 2007
    Posts
    2,590
    BG Level
    7

    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
    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
    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.

    Second formula : N>50
    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
    Way more complicated, because this time I accounted for the +50% critical rate cap.

    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%

+ Reply to Thread
Page 5 of 47 FirstFirst ... 3 4 5 6 7 15 ... LastLast

Quick Reply Quick Reply

  • Decrease Size
    Increase Size
  • Remove Text Formatting
  • Insert Link Insert Image Insert Video
  • Wrap [QUOTE] tags around selected text
  • Insert NSFW Tag
  • Insert Spoiler Tag