Updating KoLMafia's Monster Physical Resistances

I've been making more in depth consult scripts and noticed that KoLMafia has lots of incorrect monster.physical_resistance values. Some monsters have random/pointless resistances (like lots of ducks have 2%) and others just have wildly incorrect (lots of giants have around 30 and the wall of skin should have 100%, not 10).

Questions:
1) How do Update these? Do I....​
a) Create a bug report listing the differences.​
b) Update KoLMafia directly and submit a build.​

2) What is necessary to prove the change should be made?​
a) Looking at the KoL Wiki's monster physical resistance.​
b) Logs showing the calculated with/without resistance and the outcome.​
 

Darzil

Developer
Probably a, though submitting a patch is good too.
I wouldn't trust the wiki on it, personally. If I were spading it, I'd post the results to kolspading.com, and link to there from your bug report (and possibly wiki too when you fix the bugs there!)
 

lostcalpolydude

Developer
Staff member
Your data looks like you need to be more careful with your data collection. There's no way TPTB gave a monster 2% resistance, but that's what you would see if you ran +5 ML.

The wall of skin should have 100%, but it doesn't have 10 currently, which means you were running +25 ML.

So do some careful data collection, account for your +ML, and post a bug report here.
 

heeheehee

Developer
Staff member
I typically verify these values myself anyways if they're from readily-accessible monsters, for what it's worth.
 

heeheehee

Developer
Staff member
Also, for what it's worth, I'm pretty sure the proxy records for monsters does account for physical resistance from ML, as I added that a while back.
Code:
> ash last_monster()

Returned: Performer of Actions
id => 1859
base_hp => 417
base_attack => 1861
base_defense => 557
raw_hp => 408
raw_attack => 1849
raw_defense => 545
base_initiative => -10000
raw_initiative => -10000
attack_element => none
defense_element => none
physical_resistance => 4
min_meat => 0
max_meat => 0
base_mainstat_exp => 233.125
phylum => weird
poison => none
boss => false
dummy => false
image => blank.gif
images => aggregate boolean [string]
**blank.gif => true
attributes => Scale: 1 Cap: 10000 Floor: 10 Init: -10000 P: weird
random_modifiers => aggregate boolean [string]
manuel_name => Performer of Actions
 
Yeah, I was unaware that KoLMafia took in account of ML. Apparently, it only applies that ML physical resistance when you call monster.physical_resistance in a fight, and then it caches that value. So, when I did
Code:
ash foreach it in $monsters[] { if(it.physical_resistance > 0 && it.physical_resistance != 100) print(it+" "+it.physical_resistance);}
I would get random cached results based on whatever ML I had previously when I fought that monster.

Do you think we could get a compliment for physical_resistance called elemental_resistance that would do something similar?
 

heeheehee

Developer
Staff member
Yeah, I was unaware that KoLMafia took in account of ML. Apparently, it only applies that ML physical resistance when you call monster.physical_resistance in a fight, and then it caches that value.

...

Do you think we could get a compliment for physical_resistance called elemental_resistance that would do something similar?
Hm, first one seems like a bug that I probably introduced and nobody reported. As for the second one, I don't remember offhand which monsters have elemental resistance. batfactors probably knows.
 

heeheehee

Developer
Staff member
r16530 fixes the caching issue. I'll have to look into elemental resistance, although I don't know that there are enough monsters to justify it as is.
 

lostcalpolydude

Developer
Staff member
The MonsterData object is maybe being cloned for OCRS modifiers, and maybe being cloned (again, or not) for physical resistance. Maybe always cloning it before either of those would make sense (especially if other stuff gets added later that also needs it cloned). Or maybe the current way is better, since there's more likely no cloning than two clones currently.
 
There probably isn't enough monsters to justify, but since you are adding ML factor into the physical resistance, I figured for completeness/ease doing the same for elemental resistance would be nice. Then people doing consult scripts could just multiply the calculated raw damages by those factors. Plus, it has the added benefit of allowing it to include those rare monsters that have increased elemental resistances (off the top of my head I know Frosty, oil tycoon/baron/cartel and wall of skin)
 
Top