How does the maimizer handle conflicting requests?

Veracity

Developer
Staff member
If I say "maximize +equip BACKITEM1 +equip BACKITEM2", obviously, it can't fulfill that, since you only have one "back" slot. Accessories, sure - you can take two slots.

What does it do?

- give an error and do nothing
- take the first and ignore the second (with or without an error)
- take the second and ignore the first (with or without an error(

What SHOULD it do?
 

Veracity

Developer
Staff member
My motivation:

My Spacegate script wants to use the maximizer to maximize on (something) with a set of required equipment, based on the environmental hazards and (perhaps) the desired sample kit.
It also allows you to specify additional maximizer parameters. If you have a favorite shirt, fine. If you have a favorite back item and have to wear the rad cloak, not so fine.

If I specify both "equip rad cloak" and "+equip OTHERBACKITEM", what happens?

Does it take the first - in which case, no problem: I put the required items first and the extra items second.
Does it take the last, in which case, no problem, I put the extra items first and the required items second.
Does it simply fail? In which case, I can issue the command with all items and abort if it fails.
Or I can write lots of code to parse user-supplied maximizer options and check compatibility with the required options and strip out the conflicting user-supplied ones with a warning.

What is the current behavior?
That will inform what I need to do.
What is the desired behavior (if different from current behavior)?
That will inform what I (or Darzil ;) ) needs to do with either the script or KoLmafia code.
 

ckb

Minion
Staff member
I don't know what the current behavior is, but if there is a change, I like option B (take the first and ignore the second (without an error)), so that any tie breakers for maximizer will be the order in which they appear in the string to be maximized.
 

Darzil

Developer
It should certainly fail, as it won’t meet all the requirements. Currently it won’t give an error (though it will ‘fail’) and will maximise everything else ignoring required items etc. This is because high score plus fail beats low score plus fail. You could put in checks and get it to give a friendly error and not waste time if a user gives it an impossible request.
 

Veracity

Developer
Staff member
I think I'll just check if all the required items are equipped after maximizing and any are not, give a message and abort.
Thanks for the explanation!
 
Yeah, my script solution for handling maximizer calls with potentially conflicting equipment requirements is to unequip everything, then equip all the required equipments (for example the protopack if I'm looking to bust a ghost), and then call the maximizer with the 'empty' restriction included to fill up the remaining slots.
 
Top