Hello Zsombi,
looks like you are really interested in this.
That's why i want so share a smal mod from my private collection to show how dps etc. are calculated.
The mod wil also add some additional informations to the Tooltip: (enable "Display more Unit Stats")
- SmartTip.png (283.54 KiB) Viewed 2781 times
You will se 3 different DPS stats for every weapon. (It's my debug mod for dps calculation)
Damage: Are the calculations from the game. This needs the option "Display more Unit Stats" enabled!
Hussar: These numbers are based on the unitmanger "UnitsAnalyzer.lua.GetWeaponSpecs()"
Uveso: My own calculations about dps ^^
(Why 3 ????; Well, we need at least 1 helper variable added to some units to make a accurate dps calculation of all weapons. - But that's another story)
And on the last line you can see the unitID and the corresponding mod name for the unit.
You can find the dps calculations in one file:
- Code: Select all
\Mods\SmartUnitTooltip\hook\lua\ui\game\unitviewDetail.lua
There you can see how the tooltip is hooked into the game and the different dps calculation functions for each weapongroup.
(Starting line 305 "function GetWeaponDPS(bp,weapon)")
You can use everything from the mod if you do me a favor.
If you find a better calculation or a bug, please tell me/us
Greetings, Uveso.