I've been trying to figure out how the melee DPS calculation (for animals) works. Of course, I'm not sure whether the calculation even represents the actual DPS ingame, but I'd still like to know the magic behind it.

I've figure out:

- The highest DPS attack makes up 75% of the total DPS. If there are several of the same, highest DPS, they will split the 75% chance among them.

- All attacks with more than 25% of the highest DPS divide the remaining 25% of the total DPS among them.

- All attacks with 25% or less of the highest DPS are ignored.

This, I'm quite certain of, so far.

The problem arises when the "

**chanceFactor**" property is used, as I cannot figure out how exactly it comes into the calculation.

All tests were done using three attacks ("tools"). All chanceFactors for the various cases were found by testing.

All uninjured animals have a melee skill of 4, resulting in a 62% multiplier for the average DPS.

Damage values are just for testing, obviously they are quite ridiculous for ingame stuff.

*Never did a 5th case, but there should be one where the third attack will be ignored when the chanceFactor is very low.***----- Test 1, damage is 10, 10, 40, cooldown is always 1. -----**Case 1, baseline:

**Damage** | **Cooldown** | **chanceFactor** | **%_of_Total** |

10 | 1 | 1 | 0% |

10 | 1 | 1 | 0% |

40 | 1 | 1 | 100% |

Results in "average" damage of 40, dps of 24.8.

Case 2, chanceFactor < 1.0 & >= 0.

19:

**Damage** | **Cooldown** | **chanceFactor** | **%_of_Total** |

10 | 1 | 1 | 12.5% |

10 | 1 | 1 | 12.5% |

40 | 1 | 0.19 | 75% |

Results in "average" damage of 32.5, dps of 20.15.

Case 3, chanceFactor = 0.

18:

**Damage** | **Cooldown** | **chanceFactor** | **%_of_Total** |

10 | 1 | 1 | 33.3...% |

10 | 1 | 1 | 33.3...% |

40 | 1 | 0.18 | 33.3...% |

Results in "average" damage of 20, dps of 12.4.

Case 4, chanceFactor <= 0.

17:

**Damage** | **Cooldown** | **chanceFactor** | **%_of_Total** |

10 | 1 | 1 | 37.5% |

10 | 1 | 1 | 37.5% |

40 | 1 | 0.17 | 25% |

Results in "average" damage of 17.5, dps of 10.85.

**----- Test 2, damage is 20, 20, 80, cooldown is always 1. -----**Case 1, baseline:

**Damage** | **Cooldown** | **chanceFactor** | **%_of_Total** |

20 | 1 | 1 | 0% |

20 | 1 | 1 | 0% |

80 | 1 | 1 | 100% |

Results in "average" damage of 80, dps of 49.6.

Case 2, chanceFactor < 1.0 & >= 0.

16:

**Damage** | **Cooldown** | **chanceFactor** | **%_of_Total** |

20 | 1 | 1 | 12.5% |

20 | 1 | 1 | 12.5% |

80 | 1 | 0.16 | 75% |

Results in "average" damage of 65, dps of 40.3.

Case 3, chanceFactor = 0.

15:

**Damage** | **Cooldown** | **chanceFactor** | **%_of_Total** |

20 | 1 | 1 | 33.3...% |

20 | 1 | 1 | 33.3...% |

80 | 1 | 0.15 | 33.3...% |

Results in "average" damage of 40, dps of 24.8.

Case 4, chanceFactor <= 0.

14:

**Damage** | **Cooldown** | **chanceFactor** | **%_of_Total** |

20 | 1 | 1 | 37.5% |

20 | 1 | 1 | 37.5% |

80 | 1 | 0.14 | 25% |

Results in "average" damage of 35, dps of 21.7.

**----- Test 3, damage is 1, 1, 4, cooldown is always 1. -----**Case 1, baseline:

**Damage** | **Cooldown** | **chanceFactor** | **%_of_Total** |

1 | 1 | 1 | 0% |

1 | 1 | 1 | 0% |

4 | 1 | 1 | 100% |

Results in "average" damage of 4, dps of 2.48.

Case 2, chanceFactor < 1.0 & >= 0.

26:

**Damage** | **Cooldown** | **chanceFactor** | **%_of_Total** |

1 | 1 | 1 | 12.5% |

1 | 1 | 1 | 12.5% |

4 | 1 | 0.26 | 75% |

Results in "average" damage of 3.25, dps of 2.02.

Case 3, chanceFactor = 0.

25:

**Damage** | **Cooldown** | **chanceFactor** | **%_of_Total** |

1 | 1 | 1 | 33.3...% |

1 | 1 | 1 | 33.3...% |

4 | 1 | 0.25 | 33.3...% |

Results in "average" damage of 2, dps of 1.24.

Case 4, chanceFactor <= 0.

22:

**Damage** | **Cooldown** | **chanceFactor** | **%_of_Total** |

1 | 1 | 1 | 37.5% |

1 | 1 | 1 | 37.5% |

4 | 1 | 0.22 | 25% |

Results in "average" damage of 1.75, dps of 1.09.

**----- Test 4, damage is always 1, cooldown is 1, 1, 0.25. -----**Case 1, baseline:

**Damage** | **Cooldown** | **chanceFactor** | **%_of_Total** |

1 | 1 | 1 | 0% |

1 | 1 | 1 | 0% |

1 | 0.25 | 1 | 100% |

Results in "average" cooldown of 0.25, dps of 2.48.

Case 2, chanceFactor < 1.0 & >= 0.

27:

**Damage** | **Cooldown** | **chanceFactor** | **%_of_Total** |

1 | 1 | 1 | 12.5% |

1 | 1 | 1 | 12.5% |

1 | 0.25 | 0.27 | 75% |

Results in "average" cooldown of 0.44, dps of 1.42.

Case 3, chanceFactor = 0.

26:

**Damage** | **Cooldown** | **chanceFactor** | **%_of_Total** |

1 | 1 | 1 | 33.3...% |

1 | 1 | 1 | 33.3...% |

1 | 0.25 | 0.26 | 33.3...% |

Results in "average" cooldown of 0.75, dps of 0.83.

Case 4, chanceFactor <= 0.

23:

**Damage** | **Cooldown** | **chanceFactor** | **%_of_Total** |

1 | 1 | 1 | 37.5% |

1 | 1 | 1 | 37.5% |

1 | 0.25 | 0.23 | 25% |

Results in "average" cooldown of 0.81, dps of 0.76.

I just cannot figure out why the chanceFactor is different for these tests.

My assumption was, that if the damage is doubled for all attacks, the chanceFactor required to get a different calculation case would be the same.

But it's not. And the same behaviour appears when chanceFactor is set in a way that one attack "out-DPS-weights" the others enough to be the only attack picked. (Using a high factor of more than 1. The 4x-the-damage limit mentioned at the start, chanceFactor seems to modify that somehow.)