Feature - Implemented Tracking Combat Monster Level

Bale

Minion
It seems like a lot of hard-coding is going on. Maybe a data file with info on combat items should be created for this?

Agreed. That does seem to be KoLmafia usual style when dealing with such a situation. Hopefully the esteemed Veracity will share her more informed opinion on the idea.
 

Theraze

Active member
I did look to see if there was anywhere in the current datafiles that adding delevelling would make sense... didn't appear to be yet, so whoever wants to figure out a new map can do that. I'd suggest having id/name/min/max/type (all/attack/defence) at least... not sure what else a proper 'official' map needs.

Edit: Ah yes, occurs to me... if anyone wants to try this but doesn't have the ability to compile, shoot me a message and I'll send you the jar as an email. Hopefully should be adding familiars to the list today, and then all that will need to happen is refining the system.
 
Last edited:

Veracity

Developer
Staff member
I'd suggest modifiers.txt. Add something like Combat Delevel Min: x and Combat Delevel Max: y and Combat Delevel Type: z, or something. Create a new section for Combat Items. Perhaps, even, a section for Combat Skills.
 

Theraze

Active member
Well, that (modifiers.txt) was easier than expected... I'll upload the patch for that now.

Edit: So, that was likely the main change for today. Tonight/tomorrow, familiar actions are next. That's it, right?

Edit2: Just fought Dr. Awkward manually for the first time in I don't know how long and he has a self-heal as well... something about taking out a first aid kit and patching himself up. Which explains how he got to -27 health and was still alive. According to the spading page, it's 45-50, so I'll have it marked as healing 50.

Scanned through the "healing" phrase in the Wiki and only found one more section, though it's more annoyingly unspaded... The Mer-Kin Outpost has, for all 3 mob-types, Mer-Kin Healers healing up the mobs. They have a standard message, but it doesn't appear anyone's spaded it even the slightest bit... :(
 
Last edited:

Theraze

Active member
Okay, think my mental mess is enough to botch this rather heavily. :) So... unspaded familiar things that I can't put into the system yet, similar to the Mer-Kins... fishy wand, fuzzy dice (rolling 5 is apparently delevel, but nobody has spaded and its mentioning is mostly removed from the main page), and Wizard Action Figure. Anything else besides NPZR, RoboGoose, PRESSIE, Ghost Pickle, Animal Skeleton, Personal Raincloud, Spooky Pirate, Cocoabo, and the Barrrnacle (and various offshoots)? Those will be the initial familiar set... the Purse Rat is already handled, since it's an 'always' thing, it just directly modifies monster level.

Edit: Also included the Autonomous Disco Ball as a max level 20 SPS. Should be set, if I understand the way modifier bits work properly, as min(weight, 20) if not DB, min(weight*2, 20) if you are.

Attaching new update to first post. So... what's left with any kind of spading?

Edit2: Also added the Emo Squid, Llama, Megadrone, Riftlet, Stocking Mimic, Penguin Goodfella, Animated Macaroni Duck, and the Pair of Ragged Claws. Think that might be it, in terms of spaded/theorized delevelling?
 
Last edited:

Theraze

Active member
Okay... patch uploaded. Changelog summary: Delevelling familiars now are noted in modifiers.txt just like delevelling items. The familiar delevelling text should be matched in payActionCost, similar to payItemCost. Also added Dr. Awkward's healing. Apparently it's 45-50, so I set it to 50 as overkilling enemies doesn't end up with you being dead...

The future...
Depending on dev preference, it could only load familiar modifiers if it matches the activation text. It saves an internal check for modifiers, but adds ~18 individual loads. This would be bypassed if I did the following...
May convert the processCombatDelevel function to also handle loading the modifiers... that makes the code look nicer initially, but makes the function slightly more rigid. If that happened, would need to add a bool for "isFamiliar" or something like that so that it knows to use fam: familiar type instead of itemId. Probably wouldn't be too difficult though. If more delevelling things show up besides items, familiars, or skills (which aren't handled by this, but are handled by other code that already existed), would probably need to change the bool to an int and recode some of the support files. As I said, looks nicer, more rigid.
Adding anything else regarding monster healing or combat delevelling that's been spaded, or even has good theories postulated. Anything else known by anyone here?
 

Theraze

Active member
Okay, the 101010 patch (apparently that would make it 42 in binary) now has a new version of processCombatDelevel that runs based on (Modifiers mods) instead of having the information already loaded. Familiars only load their modifiers if their delevel activated, so that should reduce internal hits by a bit. For bang potions, added the modifiers to the mods value, since the value was currently blank.

Bizarrely, the last two patches have added functionality and reduced size. Optimization terrors! So... what's left to do, function-wise? :) Obviously I'm going to test it a bit before I say it's beautiful, but excluding the verification of everything working properly, what remains?
 
Last edited:

Theraze

