Feature - Implemented Let maximizer stop when it is not finding a better score

roippi

Developer
How about, after (current) maximization is done, something like
Code:
for each slot {
  if original equipment can still be equipped in the slot and isn't already included in current best result (in that slot) {
    if score(current best)=score(current best with the original equipment placed back in that slot) {
      change current best to use the original equipment in that slot
    }
  }
}

That should keep the original equipment if it would get overwritten with useless equipment or emptiness, but not when it got overwritten with a synergetically useful thing.
And it should only cost fewer than 100 score calculations, instead of tens of millions.

That, again, doesn't work at all for outfits/synergies. Suboptimal per-slot score can be part of the global optimum solution when synergies are involved. A synergetically useful thing may have a score of exactly 0 when you look at it individually for its slot, but the amortized synergy bonus is very much non-zero.

The heuristic I proposed before works here, too. Instead of remembering individual slot items, remember outfit groups that are currently equipped (and if an item isn't a member of a predefined outfit group, just give it it's own singleton 1-item outfit). Then

Code:
if score(current best for slots masked by outfit)=score(current best with the original equipment placed back in those slots)

works.
 

Theraze

Active member
Just remember that the way that the maximizer currently works, the original items need to be included to not break requirements, since the maximizer will no longer guarantee success there. It will happily give you a 'fail' result if there are 'better' items for each slot and your initial equipment does not meet the requirement.

Example:
> maximize hp

Maximizing...
36 combinations checked, best score 43.00

> maximize? stench res, -tie

Maximizing...
64 combinations checked, best score 4.00

> maximize stench res, 4 min, 100 hp

Maximizing...
36 combinations checked, best score 4,303.00 (FAIL)
Unable to meet all requirements via equipment changes.
See the Modifier Maximizer for further suggestions.

> maximize stench res, -tie

Maximizing...
64 combinations checked, best score 4.00
Putting on Knob Goblin harem veil...
Equipment changed.

> maximize stench res, 4 min, 100 hp

Maximizing...
68 combinations checked, best score 3,404.00
Wielding Sneaky Pete's basket...
Equipment changed.
Holding hot plate...
Equipment changed.
Putting on Knob Goblin pants...
Equipment changed.
Basically, if you have a requirement, it currently takes running the maximizer twice to actually get a required minimum in place. If you have additional weighted items, you have no guarantee that the maximizer will actually meet it. :(
 

Bale

Minion
Oh, the glory and terror of a brute force solution. Theirs is a tyranny not easy to overthrow.
 

roippi

Developer
Oh, the glory and terror of a brute force solution. Theirs is a tyranny not easy to overthrow.

Indeed. More than once I've been tempted to start from (semi-)scratch with a simulated annealing approach, but that would take legitimately something like 100 dev hours. And would probably be harder to maintain than the current maximizer.

On the plus side it would be awesome, so
 

Bale

Minion
It would be awesome. I'd be overjoyed if you took on that project, but you'd have to really want to do it or else you'd be unhappy.
 

Darzil

Developer
It's not as good as coming up with a better maximization process, but r14462 adds keyword -current. This doesn't consider currently equipped equipment, so is much faster. However, it may suggest changes which do not help (or hinder) you.
 

Bale

Minion
If it doesn't consider currently worn equipment, then wouldn't that be problematical if some of the currently worn equipment would help? Is the strategy to put on stuff you know to be useless and then run maximizer with -current?
 

Darzil

Developer
It doesn't ALWAYS consider current equipment, so if it's best, it'll consider it because it's best, but if it's not, it won't consider it. I'd recommend trying it, I find it can cut off a lot of combinations without changing the result. It's basically equivalent to removing all clothes then running it (which has been suggested here), but without having to do so.
 

Darzil

Developer
r14511 only considers outfits if they are better than the individual best identified items in the outfit slots.

The alt I used for testing didn't have a huge number of outfits, so hard to be sure how much difference it will make in practice with a large number. Running with -current it got some comparisons down from 1000's to 10's. Not sure if anyone is having success with -current?
 

heeheehee

Developer
Staff member
Anecdotal experience from r14512:
maximize mus -current: 74304 combinations checked, best score 7,363.00
maximize mus: 1980160 combinations checked, best score 7,363.00

I have full brimstone, full cloathing, disembodied hand out. 1.4 orders of magnitudes looks like a pretty solid improvement. Thanks!
 

heeheehee

Developer
Staff member
That was another order of magnitude, IIRC. I'll check right now with r14510, though.

edit:
maximize mus -current: 80567 combinations checked, best score 7,363.00
maximize mus: 2051560 combinations checked, best score 7,363.00

Hmm. That's not as drastic as I remembered. Maximization does take much less time, though.
 
Last edited:

Darzil

Developer
Am definitely wondering if we should make -current default, and add +current instead. But will leave that til I get more opinions.
 

heeheehee

Developer
Staff member
Given, uh,
Code:
80005 combinations checked, best score 7,363.00
168097 combinations checked, best score 7,363.00
258508 combinations checked, best score 7,363.00
350912 combinations checked, best score 7,363.00
441929 combinations checked, best score 7,363.00
531810 combinations checked, best score 7,363.00
623974 combinations checked, best score 7,363.00
714641 combinations checked, best score 7,363.00
807098 combinations checked, best score 7,363.00
909055 combinations checked, best score 7,363.00
1004163 combinations checked, best score 7,363.00
1102941 combinations checked, best score 7,363.00
1213015 combinations checked, best score 7,363.00
1297208 combinations checked, best score 7,363.00
1370067 combinations checked, best score 7,363.00
1452061 combinations checked, best score 7,363.00
1532836 combinations checked, best score 7,363.00
1638416 combinations checked, best score 7,363.00
1741690 combinations checked, best score 7,363.00
1834824 combinations checked, best score 7,363.00
1946347 combinations checked, best score 7,363.00
2050305 combinations checked, best score 7,363.00
2051560 combinations checked, best score 7,363.00
I would personally be all for it, but yeah, other opinions would be good.
 

Darzil

Developer
My anecdata (just after prism break, so a limited selection of outfits/equipment compared to late aftercore) :
Code:
mus 993114, 380 (no outfit prune)
mus 199800 (outfit prune)
mus -current 17332, 380 (no outfit prune)
mus -current 13728 (outfit prune)

item drop 7276776 (no outfit prune)
item drop 1766000 (outfit prune)
item drop -current 273118 (no outfit prune)
item drop -current 257984 (outfit prune)

meat drop 3902472 (no outfit prune)
meat drop 974400 (outfit prune)
meat drop -current 122848 (no outfit prune)
meat drop -current 68486 (outfit prune)

So -current seems to make the most difference, outfit prune less, but the combination is speeding up calculation on these samples by 30-70x. I didn't include best scores, as they were identical for all.

Definitely leaning to making -current default, as I know most people won't be reading here.
 

Bale

Minion
The advantages of faster maximization are notable when compared to the advantages of not switching equipment without a reason.
 

Cool12309

Member
Why exactly does it add in current equipment at all? To me it seems like this behavior should have been here from the start
 
Top