Bug Maximizer: if (e.g.) full, effects from food sources get filtered out of the final list, even with "Show all" pref selected

VinnyB

Member
(Ditto for liver/spleen)
The preference is currently listed as "Show all, effects with no direct source, skills you don't have, etc." (and shows up in the CLI as maximizerIncludeAll), so this feels like unintended behavior, but if that's not the case could the preference description be amended/asterisked? The ideal end result would be for food/booze/spleen-tied effects to still show up but simply be greyed out. Hopefully this is just a matter of a missing variable check? But I imagine the Maximizer code is a lumbering monstrosity by this point. :x Thank you for your time!
 

MCroft

Developer
Staff member
I was thinking about this recently. But I could possibly distend my stomach, take a spleen pill, over drink, etc.

Figuring out the best approach is not easy. I'm loathe to add another preference, but maybe "disable eat/drink/spleen by default if full" would work?
 

VinnyB

Member
"disable eat/drink/spleen by default if full"
Maybe "hide effects from sources with currently unmeetable organ requirements"?

The way I personally use maximizer, I very much do want it to actually show me everything. If I screwed up and overfilled my belly, I want to know that I did that, so I can not do that next time, or plan tomorrow! And those effects often *are* still accessible via organ-clearing effects, or direct Wishing
 

Ryo_Sangnoir

Developer
Staff member
I would just slam it under maximizerIncludeAll. It says "all" in the name, it's already fringe.

The alternative is to grey them out instead of hiding them.
 

MCroft

Developer
Staff member
I'm still somewhat skeptical. That feature is basically unusable by me as it is, because there's far too much that gets stuffed into it. I supposed advanced unusable is no worse than basic unusable, but it's not like you can't find food/drink/spleen on the food/drink spleen tab already.

What would you do differently if you knew that you could possibly get and not eat a pie man was not meant to eat?
 

fronobulax

Developer
Staff member
What would you do differently if you knew that you could possibly get and not eat a pie man was not meant to eat?

Make it and then put it in my Display Case. The wiki says it can be fed to the Gluttonous Green Ghost or converted to fuel for the Asdon Martin so if I had either of those I might use it there.

But... I already handle similar things by checking whether I can create them (using creatable_amount) so their presence or absence in the maximizer is irrelevant.

I think there is a use case for a GUI that finds ways to get certain effects or "benefits" and that tool has to handle speculation. But it might be better to make it a part of the Encyclopedia (FR) rather than the Maximizer. But what do I know about the game? I just discovered autoscend can regularly beat my usual Normal, Standard day counts by at least one :)
 

MCroft

Developer
Staff member
Make it and then put it in my Display Case. The wiki says it can be fed to the Gluttonous Green Ghost or converted to fuel for the Asdon Martin so if I had either of those I might use it there.
I think I ate one during 2CRS. It was not optimal, but it was possible. Aside: I have 82. If you want one, hmu. Apparently I collect them, accidentally.

That part of the maximizer is a giant list of sequential IF statements:

Code:
    // You must have the pill keeper
          if (!InventoryManager.hasItem(ItemPool.PILL_KEEPER)) {
            if (includeAll) {
              text = "(get an Eight Days a Week Pill Keeper)";
              cmd = "";
            } else continue;
          }
So if we wanted to put every food, spleen, and drink in there, we also should find and enter every rain, thunder, MP, HP, limited use item, etc. Or figure out what the line is and maybe decide if it's really "includeAll" or not...

I already can see all the food/spleen/drink items I can't use in the Usable panel of Inventory.

It won't really affect me, since I don't run with that pref, and maybe if someone ever re-writes re-writes the maximizer to get rid of 1000 lines of if/then code, it could be part of a data driven maximizer function.
 

VinnyB

Member
That part of the maximizer is a giant list of sequential IF statements:
Is it all mostly as readable as the clip you posted? If so, I'd be happy to throw some time at sorting through the logic and seeing if there are any obvious reorganization-based simplifications. Is there a single file with the maximizer code that I can like ... open in notepad? I have some very basic coding experience but these large sprawling projects overwhelm me >_<
 

Ryo_Sangnoir

Developer
Staff member
The "long if" is in src/net/sourceforge/kolmafia/maximizer/Maximizer.java. The rest of the maximizer code is in that folder, and most of the remaining logic is in src/net/sourceforge/kolmafia/maximizer/Evaluator.java

I think the long if/then is a perfectly reasonable way of writing it -- there are a lot of special cases, and I can't really see anything to extract. The last success was "modeables".

I would like to do more significant changes -- splitting "constraints" from "scoring", splitting parsing into a different module, changing the filtering to only iterate over usable items instead of all items by default (to properly support features like "letter"), but the code is huge and any refactoring is a large project.
 
Top