Active member
Okay, found me a bug... bang potions no longer properly process. With the currently uploaded patch, it debug-errors, as it's adding to an uninitialized mods (bang potions don't have proper mods, so it returns a null, and it needs to be reinitialized) but even after you initialize it, it doesn't properly affect ML... guess it's time to tweak the processCombatDelevel back again, so I can just pass the values instead. Shouldn't increase size TOO much, but I'm expecting it to actually work with the bangs again, which would be an improvement...

Edit: Okay, so here's what we have now...
You're fighting a mind flayer
HP: 75, Atk: 87, Def: 55
Drops: mind flayer corpse (25), cornuthaum (15), large box (20)
You're fighting a mind flayer
HP: 75, Atk: 87, Def: 74
Drops: mind flayer corpse (25), cornuthaum (15), large box (20)

You throw the fizzy potion of teleportitis at your opponent. It shatters against it. It starts disappearing and reappearing in random spots around you.

Obviously fixed now. I made the processCombatDelevel work like this now... processCombatDelevel( final Modifiers mod, int min, int max, int type ). If mods != null, load the values from mods, otherwise allow min/max/type to remain. The normal bits use loaded mods, 0, 0, 0. The bang potions use null, min, max, type. Both properly process and update now. Uploading patch to first post. I'll need to test familiar delevelling sometime soon... when I'm not stuck in a BC ascension. Stupid one wrong adventure last time. :)
 
Last edited:

Theraze

Active member
Okay, that bug is fixed. Semi-bizarrely, size went down another .8k with this fix. Horrors of cleaning, I suppose.

Only thing I haven't gotten to test with this yet are the familiar delevellings. I'll do that as soon as I can, but it might be days/weeks depending on how nice the item slinging is for Black Cat. We'll see. :) If someone runs into other thoughts on things to implement or problems with how it's currently running, let me know.
 

Theraze

Active member
And...
[3452] Fantasy Airship
Encounter: Random Lack of an Encounter
Encounter: Protagonist
Round 0: Maymne wins initiative!

> monster_level_adjustment

Returned: -7
You're fighting a Protagonist
HP: 80, Atk: 93, Def: 93
Drops: phonics down (40), ridiculously huge sword (10), super-spiky hair gel (20), ocarina of space (5)


You climb the ladder down into the crew quarters, and encounter a Protagonist, lying on a cot and brooding.
"Hey there!" you say, "Whatcha brooding about?" He looks up at you, broods more intensely for a few seconds, and then charges at you with his gigantic sword drawn.
You get the jump on him.
Torg latches onto him and slows him down...

Familiar tracking is working. So... I guess that's a wrap for this patch? Want me to spin another copy with the updated code, or do we have anything else that needs to be done before we knock this one out?
 

zarqon

Well-known member
Wow, Theraze, this is looking terrific.

I'm not sure if you mentioned this, did you include jiggling the Staff of the Walk-in Freezer? Also, there are some Bandersnatch skill enhancements that delevel.

For anything that delevels an unknown amount, as long as the amount is nonzero, I think that would be fine.

Did you add ML correction for player hits and misses? (checking for absense of fumble/critical messages)

(Also, I sympathize about your flubbed Kittycore run. I accidentally ruined mine when I was training my last familiar for the tower -- I was mixing relay and CLI play and forgot to switch back since the relay graphic was still the kitty. All I had left was the NS. I recall I went outside for a walk at that time.)
 

Theraze

Active member
I'd put payItemCost into jiggling chefstaves, so it was checking for it, but it didn't get added when I recoded combat delevelling items into modifiers.txt, so just added that again.

Bandersnatch... nobody's done even basic spading, or is even apparently certain that delevel is what it's doing. After there's at least a few guesses, we can add them, but... we need to know at least a basic guess on what to add.

No ML correction yet. I figured we'd get the actual system working first, then we can do ML correction, since ML (and MA/MD) correction isn't necessarily based on this, but is more based on being certain on safe-moxie for dodging and guaranteed-muscle/moxie for to-hit. From what I've seen though, there's a bit of confusion still based on what the exact number for safe moxie is, though that could also have to do with that there's apparently a 5% +- to monster hp/attack/defence which makes knowing exactly where it's at somewhat difficult. Ah well.

And regarding kittycore... already finished the replacement run now. Broke mine exactly the same way. Did relay to kill the sorceress after the familiar training in CLI.
 

zarqon

Well-known member
Ok, I'd suggest adding all the Bandersnatch (and Crown of Thrones for that matter!) messages, with a delevel of 1. For plinking strategies, or for combat scripts that may depend on some passive deleveling going on, it's mainly just important that it's nonzero.

The +5% monster variance is a nonfactor for correction, since correction is based on the player's stats. If anything, it's a further reason why correction is necessary. But you're right -- it's related, but almost a separate project.

EDIT: I can verify that Bander deleveling happens for at least the Sauceror free combat skill. During the level 12 quest I had to spam monsters with that skill for a bit before I was able to hit them.
 
Last edited:

Theraze

