Bug - Not A Bug Modifier maximizer doesn't accept "max/min" limits in combo with elemental resistance

Modifier maximizer doesn't accept "max/min" limits in combo with elemental resistance

r16137.

So, up front: I've never tried to use the "max" or "min" keywords in the maximizer before. But if I'm understanding those keywords correctly, the maximizer isn't working the way it should.

The maximizer wiki page says "Any numeric modifier keyword can be followed by one or both of these special keywords." And modref lists the elemental resistances as numeric modifiers.

So shouldn't I be able to maximize, for instance, "15 hot res max, item"? Or "myst, 10 cold res min"? The maximizer just says "unrecognized keyword: cold res min".
 

Theraze

Active member
Umm... you're trying to set a limit of 1 maximum hot resistance, but with a weight of 15. Is that what you wanted?

Guessing what you wanted instead was probably something more like 100 hot res, 15 min, 15 max, item. I highly suggest using commas to separate your keywords when dealing with min/max stuff. Note that min is for requirements, and max is to not care about anything higher than that.
> maximize 15 hot res, max, item

Maximizing...
1176 combinations checked, best score 263.99
Putting on miner's helmet...
Equipment changed.
Wielding Accordion of Jordion...
Equipment changed.
Putting on leotarrrd...
Equipment changed.
Putting on observational glasses...
Equipment changed.
Putting on Claybender glasses...
Equipment changed.
Putting on screwing pooch...
Equipment changed.
 
Okay, that makes sense. But I'm still confused, on two points.

1. That maximizer string doesn't actually land me at 15 hot resistance. Shouldn't the combination of "100 hot res, 15 min, 15 max" mean "accept nothing except exactly 15 hot resistance?"

> ash maximize("100 hot res, 15 min, 15 max, item", false)

Maximizing...
6552 combinations checked, best score 1,837.44
Putting on Hairpiece On Fire...
Equipment changed.
Wielding Hand that Rocks the Ladle...
Equipment changed.
Holding A Light that Never Goes Out...
Equipment changed.
Putting on Camp Scout backpack...
Equipment changed.
Putting on shark jumper...
Equipment changed.
Putting on Vicar's Tutu...
Equipment changed.
Putting on Pocket Square of Loathing...
Equipment changed.
Putting on Brimstone Brooch...
Equipment changed.
Putting on Hand in Glove...
Equipment changed.
Putting on blue suede shoes...
Equipment changed.
Returned: true

> ash numeric_modifier("hot resistance")

Returned: 18.0​

I'm not even getting "exactly 15 hot resistance from equipment."

> unequip

Taking off Hairpiece On Fire...
Equipment changed.
Taking off Hand that Rocks the Ladle...
Equipment changed.
Taking off A Light that Never Goes Out...
Equipment changed.
Taking off Camp Scout backpack...
Equipment changed.
Taking off shark jumper...
Equipment changed.
Taking off Vicar's Tutu...
Equipment changed.
Taking off Pocket Square of Loathing...
Equipment changed.
Taking off Brimstone Brooch...
Equipment changed.
Taking off Hand in Glove...
Equipment changed.
Taking off blue suede shoes...
Equipment changed.
Updating inventory...
Requests complete.

> ash numeric_modifier("hot resistance")

Returned: 9.0​

2. Why do I have to separate the min/maxed resistance with commas, as in your example, when I don't have to use commas when min/maxing other modifiers? For instance, the second-to-last section of the maximizer wiki page ("Useful Expressions") lists ".5 mp regen max, .5 mp regen min" as a possible modifier string, and the modifier will accept that string (or either of those two strings) without complaint. But it won't accept "3 hot res max." What makes the difference between the two?

Thanks a bunch for your help.
 
Last edited:

Theraze

Active member
Nope, it means to try to get to 15 hot resistance. Any more than 15 doesn't matter, but if the last piece takes us a +4 to get there, then so it goes.

No clue on the reason why it works better that way. But I always suggest people use commas for EVERY modifier split, to make sure that they end up with the results they want.
 

Darzil

Developer
The reason you don't try to hit an exact number is that you'd then have to pass though more than just the highest hot res item for consideration, which would mean more items being considered, which is what makes maximizer take ages.
 
Thanks again for your time in helping me understand this, guys. It's much appreciated.
Nope, it means to try to get to 15 hot resistance. Any more than 15 doesn't matter, but if the last piece takes us a +4 to get there, then so it goes.
The reason you don't try to hit an exact number is that you'd then have to pass though more than just the highest hot res item for consideration, which would mean more items being considered, which is what makes maximizer take ages.
Okay. So what I think you're saying is that, for my maximizer string, the maximizer will pile on +hot res items, starting with the largest value available, until it reaches or exceeds 15 resistance. And then it will fill the other slots with +item. Is that right?

If that's true, I think that means that it may actually miss out on some +item that would be available if it targeted +15 resistance exactly? (In other words, choosing a more nuanced set of items to provide less hot resistance, rather than taking the lazy path by starting with the highest-magnitude items, might open up opportunities for more +item.) Darzil, I totally understand what you mean about this being a tradeoff in order to run maximization in a reasonable time, but I just want to make sure I'm not misunderstanding.
 

Darzil

Developer
Exactly so. If you could force maximizer to consider every item, you could (sometimes) get a slight improvement in this situation, but would also spend literally hours (in aftercore) waiting for the best maximization.
 

Theraze

Active member
Not hours - but it did used to take ~15 minutes per maximization before Jason made it not actually consider every step for the absolute best option several years ago. :)
 

Darzil

Developer
Those several years have added a LOT of other extra equipment to aftercore. If it was 15 minutes then, it'd be hours now. (It's one of the reasons I added code to prune outfits and synergies that weren't as good as individual items, as there are loads of new outfits now)
 

Theraze

Active member
Well, it was about 30 seconds for me with my usual 10 modifier string, but for some people with lower powered computers it took (reportedly) 5-15 minutes. When it took over a minute for me, it was because my computer's Java was having issues and needed to reboot. That was the only time it took 5+ minutes for me.
 

Darzil

Developer
It depends very heavily on number of item combinations. Adding just a few items to the consideration pool makes it take MUCH longer. Computer power helps, but before I put in the outfit pruning you could be considering many outfits, as it used to just pass in any outfit that was a positive score on your maximization string, no matter how small. I recall setting a limit of 1m combinations doing +item drop, and it still hadn't finished considering outfits plus other kit.
 
Top