Skip to content

Commit

Permalink
Added constants for ranges and changed movespeed
Browse files Browse the repository at this point in the history
  • Loading branch information
adocoD committed Jul 8, 2024
1 parent 9339c89 commit eb69a44
Show file tree
Hide file tree
Showing 19 changed files with 126 additions and 123 deletions.
8 changes: 4 additions & 4 deletions sim/core/attack.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,14 +517,14 @@ func (aa *AutoAttacks) startPull(sim *Simulation) {

aa.enabled = true

if aa.AutoSwingMelee && aa.mh.unit.DistanceFromTarget <= 5 {
if aa.AutoSwingMelee && aa.mh.unit.DistanceFromTarget <= MaxMeleeAttackDistance {
aa.mh.addWeaponAttack(sim, aa.mh.unit.SwingSpeed())
if aa.IsDualWielding {
aa.oh.addWeaponAttack(sim, aa.mh.curSwingSpeed)
}
}

if aa.AutoSwingRanged && aa.mh.unit.DistanceFromTarget >= 12 {
if aa.AutoSwingRanged && aa.mh.unit.DistanceFromTarget >= MinRangedAttackDistance {
aa.ranged.addWeaponAttack(sim, aa.ranged.unit.RangedSwingSpeed())
}
}
Expand Down Expand Up @@ -566,7 +566,7 @@ func (aa *AutoAttacks) EnableAutoSwing(sim *Simulation) {

aa.enabled = true

if aa.AutoSwingMelee && aa.mh.unit.DistanceFromTarget <= 5 {
if aa.AutoSwingMelee && aa.mh.unit.DistanceFromTarget <= MaxMeleeAttackDistance {
aa.mh.swingAt = max(aa.mh.swingAt, sim.CurrentTime, 0)
aa.mh.addWeaponAttack(sim, aa.mh.unit.SwingSpeed())
if aa.IsDualWielding {
Expand All @@ -575,7 +575,7 @@ func (aa *AutoAttacks) EnableAutoSwing(sim *Simulation) {
}
}

if aa.AutoSwingRanged && aa.mh.unit.DistanceFromTarget >= 12 {
if aa.AutoSwingRanged && aa.mh.unit.DistanceFromTarget >= MinRangedAttackDistance {
aa.ranged.swingAt = max(aa.ranged.swingAt, sim.CurrentTime, 0)
aa.ranged.addWeaponAttack(sim, aa.ranged.unit.RangedSwingSpeed())
}
Expand Down
3 changes: 3 additions & 0 deletions sim/core/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ const SpellBatchWindow = time.Millisecond * 10
const DefaultAttackPowerPerDPS = 14.0
const ArmorPenPerPercentArmor = 13.99

const MaxMeleeAttackDistance = 5
const MinRangedAttackDistance = 12

const MissDodgeParryBlockCritChancePerDefense = 0.04

const DefenseRatingToChanceReduction = (1.0 / DefenseRatingPerDefense) * MissDodgeParryBlockCritChancePerDefense / 100
Expand Down
2 changes: 1 addition & 1 deletion sim/core/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ func (unit *Unit) MoveTo(moveRange float64, sim *Simulation) {
unit.moveSpell.Cast(sim, unit.CurrentTarget)

sim.AddPendingAction(NewPeriodicAction(sim, PeriodicActionOptions{
Period: time.Millisecond * 143,
Period: time.Millisecond * 1000 / 7,
NumTicks: int(moveTicks),
TickImmediately: false,

Expand Down
68 changes: 34 additions & 34 deletions sim/hunter/TestBM.results
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ stat_weights_results: {
key: "TestBM-Lvl25-StatWeights-Default"
value: {
weights: 0
weights: 0.5359
weights: 0.53077
weights: 0
weights: 0
weights: 0
Expand All @@ -116,9 +116,9 @@ stat_weights_results: {
weights: 0
weights: 0
weights: 0
weights: 0.02802
weights: 2.5825
weights: 2.2529
weights: 0.02801
weights: 2.516
weights: 2.23961
weights: 0
weights: 0
weights: 0
Expand Down Expand Up @@ -197,106 +197,106 @@ stat_weights_results: {
dps_results: {
key: "TestBM-Lvl25-AllItems-BeastmasterArmor"
value: {
dps: 330.07554
tps: 172.72722
dps: 329.13801
tps: 171.79857
}
}
dps_results: {
key: "TestBM-Lvl25-Average-Default"
value: {
dps: 252.80261
tps: 104.90266
dps: 252.85604
tps: 104.89061
}
}
dps_results: {
key: "TestBM-Lvl25-Settings-NightElf-phase1-Basic-p1_weave-FullBuffs-Phase 1 Consumes-LongMultiTarget"
value: {
dps: 257.72821
tps: 119.0442
dps: 257.62869
tps: 119.02478
}
}
dps_results: {
key: "TestBM-Lvl25-Settings-NightElf-phase1-Basic-p1_weave-FullBuffs-Phase 1 Consumes-LongSingleTarget"
value: {
dps: 245.04571
tps: 105.68089
dps: 245.53092
tps: 105.46271
}
}
dps_results: {
key: "TestBM-Lvl25-Settings-NightElf-phase1-Basic-p1_weave-FullBuffs-Phase 1 Consumes-ShortSingleTarget"
value: {
dps: 356.26811
tps: 153.1418
dps: 357.79828
tps: 153.21729
}
}
dps_results: {
key: "TestBM-Lvl25-Settings-NightElf-phase1-Basic-p1_weave-NoBuffs-Phase 1 Consumes-LongMultiTarget"
value: {
dps: 129.9132
tps: 65.46055
dps: 129.82503
tps: 65.34086
}
}
dps_results: {
key: "TestBM-Lvl25-Settings-NightElf-phase1-Basic-p1_weave-NoBuffs-Phase 1 Consumes-LongSingleTarget"
value: {
dps: 124.35146
tps: 59.64804
dps: 124.43263
tps: 59.47774
}
}
dps_results: {
key: "TestBM-Lvl25-Settings-NightElf-phase1-Basic-p1_weave-NoBuffs-Phase 1 Consumes-ShortSingleTarget"
value: {
dps: 164.56247
tps: 78.73124
dps: 165.47936
tps: 78.43874
}
}
dps_results: {
key: "TestBM-Lvl25-Settings-Orc-phase1-Basic-p1_weave-FullBuffs-Phase 1 Consumes-LongMultiTarget"
value: {
dps: 257.91801
tps: 115.81494
dps: 258.30095
tps: 115.96123
}
}
dps_results: {
key: "TestBM-Lvl25-Settings-Orc-phase1-Basic-p1_weave-FullBuffs-Phase 1 Consumes-LongSingleTarget"
value: {
dps: 246.8775
tps: 102.67821
dps: 247.09104
tps: 102.98106
}
}
dps_results: {
key: "TestBM-Lvl25-Settings-Orc-phase1-Basic-p1_weave-FullBuffs-Phase 1 Consumes-ShortSingleTarget"
value: {
dps: 358.26057
tps: 150.8146
dps: 358.97586
tps: 150.11605
}
}
dps_results: {
key: "TestBM-Lvl25-Settings-Orc-phase1-Basic-p1_weave-NoBuffs-Phase 1 Consumes-LongMultiTarget"
value: {
dps: 130.07871
tps: 64.10887
dps: 130.0554
tps: 63.97371
}
}
dps_results: {
key: "TestBM-Lvl25-Settings-Orc-phase1-Basic-p1_weave-NoBuffs-Phase 1 Consumes-LongSingleTarget"
value: {
dps: 124.25077
tps: 57.64671
dps: 124.5532
tps: 57.86326
}
}
dps_results: {
key: "TestBM-Lvl25-Settings-Orc-phase1-Basic-p1_weave-NoBuffs-Phase 1 Consumes-ShortSingleTarget"
value: {
dps: 160.15572
tps: 74.25661
dps: 161.12417
tps: 74.75417
}
}
dps_results: {
key: "TestBM-Lvl25-SwitchInFrontOfTarget-Default"
value: {
dps: 248.3383
tps: 103.15869
dps: 248.07389
tps: 103.71803
}
}
dps_results: {
Expand Down
70 changes: 35 additions & 35 deletions sim/hunter/TestMM.results
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ stat_weights_results: {
key: "TestMM-Lvl25-StatWeights-Default"
value: {
weights: 0
weights: 0.43206
weights: 0.42143
weights: 0
weights: 0
weights: 0
Expand All @@ -116,17 +116,17 @@ stat_weights_results: {
weights: 0
weights: 0
weights: 0
weights: 0.03205
weights: 2.27875
weights: 2.05739
weights: 0.03208
weights: 2.0933
weights: 2.07672
weights: 0
weights: 0
weights: 0
weights: 0
weights: 0
weights: 0
weights: 0
weights: 0.12514
weights: 0.12499
weights: 0
weights: 0
weights: 0
Expand Down Expand Up @@ -197,106 +197,106 @@ stat_weights_results: {
dps_results: {
key: "TestMM-Lvl25-AllItems-BeastmasterArmor"
value: {
dps: 325.25372
tps: 181.78295
dps: 325.01626
tps: 181.75677
}
}
dps_results: {
key: "TestMM-Lvl25-Average-Default"
value: {
dps: 238.71997
tps: 107.36929
dps: 238.74394
tps: 107.31649
}
}
dps_results: {
key: "TestMM-Lvl25-Settings-Dwarf-phase1-Basic-p1_weave-FullBuffs-Phase 1 Consumes-LongMultiTarget"
value: {
dps: 240.47337
tps: 119.61973
dps: 241.0249
tps: 119.84683
}
}
dps_results: {
key: "TestMM-Lvl25-Settings-Dwarf-phase1-Basic-p1_weave-FullBuffs-Phase 1 Consumes-LongSingleTarget"
value: {
dps: 229.70669
tps: 105.7416
dps: 229.04531
tps: 105.46469
}
}
dps_results: {
key: "TestMM-Lvl25-Settings-Dwarf-phase1-Basic-p1_weave-FullBuffs-Phase 1 Consumes-ShortSingleTarget"
value: {
dps: 344.47384
tps: 153.05402
dps: 344.84387
tps: 152.67551
}
}
dps_results: {
key: "TestMM-Lvl25-Settings-Dwarf-phase1-Basic-p1_weave-NoBuffs-Phase 1 Consumes-LongMultiTarget"
value: {
dps: 120.06285
tps: 65.13581
dps: 119.9057
tps: 64.81461
}
}
dps_results: {
key: "TestMM-Lvl25-Settings-Dwarf-phase1-Basic-p1_weave-NoBuffs-Phase 1 Consumes-LongSingleTarget"
value: {
dps: 115.51246
tps: 59.28238
dps: 115.59932
tps: 59.43702
}
}
dps_results: {
key: "TestMM-Lvl25-Settings-Dwarf-phase1-Basic-p1_weave-NoBuffs-Phase 1 Consumes-ShortSingleTarget"
value: {
dps: 165.39038
tps: 83.65758
dps: 165.18412
tps: 82.93043
}
}
dps_results: {
key: "TestMM-Lvl25-Settings-Orc-phase1-Basic-p1_weave-FullBuffs-Phase 1 Consumes-LongMultiTarget"
value: {
dps: 246.31189
tps: 121.63138
dps: 246.37548
tps: 121.34234
}
}
dps_results: {
key: "TestMM-Lvl25-Settings-Orc-phase1-Basic-p1_weave-FullBuffs-Phase 1 Consumes-LongSingleTarget"
value: {
dps: 234.55693
tps: 105.71372
dps: 234.0019
tps: 105.24519
}
}
dps_results: {
key: "TestMM-Lvl25-Settings-Orc-phase1-Basic-p1_weave-FullBuffs-Phase 1 Consumes-ShortSingleTarget"
value: {
dps: 351.27571
tps: 153.73803
dps: 351.65613
tps: 153.37919
}
}
dps_results: {
key: "TestMM-Lvl25-Settings-Orc-phase1-Basic-p1_weave-NoBuffs-Phase 1 Consumes-LongMultiTarget"
value: {
dps: 122.38963
tps: 64.78513
dps: 122.28699
tps: 64.50714
}
}
dps_results: {
key: "TestMM-Lvl25-Settings-Orc-phase1-Basic-p1_weave-NoBuffs-Phase 1 Consumes-LongSingleTarget"
value: {
dps: 117.68882
tps: 59.18667
dps: 118.08539
tps: 59.36571
}
}
dps_results: {
key: "TestMM-Lvl25-Settings-Orc-phase1-Basic-p1_weave-NoBuffs-Phase 1 Consumes-ShortSingleTarget"
value: {
dps: 163.96546
tps: 81.16107
dps: 164.69071
tps: 81.12654
}
}
dps_results: {
key: "TestMM-Lvl25-SwitchInFrontOfTarget-Default"
value: {
dps: 236.06336
tps: 107.31619
dps: 235.76775
tps: 107.47194
}
}
dps_results: {
Expand Down
Loading

0 comments on commit eb69a44

Please sign in to comment.