Bug - Fixed r11688 - Maximizer issues with hot dmg vs. item

Fluxxdog

Active member
Found a hiccup when requesting a minimum of 1 hot damage in the maximizer. It insists on making all my accessories provide hot damage even though there are accessories that would have item scores higher than the hot damage. I would expect it to provide at least one solid enough source for hot damage, not 3. The items in question provide +5, +4, and +3 hot damage. I have item bonus accessories that provide +10, +7, and +7 so it should be using at least the first 2.(When compared to not having a required minimum for hot damage, it ignores hot damage completely since my item bonus would always outweigh the hot damage as expected.)

Code:
> maximize? hot dmg,item,dump

Maximizing...
SLOT 0
[bounty-hunting helmet, nurse's hat]
SLOT 1
[fire poi]
SLOT 2
[eye of the Tiger-lily, battered hubcap]
SLOT 3
[Misty Cloak]
SLOT 4
[Grateful Undead T-shirt, letterman's jacket]
SLOT 5
[poodle skirt, cane-mail pants]
SLOT 6
[frosty halo, Baron von Ratsworth's monocle, Nickel Gamma of Frugality, lucky rabbit's foot, hopping socks, cursed scrunchie, shiny hood ornament]
SLOT 7
[war tongs, stinky cheese sword]
SLOT 8
[happiness]
SLOT 9
[chocolate spurs]
SLOT 10
[]
SLOT 11
[dead guy's memento]
SLOT 12
[happiness, stinky cheese sword]
4752 combinations checked, best score 219.00

> maximize? hot dmg 1 min,item,dump

Maximizing...
SLOT 0
[bounty-hunting helmet, nurse's hat]
SLOT 1
[fire poi]
SLOT 2
[5-ball, battered hubcap]
SLOT 3
[Misty Cloak]
SLOT 4
[Grateful Undead T-shirt, letterman's jacket]
SLOT 5
[poodle skirt, cane-mail pants]
SLOT 6
[imp unity ring, enchanted handwarmer, bejeweled cufflinks, hopping socks, cursed scrunchie, shiny hood ornament]
SLOT 7
[war tongs, stinky cheese sword]
SLOT 8
[happiness]
SLOT 9
[chocolate spurs]
SLOT 10
[]
SLOT 11
[dead guy's memento]
SLOT 12
[happiness, stinky cheese sword]
3234 combinations checked, best score 207.00
 

Theraze

Active member
You also realize that the way to request 1 hot damage would be to:
maximize? hot dmg, 1 min, 1 max, item, dump

You never told it that you wanted 1... you said you wanted at least one, but more is awesome. Also, I believe that your dumped request is showing you how to accomplish this with any specific slot, rather than trying to show you how to accomplish it and move on for best item maximization. But I'm not completely certain on that. :)

So I don't believe this is a bug...
 

Fluxxdog

Active member
You also realize that the way to request 1 hot damage would be to <snip>
Except I didn't want one, I wanted at least 1, hence "hot dmg 1 min,item". More than one is OK, but once that condition is met, it should still be aiming for the highest score. Instead, of +5 hot damage and +10 & +7 item bonus, it goes for +5, +4, & +3 hot damage. It prefers a score of 12 over a score of 22. Sorry if that wasn't clear.
Also, I believe that your dumped request is showing you how to accomplish this with any specific slot, rather than trying to show you how to accomplish it and move on for best item maximization. But I'm not completely certain on that. :)
A little searching and I think I understand what you're getting at. It's counting all the accessory slots as one slot being used 3 times instead of 3 unique slots that happen to share the same equipment lists. Or am I misunderstanding?
 

Theraze

Active member
Believe so. Basically, to see the proper maximization result you want, you'll get better results by looking at the maximization tab rather than looking at the dumped version. The dumped version has the one slot 3 times, since it has the same pool (with options being reduced for items that have usage or inventory limits). The maximization tab will show you the current listing including those restrictions and each slot's 'best' choice.

Edit: Also, some of the slots are probably giving their suggestions based on the tiebreaker. When you're trying to debug what exactly is going on with the maximizer and you aren't getting the results you expect, remember to throw a ", -tie" into there so you don't get the "meh, we can't get what you asked for, so here's something that looks kinda okay" suggestions. :)
 
Last edited:
I apologize if you already know this - I'm not quite clear on the problem, but keep in mind as well all stats are not created equal - private static final String TIEBREAKER = "1 familiar weight, 1 familiar experience, 1 initiative, 5 exp, 1 item, 1 meat, 0.1 DA 1000 max, 1 DR, 0.5 all res, -10 mana cost, 1.0 mus, 0.5 mys, 1.0 mox, 1.5 mainstat, 1 HP, 1 MP, 1 weapon damage, 1 ranged damage, 1 spell damage, 1 cold damage, 1 hot damage, 1 sleaze damage, 1 spooky damage, 1 stench damage, 1 cold spell damage, 1 hot spell damage, 1 sleaze spell damage, 1 spooky spell damage, 1 stench spell damage, -1 fumble, 1 HP regen max, 3 MP regen max, 1 critical hit percent, 0.1 food drop, 0.1 booze drop, 0.1 hat drop, 0.1 weapon drop, 0.1 offhand drop, 0.1 shirt drop, 0.1 pants drop, 0.1 accessory drop, 1 DB combat damage"; As theraze points out above, -tie will of course avoid the tiebreaker weightings.

You can also adjust the weightings by doing 5 hot dmg, +item drop if you wanted to weigh more that way. I'm fairly lost on the actual issue - can you narrow down to a particular slot? I.e., I try maximize ..., maxmizer says "equip foo", I was expecting it to say "equip bar".
 

Theraze

Active member
The issue as reported is that maximize? <value>, 1 min, dump appears to display the suggestions for each slot trying to meet the requirement value, rather than having just one slot display the requirement and moving on.

It's probably just one of those features where it lets you decide how you want to meet your need, then work out the additional best bits after.

It does still seem a bit odd. :) That doesn't mean it isn't working as designed.
 
well, I still don't get it. Sorry! :) I've done a bunch of studying of the maximizer, so I'm really curious about this, and would like to understand. So, bear with me.

- the dump keyword prints out all the slots, and for each slot what the suggestions are and what the prior equipped item is. I.e.,
Code:
> maximize? hot dmg 1 min,item,dump

Maximizing...
SLOT 0
[bounty-hunting helmet, nurse's hat]

Is for this particular maximizer, slot 0 (hat) kol recommends a bounty-hunting helmet, and the prior item in the slot was/is a nurse's hat.

The issue as reported is that maximize? <value>, 1 min, dump appears to display the suggestions for each slot trying to meet the requirement value, rather than having just one slot display the requirement and moving on.

You lost me here - is it that you think the dump should only display one slot instead of all of them? I don't understand what you mean by "the requirement", in that the dump call doesn't display requirements at all, just whatever kol recommends (and what was equipped). So, what am I missing?
 

slyz

Developer
To simplify what Fluxxdog is saying, this expression:
Code:
> maximize? hot dmg,item,dump
uses the folowing "shortlist" of accessories to pick from:
Code:
SLOT 6
[frosty halo, Baron von Ratsworth's monocle, Nickel Gamma of Frugality, lucky rabbit's foot, hopping socks, cursed scrunchie, shiny hood ornament]
These are the accessories that have the highest score when considering [ hot dmg + item ].

However, when he adds "1 min" to the expression
Code:
> maximize? hot dmg 1 min,item,dump
he gets:
Code:
SLOT 6
[imp unity ring, enchanted handwarmer, bejeweled cufflinks, hopping socks, cursed scrunchie, shiny hood ornament]
These are the accessories that have the highest score when considering [ hot dmg ]. He was expecting the same list as above with the additional constraint that at least 1 hot damage would be guaranteed.

EDIT:
the dump keyword prints out all the slots, and for each slot what the suggestions are and what the prior equipped item is.
Huh... so that's what dump prints out. I remember going through the code and arriving at the conclusion that dump printed out the shortlist of N best items for each slot that would be used for the actual maximizing. I'm not surprised that I was wrong :)

It doesn't void Fluxx's expectation of what the maximizer should offer with the second expression though: a list of accessories with the highest [ hot dmg + item ] score, with the additional constraint.
 
Last edited:
Hmm. Couple of points, and my no means am I an expert/speaking from authority, this is just what I read of the code, I'm looking for clarity not to be right/prove anyone else wrong. caveat, caveat.

- keep in mind the way the maximizer handles slots isn't exactly the same as the actual slot usage in equipment manager. Notably, it groups and reuses some slots - all 3 accessories are in "SLOT 6", and slot 7/8 are reused for other special cases:

Code:
	public static final int OFFHAND_MELEE = EquipmentManager.ACCESSORY2;
	public static final int OFFHAND_RANGED = EquipmentManager.ACCESSORY3;
	public static final int WATCHES = EquipmentManager.STICKER2;
	public static final int WEAPON_1H = EquipmentManager.STICKER3;

- for your examples, I'm ignoring the last 3 items listed for slot 6, as those are just the 3 accessories that fluxxdog had equipped when he ran the maximizer.

To simplify what Fluxxdog is saying, this expression:
Code:
> maximize? hot dmg,item,dump
uses the folowing "shortlist" of accessories to pick from:
Code:
SLOT 6
[frosty halo, Baron von Ratsworth's monocle, Nickel Gamma of Frugality, lucky rabbit's foot, hopping socks, cursed scrunchie, shiny hood ornament]
These are the accessories that have the highest score when considering [ hot dmg + item ].

so the 3 accs that kol suggests (4, actually, because the frosty halo only works unarmed, so it includes a "backup" since it doesn't know at the time if the weapons are more/less valuable) all don't have hot damage, because they all have item drop and their overall value (since -tie isn't included) is higher than any other item that has hot damage or item drop. To "prove" a maximizer bug, we'd need to see an item in fluxxdog's inv that has hot dmg and/or item drop and an overall value higher than these.

However, when he adds "1 min" to the expression
Code:
> maximize? hot dmg 1 min,item,dump
he gets:
Code:
SLOT 6
[imp unity ring, enchanted handwarmer, bejeweled cufflinks, hopping socks, cursed scrunchie, shiny hood ornament]
These are the accessories that have the highest score when considering [ hot dmg ]. He was expecting the same list as above with the additional constraint that at least 1 hot damage would be guaranteed.

Okay, so now I think I understand the original issue (ah! Clarity!) - and it's not a bug. :) So, the maximizer is returning the 3 items that have the highest value for the set of items that have at least 1 hot damage, and possibly item drop (although none happen to have item drop in this case because I don't think there are any item drop + hot damage items). None of the "higher value" item drop items are being included, because we required at least 1 hot damage for the item to be considered. So, the maximizer is doing exactly what's requested, and only considering items that have a minimum of 1 hot damage.

I think the request behind the request is "I want to be able have the highest item drop + hot damage score overall, with at least one hot damage provided across all my equipment", the key being "across all my equipment". I don't think that's how the maximizer works - the min X value is applied on a per item basis, and effectively is a "filter" for the pool of items searched for the maximizer, rather than an overall aggregate requirement. Does this all make sense? I will dig further, but I don't think there's anyway to specify maximizer targets in aggregate. If I was trying to do what you seem to want to do, I'd maximize for hot damage, pick one I'd want to guarantee was there, then maximize hot damage, item drop, equip (say) imp unity ring to be sure I got it.
 

jasonharper

Developer
'dump' DOES print out the shortlist - but the current item in each slot will generally be in the shortlist (unless it's actively harmful), to minimize unnecessary equipment changes.

There's definitely something not quite right here - the 'min 1' shouldn't be requiring that every item in the shortlist individually fulfills that requirement. I'll try to look into this over the weekend.
 
The problem may be here, in maximizer/Evaluator.java:

Code:
			case Modifiers.EXPERIENCE:
				val = mods.get( Modifiers.MUS_EXPERIENCE + KoLCharacter.getPrimeIndex() );
				break;
			}
			if ( val < min ) this.failed = true;
			score += weight * Math.min( val, max );
		}

notably, where if val < min this.failed = true (I think) means that if the individual item doesn't hit the min, then it's not included in the comparison anymore and thus filtered out. Easy enough to get rid of, but I have no idea from there how to ensure that at least one of the items has the min value. Heh. Oh, well - I thought I was getting this, but still so much to learn.

out of curiosity, what do you mean by "shortlist"? All the items that the maximizer considered for that slot? It seems to do that only if you do > 1 dump (vs. the examples above, which were 1 dump). Or are you referring to something else?
 

slyz

Developer
out of curiosity, what do you mean by "shortlist"?
As I remember it, the Maximizer goes through all your items, gives them a score based on the expression, but keeps only the N best candidates for each slot (the shortlist). It then considers all the possible combinations from this list to find the best.
 

roippi

Developer
notably, where if val < min this.failed = true (I think) means that if the individual item doesn't hit the min, then it's not included in the comparison anymore and thus filtered out.

no, the top of that method:

Code:
    public double getScore( Modifiers mods )
    {
        this.failed = false;
        this.exceeded = false;
        int[] predicted = mods.predict();

        double score = 0.0;
        for ( int i = 0; i < Modifiers.DOUBLE_MODIFIERS; ++i )
        {

As you can see, the loop is iterating over modifiers, not over items.
 
As I remember it, the Maximizer goes through all your items, gives them a score based on the expression, but keeps only the N best candidates for each slot (the shortlist). It then considers all the possible combinations from this list to find the best.

Ah, fascinating. So much still to learn. I will keep reading... I haven't seen anything like that yet - any idea where "N" is set (or what it's value is) to help me connect the dots? If not, no big deal, I'll keep digging.

In this context, I think getScore() is called with a specific item's modifiers only.

So, I think slyz agrees with my theory? Or at least doesn't disagree... :) To be more explicit, yes, getScore iterates on modifiers, but it's called in the context of "here's all the modifiers for a given item" (or effect, in some cases), and this.failed applies to the overall Evaluator instance. To more properly restate my theory because I was being ambiguous, which I think caused the misunderstanding:

notably, where if val < min this.failed = true (I think) means that if any of the modifiers of the individual item/effect doesn't hit the min, then it's not included in the comparison anymore (this.failed = true) and thus filtered out.
 

jasonharper

Developer
The "N" you're referring to comes from Evaluator.maxUseful(). The value varies by slot, and by the presence of skills or familiars that let you equip certain kinds of items in slots they wouldn't otherwise hold.

Having the failed flag set for an item doesn't filter it out completely, however any such item ranks lower than a non-failed item regardless of their scores. This means that if you have any one item that doesn't fail a requirement, then all other items in the shortlist for that slot will generally have to be non-failing, which is simply wrong (the requirement might be met entirely by items in other slots, for example).
 

Fluxxdog

Active member
Believe so. Basically, to see the proper maximization result you want, you'll get better results by looking at the maximization tab rather than looking at the dumped version. The dumped version has the one slot 3 times, since it has the same pool (with options being reduced for items that have usage or inventory limits). The maximization tab will show you the current listing including those restrictions and each slot's 'best' choice.
I used 'dump' because it's easier to paste text than to screen shot and post. I originally used the maximizer tab and it told me 3 accessories were to have hot damage. I used the CLI to show in one posting what it was doing.
Edit: Also, some of the slots are probably giving their suggestions based on the tiebreaker. When you're trying to debug what exactly is going on with the maximizer and you aren't getting the results you expect, remember to throw a ", tie" into there so you don't get the "meh, we can't get what you asked for, so here's something that looks kinda okay" suggestions. :)
I did forget about '-tie'. Unfortunately it gives the same suggestions.
Code:
Maximizing...
SLOT 0
[bounty-hunting helmet, nurse's hat]
SLOT 1
[fire poi]
SLOT 2
[5-ball, battered hubcap]
SLOT 3
[Misty Cloak]
SLOT 4
[Grateful Undead T-shirt, letterman's jacket]
SLOT 5
[poodle skirt, troll britches]
SLOT 6
[imp unity ring, enchanted handwarmer, bejeweled cufflinks, hopping socks, cursed scrunchie, shiny hood ornament]
SLOT 7
[war tongs, stinky cheese sword]
SLOT 8
[happiness]
SLOT 9
[chocolate spurs]
SLOT 10
[]
SLOT 11
[wristwatch of the white knight]
SLOT 12
[happiness, stinky cheese sword]
3234 combinations checked, best score 207.00
However, when he adds "1 min" to the expression
Code:
> maximize? hot dmg 1 min,item,dump
he gets:
Code:
SLOT 6
[imp unity ring, enchanted handwarmer, bejeweled cufflinks, hopping socks, cursed scrunchie, shiny hood ornament]
These are the accessories that have the highest score when considering [ hot dmg ]. He was expecting the same list as above with the additional constraint that at least 1 hot damage would be guaranteed.
Quite. Matter of fact, what I would have expected would have been:
Code:
SLOT 6
[imp unity ring, frosty halo, Baron von Ratsworth's monocle, Nickel Gamma of Frugality, hopping socks, cursed scrunchie, shiny hood ornament]
I would expect the Gamma over the rabbit's foot since the Gamma gives boosts the stats.

Thanks for the discussion. I thought it would either be "Not gonna bother" or "Huh, odd". Got a lot more than I thought.
 
r11690 should fix this. Hopefully it didn't break anything else in the process.

Interesting fix. Cool! That does seem to have fixed it for me, in that I can run the same hot dmg 1 min, item and get at least one hot damage but also mostly item drops as they're overall "worth" more.
 
Top