Feature - Implemented Tracking Combat Monster Level

Theraze

Active member
No... they just heal something around 90 or so health every round. Long as your weapon is decent, it's not impossible to kill them... do need to plan on damage as opposed to other bonuses though.
 

Bale

Minion
You can get some nice damage bonus by learning Rage of the Reindeer and Snarl of the Timberwolf for an extra +30 damage. (Spooky is doubled against Sleazy monsters.) That'll likely get your damage high enough to kill them. Or else, learn Fearful Fettucini to simply annihilate the poor nursie.
 

zarqon

Well-known member
The problem with using the system to spade the stats

I wasn't talking about spading. I'm talking simply about fixing mafia's in-combat knowledge of the monster's current stats (the adjusted values) given known information. You evidently thought it up yourself later though:

Output a message or adjust the variable if it thinks that the miss/dodge shouldn't have happened. Criticals will still throw this off...

This is exactly what I was suggesting here:

If you miss the monster (non-fumble), the monster's defense must be at least (your attack stat - X). If you hit the monster (non-crit) its defense cannot be higher than (your attack stat + X). And so forth. Any ideas for adjusting monster attack within range (In other words, an easy way to tell a monster's crit from a regular hit, or a monster's miss from a fumble)?

All monster stats should be adjusted if we have correct information from spading equipment (detective skulls and so forth). Mafia already detects these messages somewhere so it's probably possible to just add correction of the adjustments there.

After that:

Monster HP
Basically, HP = minmax(1, monster max HP). For unknown monsters (HP 0), bump max HP up to 1 greater than the amount of damage it survived in one turn.

Monster defense
Since it's easy to see when the player gets a critical or fumble, monster defense can be adjusted on successful hits and misses, as I described above. If the player has the Comic Violence effect (from gremlin juice), do not adjust defense at all.

Are there any monsters with 0 defense? Seems like a nonzero lower bound probably exists.

Monster attack
This can only be adjusted if we can find a way to distinguish the monster's regular hits/misses vs. criticals or fumbles. Are there any usable <!--comments--> in fight.php about this? I don't think it's a good idea to detect ALL of the monster critical/fumble messages in mafia just to add range-correction to mafia's current knowledge of the monster's stats -- unless those are part of the data file perhaps. But I feel that there must be a universal solution.

Also, any monsters with 0 attack? Again, it seems like a nonzero lower bound probably exists.

For all of this, I'm talking about mafia's in-combat values. Not the monster data files. Although... once the stat correction is in place, adding some kind of auto-spading might not be too hard.
 

Winterbay

Active member
You can get some nice damage bonus by learning Rage of the Reindeer and Snarl of the Timberwolf for an extra +30 damage. (Spooky is doubled against Sleazy monsters.) That'll likely get your damage high enough to kill them. Or else, learn Fearful Fettucini to simply annihilate the poor nursie.

Yes, I have those now and will see what happens, however last time I tried it I was in Badmoon and thus did not have any access to skills outside of the chosen class. And there are also more ranged weapons now than before so this might help as well. It does not make moxie classes any less boring though (even though combat macros helped a lot in that regard) :)
 

Theraze

Active member
All monster stats should be adjusted if we have correct information from spading equipment (detective skulls and so forth). Mafia already detects these messages somewhere so it's probably possible to just add correction of the adjustments there.

After that:

Monster HP
Basically, HP = minmax(1, monster max HP). For unknown monsters (HP 0), bump max HP up to 1 greater than the amount of damage it survived in one turn.

Monster defense
Since it's easy to see when the player gets a critical or fumble, monster defense can be adjusted on successful hits and misses, as I described above. If the player has the Comic Violence effect (from gremlin juice), do not adjust defense at all.

Are there any monsters with 0 defense? Seems like a nonzero lower bound probably exists.

Monster attack
This can only be adjusted if we can find a way to distinguish the monster's regular hits/misses vs. criticals or fumbles. Are there any usable <!--comments--> in fight.php about this? I don't think it's a good idea to detect ALL of the monster critical/fumble messages in mafia just to add range-correction to mafia's current knowledge of the monster's stats -- unless those are part of the data file perhaps. But I feel that there must be a universal solution.

Also, any monsters with 0 attack? Again, it seems like a nonzero lower bound probably exists.

For all of this, I'm talking about mafia's in-combat values. Not the monster data files. Although... once the stat correction is in place, adding some kind of auto-spading might not be too hard.