Active member
Good enough... so, if we're doing 1/1/1 (min/max/type) for delevelling familiars/items/skills/ghosts with unknown effects, what are those? Bander, Fuzzy Dice, Wizard Action Figure, Mole tunnelling up/down, fishy wand, miniborg hiveminder, and spice ghost... anything else? Those are the only ones listed (and Bander actually isn't listed there currently) in the Monster Level wiki post. Also, will have to look how the ghosts are currently handled, since they aren't familiars or anything I can handle with that code... if it doesn't have standard modifier bits on them currently, I may need to use an override on that one to keep it consistent. Ah well, least the way it's coded now, I can either use the modifiers or exact values (bang potions use exact values, since the item numbers change)...

Edit: Almost done. Do have a question though... in the case of having Cunctatitis and not doing anything, can your familiar still do things? If so, the current code would become bugged (payActionCost stops after it detects deciding not to do anything) and I'll fix that in the wide sweeping stuffs.

Edit2: Two pasta guardians actually delevel, according to the page... spaghetti elemental as well as spice ghost. Going to assume for spice ghost that the level 5 delevel power is the one for
shakes some of the spice into your opponent's eyes as he gets accustomed to his new body.
and make that a guaranteed 5 delevel. According to the spice page, its normal delevel is 1-weight, so I can put that in as well. SE is completely unspaded though, and its page doesn't contain the same information about delevelling that the main pasta guardian page does. Ah well, 1/1/1 for that one.

Edit3: Okay... finishing up now. Spice starts with "shakes some of the spices into your", and midrounds are "fires a cloud of confusing spice at your" and "choking cloud of spice" (which actually matches two of the attacks). Spaghetti appears to be missing its normal summoning message in the wiki, so I couldn't match on that. For midround, I'm matching on "noticeably weakened by the attach" which, according to the wiki, is unique to Spaghetti Elemental (searched for noticeably weakened, SE was only result). Put this in before the familiar checking.

Edit4: Doesn't appear to currently be a spice ghost level check anywhere, even in the pasta ghost display command. Used Math.floor( Math.sqrt (experience) ) to calculate level, which should be right. Only thing left before I upload the new version is adding the 1/1/1 tunnelling skills. Think I'll leave that for a few minutes, so new patch will probably be up now. :D
 
Last edited:

Theraze

Active member
Okay... unspaded list follows... All of these are in with 1 as a guaranteed delevel.
Familiars: Frumious Bandersnatch, Fuzzy Dice, Wizard Action Figure
Familiar Item: fishy wand
Combat Item: Miniborg hiveminder
Skills: Tunnel Upwards, Tunnel Downwards
Pasta Guardian: Spaghetti Elemental

Spaded additions:
Combat Item: Staff of the walk-in freezer
Pasta Guardian: Spice Ghost

Remaining:
Anything missed in spaded or unspaded... anything else people can think about I've missed?

Someone to come up with a good name for the monsterDelevelRange preference for how optimistic/pessimistic you want to be regarding guesses.

Also, deciding how much granulatity we want with it. Right now, it works in segments of 25%, so 0 is minimum/conservative always, 5 is maximum/overly-optimistic always, and 2-4 are some range between them. Could make it go to segments of 12.5%, so it'd be 0-9... Easy to change now before it's been set, difficult once people have their settings out there.
 
Last edited:

zarqon

Well-known member
Why not make it a float from 0 to 1, with 0 being totally safe and 1 being totally risky? Default could be 0.3 or something.

I've been working today on adding the horrible Crown of Thrones in to SS (I suppose I like the item from a gameplay perspective, but I loathe it from a "writing BatMan" perspective). There are quite a few deleveling enthroned familiar actions, most of which seem fairly well spaded. One of them actually adds +10 ML each time it acts (the O.A.F.). All the messages are on the individual familiar pages, but the handy chart is here.
 
Last edited:

Theraze

Active member
Potential issue with making it a float is in how the loss of precision is done. Because I'm converting it into an int, if I have it convert too early, everything converts to "and that means absolutely nothing" and if it converts too late, the flip of that happens. By giving a more static set, I can do my "low + (variance * (0 to 8 / 8))" or however it's working... Basically, multiply first, divide second, and any precision lost client-side is a bit more likely to be the same (well, with possible ceil/floor) as would be done with the server-side itself.

So... question about the CoT. The main effect is outside combat/permanent, additional effects are ones that can trigger multiple times? So the Megadrone is a +10 ML visible on your panel, but the slimeling delevel is during combat. And unspaded. And then the next one listed is the Dramatic Hedgehog, which is not only unspaded, but missing its CoT combat message... *sighs*
 

zarqon

Well-known member
Yeah... that's how I feel about the CoT too. In my case, since I'm predicting, I also have to worry about action rates, many of which are unspaded. *sigh*

Can't do much besides add what's there and leave commented lines for what's not.
 

Theraze

Active member
Any thoughts on the float precision issue? Besides doing all of the calculations as a float, and then converting it into an int for the end, not really sure if there's a good way to keep relative levels of accuracy around. Far as anyone knows, they keep things in the int-realm and avoid floats for those calculations, right?
 
Top