Feature - Implemented Tracking Combat Monster Level

Fluxxdog

Active member
This is what I'd want to see in my log:
Round 1:
You used item A! Something happened!
Monster attack deleveled by x.
Monster defense deleveled by y.
Round 2:
You used item B! Something else happened!
Monster deleveled by z. <==indicates attack and defense
Round 3:
You attacked with something completely different!
Monster took 29 damage.

The preference "Session log records attacks for each round" should cover using the item, right? The results, like Veracity says, seem more tied to "health changes". In this case, though, the health seems more like their status. Theoretically, a monster's defense can be reversed engineered (without Dwarven War gear) by applying not only the damage you do, but how much it's been worn down.

I would go for aii. monster health and status should go hand in hand. If you're spading something, then whatever you do to the monster ALWAYS matter, even if it's to see if it doesn't matter. However, if someone doesn't want something logged, they should have that choice. i is never a good option.

Of course, the choice between i and ii is rather moot when you consider most people will simply parse their logs for info anyway :p I always have all my logging options on (except the adventure count)
 

Theraze

Active member
The issue with option a that I see is, what if this happens?

This is what I'd want to see in my log:
Round 1:
You used item A! Something happened!
Monster attack deleveled by x.
Monster defense deleveled by y.
Round 2:
Round 3:
You attacked with something completely different!
Monster took 29 damage.

Round 2, your fuzzy dice did something... you don't have familiar actions logged though, so when your familiar does damage, or delevels, it's not logged. Sorry. Part of the special fuzzy dice handling code. Just the way things work. -_- Looks like they're just a 'special' familiar that has their 'normal' handling completely dependent on their actions being fully logged. Guess that's something else to fix... they should still have their actions processed, whether or not it goes into the logs.

Anyways, not sure exactly how familiar damage is parsed when you only have damage logged, not their actions... fully logged, it looks like these...
Round 13: Theraze attacks!
Round 14: naughty sorority nurse takes 66 damage.
Round 14: Trot paws at the ground for a second, and then charges your opponent, bashing her for 21 damage.
Round 14: naughty sorority nurse takes 21 damage.
Round 14: Trot lodges the ice-cold pick in your enemy, dealing 24 damage.
Round 14: naughty sorority nurse takes 24 damage.
Turn off familiar actions though? All it knows is that I attacked once and the NSN took 66 damage, 21 damage, and 24 damage that round... it wouldn't tell me that I had a double-familiar activation due to familiar item, or otherwise help me to look back later. Say it's delevelling... if it just knows that the NSN was delevelled twice for X and Y, how does that help me know what caused it? :|

Anyways, my reason for preferring b over a is because then I can turn off everything but the delevel if I so choose, and get clean-ish logs if I'm limiting myself to a single source of delevel. I don't care that my mosquito bit it and did 3 damage in round 7, I care that the delevel range appears to be 3 to 5 in 30 attempts. :D

I'll acquiesce to majority though. Is the standard impression that monster health/attack/defence are all tied together?

Also, I'd probably avoid ever showing them linked together with the phrase delevel, as that appears to be a depreciated term now that they are displaying them individually. Also, it complicates both parsing logs and the logging itself... means instead of doing a m.find{}, I need to do m.find{}, n.find{}... or alternatively, keep the values poked into different ints between searches, and not log until the whole mess is done. Possibly losing out on logging in the case of multiple-activations.

Anyways, if I'm going to do this, I'm going to do it right... whatever that happens to be.

Edit: If we do roll it into the current health tracking, I propose we rename it to something regarding what it's actually doing... log monster stat change, log monster attributes, something like that. Because attack/defence/hp (or health, as I originally wrote it here) are the 3 monster attributes, and linked in that... but unless the monsters get guaranteed flavour text (besides the current skill/item/whatever activation) about how they're becoming more sickly or the like for dropping their stats, I don't mentally connect their 'health' with their attack. Health and hp? Sure... if you're spewing blood all over the place, you're probably not doing too hot. Health and attack? Not so much... just because you're having trouble hitting someone doesn't mean you're necessarily about to expire.
 
