Feature Commands to check for base/directed ML monster stats

Theraze

Active member
Was starting to muse through base stat information regarding monster attack and defence. It might be useful to have a command for checking monster attack/defence given a specified ML. The question is, should it be a further overload to monster_attack and monster_defense or a new command? I could see this being an obvious overload... monster_attack(Monster, ML). If you want base, just do monster_attack(Monster, 0).

Alternatively, we could do this as base_monster_attack(Monster). But if we're actually going to have defence modifiers from ML properly done as a 90% efficiency thing, then it might be useful being able to properly pull the defence stats, as that makes it more complicated, especially at higher levels of ML. The overloaded monster_attack and monster_defense could be used by scripters to decide exactly at which points (given the 5% margin of randomness) a zone should be safe-ish.
 

Theraze

Active member
Darzil, that's a different thing, and actually a bug report... the current monsters (beelephant, snapdragon, Tiger-lily, and wasp in a wig) only have HP listed, and that incorrectly since it's a static listing, not based on ML or stats. Where I'm not certain about it is whether or not the stats in there can be based on your stats, as well as the ML.

Monster stats, as far as any testing I've heard of happens, don't get modified by post-combat ML changes, so the regular tracking is fine there. It's mostly a matter of fixing the initial scaling.
 

Theraze

Active member
Okay, so here comes one of those shiny teasers... Monster attack...
> ash monster_attack($monster[zombie waltz]);

Returned: 110

> ash monster_attack($monster[zombie waltz], 0);

Returned: 110

> ash monster_attack($monster[zombie waltz], -50);

Returned: 60

> ash monster_attack($monster[zombie waltz], 100);

Returned: 210
And defence...
> ash monster_defense($monster[zombie waltz]);

Returned: 99

> ash monster_defense($monster[zombie waltz], 0);

Returned: 99

> ash monster_defense($monster[zombie waltz], -50);

Returned: 54

> ash monster_defense($monster[zombie waltz], 100);

Returned: 189
And health...
> ash monster_hp($monster[zombie waltz]);

Returned: 120

> ash monster_hp($monster[zombie waltz], 0);

Returned: 120

> ash monster_hp($monster[zombie waltz], -50);

Returned: 70

> ash monster_hp($monster[zombie waltz], 100);

Returned: 220

As you'll notice, I've implemented the 90% of base defence that appears to be the most current guess as to accuracy on calculation. Anyways... soon as the 90% defence patch is either implemented as right or rejected as wiki-wrong, I'll spin this patch up. No sense in spinning a patch for new features that will just need to be fixed in another few days/weeks.
 

Theraze

Active member
Okay, here's the patch. Also includes fixing that
PHP:
monster_defense()
should return the same as
PHP:
monster_defense(to_monster(get_property("lastEncounter")))
... with the current code,
PHP:
monster_defense()
is returning the proper combat 90% value, while
PHP:
monster_defense(Monster)
returns the full 100%.
 

Attachments

  • DisplayRequestedML.patch
    3.3 KB · Views: 37

Rinn

Developer
I think it might get confusing if monster_defense returns both the 90 and 100% value when called different ways.
 

Theraze

Active member
Unfortunately, the forum REALLY likes to break up functions when not put into certain methods... When I just put the functions in the main code, they started to get weird spaces in the middle. Same happened when they were just quoted. So now they're colourful php code. And the post is nearly unreadable. :( Ah well.
 

Darzil

Developer
Is the 90% thing the reason why Dwarven War Outfit is showing Attack values that (within normal variation) match the values reported by mafia, but Defence values that it shows are around 10% less than mafia ?

Although I guess that relates to base stats, as I'm not running +ML. Noticed this whilst running War Outfit waiting for GMoB so I could get his attack/defence.
 

Theraze

Active member
Exactly. It's also why if you look at the wiki on the monster data page (which updates based on the individual pages, or vice versa... not exactly sure which order their data pulls, but it's officially not updated in years and the data matches) the defence stat is ~10-11% higher than the individual page. You'll get an attack of 100 and a defence of 100 on the monster data page, and an attack of 100 and defence of 90 on the individual page...
 

Bale

Minion
It's also why if you look at the wiki on the monster data page (which updates based on the individual pages, or vice versa... not exactly sure which order their data pulls, but it's officially not updated in years and the data matches) the defence stat is ~10-11% higher than the individual page. You'll get an attack of 100 and a defence of 100 on the monster data page, and an attack of 100 and defence of 90 on the individual page...

I've never entirely understood what that disparity exists, here or there. Could you please explain it clearly for the slow kids?
 

Theraze

Active member
This is working based on my chaotic thoughts, and so may or may not be based on reality. However, here goes.

Someone at some point noticed that with the way stats worked, apparently the defence stat detected at roughly 90% of the attack stat most of the time. When the original data was put into mafia/the wiki, the data was put in at the 'full' rate, which is usually very close to the attack rate. This worked out. With the advent of items that give combat defensive levels, the derived value of 10% lower defence (to make it easier to hit them) became the standard, and the wiki was adjusted to display the lowered value instead. The 'full' value is apparently used for ML modifier values as well, so 10 points of ML should provide for 9 points of defence on non-scaling mobs...

Again, this history is based on the chaotic workings of my brain, and any relation to reality exists on a sliding scale of reference and relevance.
 

StDoodle

Minion
[completely re-written edit]

Wow, is it complicated. Some templates only use "level." Some use "attack" and "defense." But defense is always (from what I've seen) stored in their data-files as equal to attack. A special version of certain templates takes the data file's defense & multiplies it by 0.9.

I can see why it happened, as I get a small sense of how things grew looking at the templates... but damn, is that cludgy.

Basically, Theraze's guess was fairly accurate, except without the level of pessimism needed to be exact; no one actually started putting the data in correctly, they just changed how it's displayed (but not everywhere). Poor Quietust.

Anyone who ever says I went overboard on templates for the KoLmafia wiki can feel free to dig into Coldfront's back-end, btw. ;)
 
Last edited:

Theraze

Active member
Remember that it's 10 moxie for safe, not 6 or 7... Or is it 11 for safe now? I think it was at 10 out that there were still rare non-critical hits.

Though that's based on the modified stat. And after this patch gets committed, the monster_defense command should return based on the 90% (combat) value.
 

Theraze

Active member
Not actually implemented.
> ashref monster_attack

int monster_attack( )
int monster_attack( monster )
string to_json( null )

The question is, should it be a further overload to monster_attack and monster_defense or a new command? I could see this being an obvious overload... monster_attack(Monster, ML). If you want base, just do monster_attack(Monster, 0).

Alternatively, we could do this as base_monster_attack(Monster).

Neither base_monster_attack(monster) nor monster_attack(monster, int) exists in my copy... does it exist in yours? :)
 
Top