Does KoLmafia already adjust based on skulls and the like? I'm not quite sure which file it uses for handling combat items...

My question on monster HP was whether dropping ML would drop max healable HP, or if it sticks based on outside-combat ML. If it's sticky, then we need a version of monster_level_adjustment that returns non-combat ML. Possibly overdrive the command to allow for a boolean. Make no boolean/false return the 'old' ML, true return combat-aware-ML. Again, this will take someone getting to testing point, probably with NSNs or something similar where it would be quite visible.

The only places I was going to adjust monster attack/defense manually was on the few skills/items that only affect one or the other, not the whole fight ML. I wasn't planning on screwing with the whole arrangement for this... it makes things more difficult. At least initially. If we hold that attack/defense are linked, it allows using them together to decide whether adjusted ML goes up or down.
 

xKiv

Active member
Have you confirmed this by stunlocking her and hitting for more than what max should be? I've never had it survive more than ~200 damage when stunlocked.

You are thinking of the SN (sorority nurse). They are thiking of the NS (naughty sorceress).
(is what I assume because of the "200 damage" comment - NS has more than that even in her first form)
 

Theraze

Active member
And the notes section suggests the same as the talk page does, for the Naughty Sorc, that healing above max is possible. So... if SHE breaks the 'rule' we constructed, can NSN? Can others?
 

Theraze

Active member
Yeah... but it takes more effort to make exceptions than it does to make something the new standard.

Bottom line here is that I'm not going to code displaying combat restoration until we're SURE on this one. Not just that we expect it to be that way because otherwise it'd be evil. :)

From the way the page reads there (bizarrely the main page and discussion conflict heavily on HP max), she at least goes to cap, heals about 90 hp per round. Not sure if amount healed is linked to which message, but on her at least, I'd probably display the healing as 90 up to the cap.

Would still need to know about whether or not delevel drops her max HP though.
 
Last edited:

Theraze

Active member
Put a new patch in the first post. It appears that NSN heals ~90 hp to cap, the ghuols heal ~10 hp, and the NS heals ~125. Besides the NSN, nobody's healing appears capped...

The information above comes from the discussion pages on each... I'd rather err on the side of overhealing the NPCs so I kill them well.

NSN heals 86-90 and caps. I picked 90.
Ghuol is unknown but at least 4, Huge Ghuol is completely unknown but not much, and Gaunt and Gluttonous are both 1-10. As they all provide the same message, and the range fits for all 4, I set the healing for these at 10.
NS apparently heals something around 100-125. Following this, set it to 125.

Edit: Gah... something's up... the monster_level_adjustment that's combat aware, outside of combat, returns my list of skills instead of an int. Bizarre...

It's doing this currently:
> combat_monster_level_adjustment

Moxious Maneuver (14 mp)
CLEESH (10 mp)
Sing (1 mp)

> ash combat_monster_level_adjustment()

Returned: -7
 
Last edited:

Theraze

Active member
<coughs>triple posted</coughs>

Okay, figured it out. combat* in the CLI matches "show combat skills" renamed combat_monster_level_adjustment to monster_level_adjustment_combat and all should be well. Uploading new version of the TCML patch in post 1. As I said, it should also be tracking monster healing on the 3 types of monsters where I'm aware of it happening... And since it wasn't actually a bug with my code, just poor name selection, I'll pull out the combat round hack, since fight monster level it set to 0 if it's not currently going.

Tied into the "feature" causing this skill rename... combat_rate_modifier falls into the same trap... can't be run from CLI, works fine from ASH. Renaming it would confuse a lot of scripts though... but sort of tempted to put in a duplicate as modifier_combat_rate so you can actually run it from CLI if you want to without doing an ash first. <shrugs>
 

Theraze

Active member
Nobody else wants to test this or give me ideas on what they want, etc? Fine, be that way... anyways, here comes a new version of the patch, attached to the first post. New changes...

Made monster healing in updateMonsterHealth actually update even if logMonsterHealth is disabled. It shouldn't display the additional logging if it you have the logging off, but the relay should still display properly. This was a bug before where it knew how much the Boss Bat was healing but would only display properly with the logging turned on.

As well, the monster healing is now located in the updateMonsterHealth function where it was trying to track them already, instead of being its own function at the end of the round.

Added mana drain mob-healing for both NS1/NS2 and LSR.
 
Last edited:

Theraze