Last edited:

zarqon

Well-known member
I'd just use KoL's wording for this. Usually the stats are decreased, but they are sometimes increased, and a message saying "deleveled by -10" is confusing.

If I were an "average" KoL player and not party to this discussion, I would have no idea that logMonsterHealth would also log +/- ML. Please chime in if you think I'm wrong, but I don't think the average person considers ML part of a monster's "health", especially given that current HP and level are affected quite separately for PC's. For that reason, I liked the idea of a separate preference with a more obvious name, such as "logMonsterLevel" or "logMLChanges". BUT, as Theraze noted above, this presents difficulties in attaching ML change events to the correct trigger. If a familiar delevels a monster and you have set logMLChanges but not logFamiliarActions, what should mafia log?

I suggest

1) Always log damage / deleveling if it is part of an attack and logBattleAction is set.
2) Always log damage / deleveling if it is part of a familiar action and logFamiliarActions is set.
3) Log other sources of monster damage/healing and attack/defense adjustments if logMonsterHealth is set.
4) Change the wording in the GUI to indicate that logMonsterHealth affects more than just health. Something like "Session log records changes to monster HP/attack/defense".

This is consistent with mafia's existing behavior (I think?), and avoids the need to add a new preference.

@Doodle and Theraze: There are uses for isolating 3 (as I mentioned, such as avoiding triggering the NS's delevel shrugging), but these uses are few and far between compared to accessing 1+2+3. If you actually boil it down, we all completely agree. I don't want functions returning 3, just 1+2+3, so long as we can actually access each component somehow. The only reason we would need additional functions is for code clarity, but those could just as easily be ASH wrapper functions.
 
Last edited:

Theraze

Active member
Hmm... so 1 and 2 would be a change to existing functionality, as it doesn't currently log damage if you don't have it tracking changes to monster health. This is intended, correct?

For 3, would it only log if it doesn't fall under 1 or 2? If you had it set to log damage/healing and attack/defence changes, tracking your actions is off, and you attack... does it still log that they took 107 damage? As it currently stands, it would, but wouldn't tell you why or what caused it.

Strongly agree on the fourth though. :)

And true, the NS is the main case where knowing how much weakening you've done in this combat would help. I forget about her since I just make sure my moxie is enough to always dodge, and happily kill away using my melee/ranged weapon. :D The prospect of another instant karma has never been enough to make me actually try to kill her at level 13...
 

zarqon

Well-known member
Didn't intend a change to existing functionality with 1 and 2. I only intended to integrate stat changes into existing functionality. If that's not what I proposed, then scratch it. Perhaps I need a better understanding of how things are logged.

I had been thinking that battle actions always included their results. Likewise familiar actions. I just wanted to include stat changes in those results.

EDIT: Come to think of it, wouldn't that actually be a desirable change? Always include results with actions? When would you want to know "Your familiar says ARRRR or runs circles around your opponent or ties your opponent's shoelaces together", but not that it actually deleveled?
 
Last edited:

Theraze

Active member
Nope. Right now, it logs the damage, but doesn't log how the damage happened unless you have what caused it logged as well. That is why I was asking about if we wanted delevelling to force the other logs on, or separate it out... right now, actions and damage aren't linked, except that if you have all logging on, the damage is from the action directly above... If you have limited logging (but partial), like me... mosquito damages an enemy in a stasis round? Looks like my dictionary is damaging them.

So back to the question... do we want them linked (to damage) or separate, forced (other logging on) or individual?
 

Theraze

