finpingvin / pd2-map-dmg-calculator

Project Diablo 2 tool to calculate your damage in maps
MIT License
1 stars 0 forks source link

Monster max health #4

Closed exiledagain closed 2 weeks ago

exiledagain commented 3 weeks ago

There's a problem with the max health of monsters.

scarab3Crypt has MaxHP(H): 173 and T1 map is area level 87: L-HP(H): 6412. floor(173*6412/100) is 11092 max health. Min health is also higher: floor(129*6412/100) is 8271 min health.

Non-ladder: 6203-8319.

exiledagain commented 3 weeks ago

MonLvl3Ex is the expansion area level.

finpingvin commented 3 weeks ago

Thx for the report, I will check your formula when I get some headspace. The HP-values are a bit experimental since I have not found an exact formula of how they are calculated before. The way they are implemented now is the most accurate we found by soft-verifying it in-game for some of the mobs.

Here is where the HP-values come from if you are curious https://github.com/finpingvin/pd2-gamefiles-parsing/blob/main/main.go#L327 .

finpingvin commented 3 weeks ago

Did you also verify your numbers in game?

exiledagain commented 3 weeks ago

Yes, it might be off-by-one due to rounding. [1] uses monlvl and monstats to calculate HP, if it requires a ratio, and [2] does the multiplication.

[1] https://github.com/ThePhrozenKeep/D2MOO/blob/master/source/D2Common/src/DataTbls/MonsterTbls.cpp#L601 [2] https://github.com/ThePhrozenKeep/D2MOO/blob/master/source/D2Common/src/DataTbls/MonsterTbls.cpp#L931

finpingvin commented 2 weeks ago

You were spot on, I fixed it here https://github.com/finpingvin/pd2-gamefiles-parsing/commit/c1991a1ac9e291d919d13dce1949222065b81c45

I was using MonLvl3 instead of MonLvl3Ex, and MonLvl3 was incorrectly lvl 88 for scarab3Crypt. Also missed that hp scaled with difficulty both in monlvl and monstats.

Thx! :) The HP values in the calculator probably still needs some more in-game verification as well..

finpingvin commented 2 weeks ago

Plz let me know if you find any other numbers that look funky