Bug - Fixed -buddy-bjorn and -crownofthrones maximizer keywords failing when bjorn or crown isn't equipped

phreddrickk

New member
The issue is more or less in the title here. the `-buddy-bjorn` keyword should prevent the bjornified familiar from being changed by the maximizer. If you run the maximizer while the bjorn is equipped, it functions as intended. If you run the maximizer without the bjorn equipped, however, it will either bjornify a different familiar or refuse to equip the bjorn entirely. I'm not sure what differences in circumstances lead to one situation or the other.


To replicate, use a maximizer string along the lines of `familiar weight, -buddy-bjorn, +420 bonus buddy bjorn` in several cases: first, with the bjorn equipped, and a weight familiar bjornified; second, with the bjorn equipped, and a non-weight familiar bjornified; third, with the bjorn unequipped, and a weight familiar bjornified; finally, with the bjorn unequipped, and a non-weight familiar bjornified.
 

VladYvhuce

Member
I don't know much about maximizer strings. So, from a layman's view, it looks like you're giving conflicting commands.
 

phreddrickk

New member
The item "buddy bjorn" is an item equipped in the back slot. the slot "buddy-bjorn" is a slot in which bjornified familiars are equipped. The behavior described is an attempt to ask the maximizer to equip the item "buddy bjorn" without altering what is currently in the "buddy-bjorn" slot.

Hope that helps!
 

reverkiller

New member
Apart from trying to save on clicks, why not just equip the buddy bjorn manually?
The situation is basically this:
We have decided what the best familiar for the Bjorn is (this is a complicated problem to solve because it has to do with the frequency and mall price of specific drops). We do not know if that Bjorn with best familiar is the best in slot. You cannot currently craft a maximizer string that will let you apply a specific bonus to the Bjorn while also locking the specific familiar in it.
 

heeheehee

Developer
Staff member
Do you have both bjorn and crown?

What's the rationale for applying a specific bonus to Crown of Thrones / Bjorn? Combat drops?
 

phreddrickk

New member
Mostly combat drops, yeah. Often we will do a -equip for the crown/bjorn we don't want, because it's also hard to tell it not to equip both of them.
 

heeheehee

Developer
Staff member
I'm super confused by bjorn / crown handling in that their occupants don't seem to actually be handled as equipment, other than for the purposes of maximizer speculation.

I'll ask again: do you have both bjorn and crown?

Java:
// If you have a familiar carrier, we'll need to check 1 or 2 Familiars best carried
// unless you specified not to change them

if ( ( ( id == ItemPool.HATSEAT && this.slots[ EquipmentManager.CROWNOFTHRONES ] >= 0 ) ||
       ( id == ItemPool.BUDDY_BJORN && this.slots[ EquipmentManager.BUDDYBJORN ] >= 0 ) ) &&
     !KoLCharacter.isSneakyPete() && !KoLCharacter.inAxecore() && !KoLCharacter.isJarlsberg() )
{
        this.carriedFamiliarsNeeded++;
}

Now that I'm looking at the code, it'll consider swapping familiars unless you specify -crownofthrones, -buddy-bjorn for each of the corresponding IotMs that you currently have.
 

heeheehee

Developer
Staff member
Now, this isn't the full story, since I can still reproduce the "want to unequip back" side of things. But it may explain the incorrect bjornifying behavior.
 

heeheehee

Developer
Staff member
Okay. So, it looks like the only way to equip buddy bjorn is via the bjornify command.

A silly maximizer expression:

+100 bonus buddy bjorn, -tie

yields:

bjornify (none) (+100)

along with some other super-tiebreakers as recommended actions (item droppers, meat droppers, rollover effects).

Adding on -buddy-bjorn forbids that action, therefore causing it to instead... unequip the item, as it's decided not to equip any back item and instead rely on bjornify to do so. Hm.
 

heeheehee

Developer
Staff member
It looks like the core issue is that we're only setting useBjornFamiliar / useCrownFamiliar if the corresponding equipment is currently being worn. This is almost identically the bug as reported. Thanks!

https://github.com/kolmafia/kolmafia/pull/5 even though I could commit this directly, as part of getting us in the habit of code review for non-urgent changes.
 

heeheehee

Developer
Staff member
We could also easily fix the logic to never `bjornify (none)`, although that's not in the pull request currently.
 
Top