Calculator for Resistance Distributions of Unique and Superunique Monsters

art_vandelay

Well-known member
Mar 16, 2020
403
742
93
As you may well know it is an absolute pain to calculate the chances for a unique monster to have a certain resistance %. Because of the way that the monster modifiers are applied (order matters and so do base resistances) you basically have to simulate every possible modifier roll to get the exact percentages. This is not helped by the fact that there's a total of 7 (!) modifiers that affect resistances and each has their own set of rules for application.

***

Over the last few months I've taken up programming and made some D2 related programs in Python. Among them is a calculator for unique monster resistances:
To run this you need Python 3 which you can get here. The github page also contains a readme with instructions on how to execute the calculator.

Making .exe files from Python source hasn't yet worked for me so this is the best I can offer at the moment. Also it's a console application which I might change at a later point. However adding a GUI has lower priority for me than making the calculator work perfectly.

Anyway the calculator let's you specify the exact circumstances under which you encounter the monster in question. You can set conviction, lower resist and cold mastery as well as -% Enemy Resist. It also has support for all three difficulties and leapers. (They can't spawn with "Lightning Enchanted")

***

To apply this to a superunique monster which DOES not have any modifiers you choose a difficulty level which is one below the one you are interested in (so for Nihlathak Hell you choose Nightmare) since superuniques get one less modifier than regular unique monsters.

***

Here's a little sample output. I specified to the program that I want lvl 12 conviction and a ranged enemy. Then I entered the resistances of a Horror Mage in Hell AT. The result is this:
Code:
*************************
Difficulty: Hell
Ranged Type: Yes
Conviction Level: 12
Lower Resist Level: 0
Cold Mastery Level: 0
-% Enemy Resist:
    Physical: 0
    Magic: 0
    Cold: 0
    Fire: 0
    Lightning: 0
    Poison: 0
*************************

Enter Resistances: 33 0 0 115 0 75

Physical:
33: 76.92%
83: 23.08%

Magic:
0: 76.92%
20: 23.08%

Cold:
-85: 41.96%
-65: 15.73%
-45: 15.85%
-25: 3.50%
-10: 17.48%
10: 1.75%
98: 3.55%
118: 0.17%

Fire:
98: 77.16%
173: 22.84%

Lightning:
-85: 41.96%
-65: 15.73%
-45: 15.85%
-25: 3.50%
-10: 17.60%
10: 1.75%
98: 3.44%
118: 0.17%

Poison:
75: 100.00%

***

Thanks go out to @Luhkoh who made an excel spreadsheet for resistances of the Ancient Tunnel unique monsters against which I could compare my results!

***

If there is any need for another D2 related calculator (that hopefully doesn't exist yet), let me know. I'm happy to get more coding practice under my belt! ;)
 
Last edited:

Babyhell

Well-known member
Mar 13, 2020
1,751
1,207
113
France
Nice! I am currently working on a Python program (learning too) for trading purposes, to crunch GoMule dumps of stashes (the various posts with tag GENERATED CONTENT in my trade thread are...well, generated xD). If I handle how to produce an GUI I'll PM you, but it is not my priority either. Also, having it not compiled allows Mac users to be able to use it, so I would consider an executable only if I get that generated for both platforms.

Nice work btw!
 

Luhkoh

Well-known member
Mar 13, 2020
618
1,005
93
30
USA
Nice work art, good stuff. I probably will still end up posting my excel version at some point since it will be a part of some simulators I have in mind (but don't seem to be putting much time into). Thanks for the discussion and for finding a mistake I had in mine!
 
  • Like
Reactions: art_vandelay

art_vandelay

Well-known member
Mar 16, 2020
403
742
93
Nice! I am currently working on a Python program (learning too) for trading purposes, to crunch GoMule dumps of stashes (the various posts with tag GENERATED CONTENT in my trade thread are...well, generated xD). If I handle how to produce an GUI I'll PM you, but it is not my priority either. Also, having it not compiled allows Mac users to be able to use it, so I would consider an executable only if I get that generated for both platforms.

Nice work btw!
Thanks! That seems very useful for trading purposes. Do you plan on including stats on jewels and charms? After all a lucky small charm could go either way :p

Didn't think of the Mac users to be honest, but that's a good point :D

Very nice. Make an AT barb optimization calculator now ^^
Very clever. Make an AT barb now ^^
 

Babyhell

Well-known member
Mar 13, 2020
1,751
1,207
113
France
@art_vandelay here is a sample of crunched generated content - I try to go with a list followed by a crunched dumps spoiler:

Code:
Amber Grand Charm, Grand Charm x2
Amber Grand Charm, Grand Charm x2
Required Level: 22
Lres +27% [0xca8d53ae]
Lres +28% [0xdaf9be75]

I won't put anything more here, I will open a dedicated thread too when I feel so, but it gives the flavor ;-)
 
  • Like
Reactions: art_vandelay