Active member
Okay, decided to, for now at least, implement this as Veracity originally requested. It's using the log monster health setting as the log bit... Regexping the attack/defence bits now. Only has 1 file modified now instead of the 7 we did before. This means I'll probably need to put together a patch later for approval on missed modifier bits and the like, but we'll get there later. A sample fight may look like this, noting rounds 12 and 14:
[2186] Palindome
Encounter: Racecar Bob
Round 0: Theraze loses initiative!
Round 1: Theraze uses the spectre scepter!
Round 2: racecar bob takes 10 damage.
Round 2: Theraze uses the spectre scepter!
You gain 5 hit points
Round 3: Theraze uses the spectre scepter!
You gain 5 hit points
Round 4: Theraze uses the spectre scepter!
Round 5: racecar bob takes 8 damage.
You lose 16 hit points
Round 5: Theraze uses the spectre scepter!
Round 6: racecar bob takes 10 damage.
Round 6: Theraze uses the spectre scepter!
Round 7: racecar bob takes 10 damage.
Round 7: Grot sucks some blood out of your opponent and injects it into you.
Round 7: racecar bob takes 1 damage.
You gain 1 hit point
Round 7: Theraze uses the spectre scepter!
Round 8: racecar bob takes 8 damage.
Round 8: Grot sucks some blood out of your opponent and injects it into you.
Round 8: racecar bob takes 10 damage.
You gain 10 hit points
You lose 14 hit points
Round 8: Theraze uses the spectre scepter!
You gain 4 hit points
Round 9: Theraze uses the spectre scepter!
Round 10: racecar bob takes 10 damage.
Round 10: Theraze uses the spectre scepter!
Round 11: racecar bob takes 9 damage.
Round 11: Theraze uses the spectre scepter!
Round 12: Grot sucks some blood out of your opponent and injects it into you.
Round 12: racecar bob takes 3 damage.
You gain 3 hit points
Round 12: racecar bob drops 2 attack power.
Round 12: racecar bob drops 1 defense.
Round 12: Theraze uses the spectre scepter!
You gain 4 hit points
Round 13: Grot sucks some blood out of your opponent and injects it into you.
Round 13: racecar bob takes 2 damage.
You gain 2 hit points
Round 13: Theraze uses the spectre scepter!
Round 14: racecar bob drops 3 attack power.
Round 14: racecar bob drops 2 defense.
Round 14: Theraze attacks!
Round 15: racecar bob takes 93 damage.
You gain 86 Meat
You gain 18 Muscleboundness
You gain 9 Enchantedness
You gain 11 Chutzpah
 

Fluxxdog

Active member
Round 12 is an issue. We know the deleveling came from the Spectre Scepter. The log makes it look like the mosquito is responsible. Doublechecked in the relay browser, the stat drops are coming before familiar actions:
Code:
You hold the spectre scepter aloft. It radiates a bright green light, and vines shoot out of it, entangling your opponent.
[img]	Monster attack power reduced by 3
[img]	Monster defense reduced by 1
[img]	Sweet Sock mimics a candy-striper nurse, heals some of your wounds, and recharges your mojo.
[img]	You gain 121 hit points.
[img]	You gain 121 Mojo Points.

His overpowering body odor almost knocks you out, but you hold your breath and back away.
(vs. a stone age hippy) Hope that helps some.
 

Theraze

Active member
It's because of the way that KoLmafia parses damage and so on... as Veracity seemed to be requesting, the tracking is done in the updateMonsterHealth function, which doesn't parse damage until after familiar actions have been logged and finished up...
 

Veracity

Developer
Staff member
No. I would like you to use the same user preference to log deleveling as updateMonsterHealth does. You should recognize and log the deleveling messages whenever they appear and log them at the time. Hopefully, that will put them right after the item, or weapon, or familiar, or whatever.
 

Theraze

Active member
So, you want a new function to track it, or me to rewrite health tracking to actually put your combat actions before those of your familiar?

Edit: The part about current combat logging that's always seemed odd to me is that your combat actions are listed the round before they happen. So if you win initiative and attack, you're attacking in round 0, but the damage happens in round 1. That would make sense... except that your familiar attacks in round 1, your CoT triggers in round 1, everything except your action happens in round 1. This means that casually parsing the information based on rounds doesn't work, unless you have an automatic +1 to your first action, the "Round XX: <name> " part.

I can make this consistent, or I can leave it as it is... Preference?