Active member
Included a new version of the patch. Since nobody is actually trying it out, no reason for me to remove my Black Cat/OAF problem familiar fixes... Unless someone asks for it to be removed, expect to see it in further patches.

This one should also have the NS ML reset detected, for NS1 at least... Anyone else that can reset monster level if overly weakened?

Also changed the weakening weapon detection to use regex so I only need one check instead of using two. Uses (?:(opponent looks)|(opponents look)) to detect between single and multiple enemy types... if anyone has seen other texts for these, should be easy to add.

Scrapped the double functions and overloaded monster_level_adjustment again. Put a manual version of the to_boolean code into it so that it would actually properly understand what "true" and "false" are. Verified it's working. Non-overloaded or overloaded true CLI command returns combat; overloaded false CLI function returns non-combat. Base function non-overloaded or overloaded false returns non-combat; base function overloaded true returns combat. This should allow for the most useful/expected function to be available in all cases.

Only thing it still needs potentially is combat items, if they weren't properly working before (weren't dropping the internal combat level). Skills were already loaded before, though you couldn't see them. If the items were already working before, the patch should be ready for people to start testing it out...

Edit: Looks like they're done in FightRequest.parseCombatItems... I'll need to make it have a switch for itemId in there... monster level/attack/defence is completely ignored currently.
 
Last edited:

zarqon

Well-known member
This is sounding excellent, Theraze! I don't know how to test this out so I can't really verify that it's as great as it sounds, or offer any suggestions yet.

Did you check my list of monster level-effecting stuff from the previous thread? There's a few combat skills mafia does not yet track, a chefstaff-jiggling, and loads of combat items. There's also all familiar deleveling. Veracity and I did some of the work for you already a bit later in the thread, scraping detection strings and formulas from the Wiki (the later post even includes ranges rather than average values). However, I think you'd have to regex most of those detection strings to account for both multiple/singular opponents.

Then there's haiku combat, which is something Veracity has always wanted to work just as well in mafia as regular combat. But that's a much later bridge to cross, methinks.
 
Last edited:

Veracity

Developer
Staff member
I worked hard to make Haiku combat work well. The only bugs currently open are when combat is Haiku and we don't know it - because we Teleported into the Haiku Dungeon, for example. So, yes - any final solution to delevelling need to include recognition of the haiku delevelling messages.
 

Theraze

Active member
This is sounding excellent, Theraze! I don't know how to test this out so I can't really verify that it's as great as it sounds, or offer any suggestions yet.
Not a problem, just hadn't had any responses so I was wondering if people had decided it wasn't important anymore. I'll keep working on it since people do care. :D
Did you check my list of monster level-effecting stuff from the previous thread? There's a few combat skills mafia does not yet track, a chefstaff-jiggling, and loads of combat items. There's also all familiar deleveling. Veracity and I did some of the work for you already a bit later in the thread, scraping detection strings and formulas from the Wiki (the later post even includes ranges rather than average values). However, I think you'd have to regex most of those detection strings to account for both multiple/singular opponents.
Regarding values... do we want to work based on average/mid-low/low levels? With 1-5, average would be 3, mid-low would be 2, and low would be 1. I'd currently prepped the items as low values, so it definitely drops their values enough, but mid-low is probably fine...
Then there's haiku combat, which is something Veracity has always wanted to work just as well in mafia as regular combat. But that's a much later bridge to cross, methinks.
That's an additional set of chaos... should start by making it detect if the combat is haiku. Should be able to verify based on if the message matches... depending on how many possibilities we want to search for.

After we have haiku reliably known, we can look for its delevelling messages just like anything else...

So, what I need to continue now is to have someone tell me (or find) where used combat items are parsed. If they don't currently have special parsing, I'll have to look for those specific messages in the processMonsterLevel command. Currently I've just written it to look based on the itemId, but if I can't do that, I'll put together the 60 or so string comparisons... but that's rather a large and messy addition to the regex patterns.

As well, there's an actual decision needed (that anyone, but probably zarqon would be best suited for) regarding which range of numbers to use for combat item delevelling.
 

zarqon

Well-known member
For combat items, I'd say go with mid-low. But what you may want to do is code ranges into everything, and then have a constant designating which place in the range to use. For example, 0.0 would mean to use the minimum value, 0.5 would mean the average, 0.25 would mean the halfway point between the two, etc. This would make the decision easily changeable.

I'm willing to play it a little bit less safe than minimum values because I'm assuming that detection/correction will be applied when you hit/miss a monster normally.
 
Top