diff --git a/tbc/optimizer.go b/tbc/optimizer.go index 717a568..bd01943 100644 --- a/tbc/optimizer.go +++ b/tbc/optimizer.go @@ -16,6 +16,8 @@ func OptimalRotation(stats Stats, opts Options, equip Equipment, seconds int, nu topDmg := 0.0 topNLB := 0 + topRot := []string{} + topMets := []SimMetrics{} numLB := 10 @@ -52,15 +54,24 @@ func OptimalRotation(stats Stats, opts Options, equip Equipment, seconds int, nu if simdmg > topDmg { topNLB = numLB topDmg = simdmg + topMets = simmet + topRot = rotation } avgOOM := float64(numoom) / float64(numSims) fmt.Printf("(%d LB: 1 CL) %0.0f DPS OOM: %0.0f percent\n", numLB, simdmg/float64(seconds)/float64(numSims), avgOOM*100) + if numLB == minLB || numLB == maxLB { + fmt.Printf("Hit bounds of sim... Found: %0.0f DPS (%d LB : 1 CL)\n", simdmg/float64(seconds)/float64(numSims), numLB) + if simdmg >= topDmg { + return simmet, rotation + } + return topMets, topRot + } // avgOOMAt := int(float64(oomat) / float64(numoom)) if avgOOM < 0.1 { newLB := (numLB + minLB) / 2 - if numLB-minLB == 1 { // im lazy and this is easy to write... + if numLB-minLB <= 1 { // im lazy and this is easy to write... newLB = minLB } if newLB == numLB { @@ -76,7 +87,7 @@ func OptimalRotation(stats Stats, opts Options, equip Equipment, seconds int, nu newLB := (numLB + maxLB) / 2 if maxLB-numLB <= 1 { // im lazy and this is easy to write... newLB = maxLB - } else if avgOOM > 0.85 { + } else if avgOOM > 0.9 { newLB = (newLB + maxLB) / 2 // skip ahead } diff --git a/tbc/sim.go b/tbc/sim.go index 2978957..c2becfd 100644 --- a/tbc/sim.go +++ b/tbc/sim.go @@ -257,9 +257,10 @@ func (sim *Simulation) Cast(cast *Cast) { dmg *= 1 + (0.01 * sim.Options.Talents.Concussion) } - // Average Resistance = (Target's Resistance / (Caster's Level * 5)) * 0.75 "AR" - // P(x) = 50% - 250%*|x - AR| <- where X is chance of resist + // Average Resistance (AR) = (Target's Resistance / (Caster's Level * 5)) * 0.75 + // P(x) = 50% - 250%*|x - AR| <- where X is %resisted // For now hardcode the 25% chance resist at 2.5% (this assumes bosses have 0 nature resist) + // .... Using level 70 shows a 0.35% chance of resist instead of 2.5%... not sure what is correct. if sim.rando.Float64() < 0.025 { // chance of 25% resist dmg *= .75 if IsDebug { diff --git a/ui/lib.wasm b/ui/lib.wasm index ce01242..01cf9d6 100755 Binary files a/ui/lib.wasm and b/ui/lib.wasm differ