Edit2: So we have the round number question there... the logging issue is from having it in updateMonsterHealth, which appears to be the "end of round: doesn't really matter when it happened, let's just make it work now" health update. Which, if we're treating this like health, may be fine... but I think it's actually supposed to get moved into processNode. Have moved it to there, but now there's a related question... most of the items located in here are using an int matcher. I'd put together a specific matcher (For attack as an example, "Monster attack power reduced by <b>([\\d,]+)") to be used on them... the question is, would this be a good case for using the 'standard' int_pattern matcher? Seems to be... I'll put that into the patch, but won't be able to test it until next rollover earliest. If it does work though, and they don't mess with the icons or reuse them or other such horrors, it should be more prepared for flavour textings.

Initial-action-in-round-numberings remain as a question though.
 
Last edited:

Veracity

Developer
Staff member
I don't think I told you to put the logging into "updateMonsterHealth". You need an equivalent of "logMonsterHealth", which is called every time the monster takes damage, right from the place where we parse the damage. "updateMonsterHealth" does call "logMonsterHealth" - but only with 0 damage, which turns into a no-op. That is a vestige of dead code. I will remove it.

The "end of round doesn't matter" health update is the monster's actions - boss bat biting you, huge ghuol feasting, and so on.

Feel free to investigate round numbering - as your NEXT project. It's a can of worms.
 

Theraze

Active member
Heh. Okay, I'll do my best to finish this up to specifications before tossing a whole new set of chaos into things. Sorry about my confusion, it's just a whole mess of confusing code and figuring out where in the jumble a specific part is supposed to go has repeatedly boggled me. Though after being told it's not to remain in whatever place I've put things, there's always another new location where it can go. Always... *shivers*
 

Theraze

Active member
Okay, so the fights now look more like this:
Round 1: Theraze uses the spectre scepter!
You gain 4 hit points
Round 2: Theraze uses the spectre scepter!
You gain 4 hit points
Round 3: Theraze uses the spectre scepter!
You gain 4 hit points
Round 4: Theraze uses the spectre scepter!
You gain 4 hit points
Round 5: Theraze uses the spectre scepter!
You gain 4 hit points
Round 6: Theraze uses the spectre scepter!
Round 7: tapdancing skeleton drops 2 attack power.
Round 7: tapdancing skeleton drops 1 defense.
Round 7: Grot sucks some blood out of your opponent and injects it into you.
Round 7: tapdancing skeleton takes 10 damage.
You gain 10 hit points
Round 7: Theraze uses the spectre scepter!
Round 8: tapdancing skeleton drops 1 attack power.
Round 8: tapdancing skeleton drops 1 defense.
(unable to macrofy due to action: consult SmartStasis.ash)
Round 8: Theraze executes a macro!
Round 8: Theraze attacks!
Round 9: tapdancing skeleton takes 117 damage.
Round 9: Grot sucks some blood out of your opponent and injects it into you.
Round 9: tapdancing skeleton takes 10 damage.
You gain 10 hit points
You gain 18 Strengthliness
You gain 1 Wizardliness
You gain 9 Chutzpah

So, we doing okay now, or... what's next? :)
 

Fluxxdog

Active member
My god... It's full of stars... Or numbers anyway. Either way, I like the look of it ^^ I'm sure Zarqon is going batty for it too.

(Oh yes I did!)
 

zarqon

Well-known member
*Hangs upside-down*

Looks absolutely awesome. But all the results are listed before the prompting action!

*Turns screen upside-down*

Oh, much better. Yes, it's amazing!
 

Theraze

Active member
Actually, no, they aren't... the actions go together like this:
Round 6: Theraze uses the spectre scepter!
Round 7: tapdancing skeleton drops 2 attack power.
Round 7: tapdancing skeleton drops 1 defense.

It's the part where I mentioned it above, and Veracity said:
Feel free to investigate round numbering - as your NEXT project. It's a can of worms.
Maybe it will be, maybe I'll wander to something else. We'll see what ends up drawing in next. :)
 

zarqon

Well-known member
I meant that I needed to turn the screen upside-down since I was upside-down. :) The sequence looks great to me -- I have no problem with the round-numbering issue.
 
Top