EatDrink.ash: Optimize your daily diet (and see how your old diet stacks up).

soolar

Member
The main issue I've run in to with mayo in calculations is that while it does seem to account for the mayo cost in the new value, it doesn't seem to account for it in the total cost (I had it telling me it was spending ~4k in a simulation when it was using 5 mayo packets, and the food alone added up to ~4k). As for a meat threshold before it even considers buying mayo, that sounds like a pretty solid option to me! And 25k sounds like a reasonable default too.

Unrelated note, it'd be awesome to start accounting for ode to booze in the individual booze's, at least for nightcapping. ATM I basically never use eatdrink to nightcap, because in aftercore it still seems to be choosing psycho train over bucket of wine, when I've run the numbers by hand and the bucket is DEFINITELY a better value. And I feel like it's a distinct possibility that there's an even better nightcap out there that I'm not considering, which is why I generally love eatdrink so much.

Btw, are you planning to come back and work in that optional extra pass you mentioned in initial mayo plans, to actually consider using the liver mayo with non-size-1 foods?
 

xKiv

Active member
And I feel like it's a distinct possibility that there's an even better nightcap out there that I'm not considering, which is why I generally love eatdrink so much.
According to eleron's site, the order for nightcaps appears to be:
dreadsylvan hot toddy (with mug) (somewhere below 8500 mpa)
jar of squeeze (somewhere below 4800 mpa)
bucket of wine (becomes better than PTW at 1980 mpa)
psychotic train wine (better than fog murderer at 454 mpa)
fog murderer (better than open sauce at 50mpa)
open sauce (better than elven squeeze at 15 mpa)
elven squeeze (better than nothing at 12 mpa)
nothing (below 12 mpa)
 

Theraze

Active member
1) It considers mayo cost, but only when buying from the mall currently. If you're crafting it, then it doesn't consider the cost. I've tried to decide if I want to include the mayo in all food crafting or not, but haven't fully committed either way yet. Probably will end up adding it in eventually though. By making it only run when we have enough to afford the whole thing, it'll mask the crafting bit, but better to have it accurate.

2) It actually already does consider ode in nightcaps.
> edvalueod psycho train wine

32275.0

> edvalueod bucket of wine

35420.0

> cheapest psycho train wine

Psychotic Train wine @ 2,495

> cheapest bucket of wine

bucket of wine @ 5,555
Some simple math:
PTW total value: 33275-2495=30780.
BoW total value: 35420-5555=29865.
With a higher VoA than 1250, it would have gone with the BoW, even with the increased price. It's just important to know how much you expect your break-even on adventures to be.

3) As you said in post 1981, the problem with automating larger sized food->inebriety is that any items where a unit of inebriety is converted cannot also gain their bonus adventure through mayoflex. By limiting it to only single-size items, we never do suboptimal choices with those items. After you pointed that out, I don't think anyone actually had any desire to see automation cause them sadness by filling up their fullness accidentally.
 

Theraze

Active member
Okay, mayoMeat is now added, defaulting to 25k.

Still considering best way to do the mayo creation thing. May or may not end up working well. The way the ingredient stack works, it doesn't ever actually touch the consumable record, which is where we set and use the helpers.
 

soolar

Member
My VoA is ~2500, and it has still been choosing PTW over BoW for nightcapping.

As for the not being able to use Mayoflex when using the inebriety mayo, it is a somewhat complicated matter, but I feel like it's still solvable (it comes at an opportunity cost of VoA/Fullness value to use it). I dunno if it would ever choose to use it in aftercore, but I feel like in run, as a myst class, hi mein with 1 fullness->inebriety would almost always be worth doing? Considering how little access you tend to have to great booze as a myst class in run.

I'm gonna think about it more and try to come up with an algorithm to decide that myself. I think it's probably not quite as complicated as I first thought.

I mean, I guess one thought is, if the value per fullness of a food is > the value per inebriety of your lowest value booze by at least VoA, then it should think about doing that? But then there's complications if your weakest booze was greater than 1 inebriety altogether, in which case it would then have to find a weaker booze to fill up any resulting leftover space, probably. Hmmm...

I suppose though, when it comes down to it, it's not THAT hard of a thing to manage manually outside of eatdrink when in run, and I still find it highly unlikely it would ever be worth doing in aftercore. And when it comes down to it eatdrink is primarily intended for aftercore anyway.

Keep up the great work Theraze :)
 

Theraze

Active member
And note that I did kick some checks above on pulling out the 'value' of items. The edvalue alias above will give you the total value for an item - though it won't be compared against the meat costs and so forth. If you compare the value that kicks out for hi meins against the value of your best drink, you should be able to pick whether it's better to hijack inebriety or not. :)

And you can test against PTW and BoW with the same check based on your VoA. I'll try to check with the higher value tomorrow when I have space again. Will also check if the meat cost is properly added for helpers... think I've got it sorted out now.
 

Magus_Prime

Well-known member
It may be entirely coincidental but ever since the mayo handling was added I've noticed that EatDrink isn't using Potions of the Field Gar when eating lasagna's. I plan to do a casual ascension next and will have time and potions to debug. I'm mentioning it now for guidance on the best way to investigate, in addition to increased zlib verbosity.
 
Last edited:

Theraze

Active member
Question... is that with full lasagna or just with a single post-mayolus lasagna? Depending on your VoA, a single lasagna may not be worth the Field Gar.
 

Magus_Prime

Well-known member
What's happening is that EatDrink is queuing a fishyfish lasagna and eating a mayoflex just before consumption. At that point KoLmafia pops up a confirmation dialogue asking if I'm sure I want to consume lasagna without first eating a Potion of the Field Gar.

I think you may have figured out what's happening as only one lasagna is queued.
 

fronobulax

Developer
Staff member
Question... is that with full lasagna or just with a single post-mayolus lasagna? Depending on your VoA, a single lasagna may not be worth the Field Gar.

I think with my VOA lasagna was getting chosen but not the potion several weeks before the mayo stuff.
 

Theraze

Active member
For me currently:
Simulating only; no purchases or food/drink/spleen consumption.
food: At 0, consuming to 15 with 20000 meat.
0: milk of magnesium price: 796 value: 17954
1: spectral pickle using Mayostat lev:8 gain:4.0 adv:23.0 musc:29.5 myst:29.5 mox:29.5 meat:5300 own:44 value:7465
2: spectral pickle using Mayostat lev:8 gain:4.0 adv:23.0 musc:29.5 myst:29.5 mox:29.5 meat:5300 own:44 value:7465
3: spectral pickle using Mayostat lev:8 gain:4.0 adv:23.0 musc:29.5 myst:29.5 mox:29.5 meat:5300 own:44 value:7465
4: fishy fish lasagna using Mayostat lev:10 gain:3.0 adv:19.0 musc:0.0 myst:0.0 mox:50.5 meat:6595 own:2 value:6785
One lasagna. VoA is 1250. 5 bonus adventures, 6250 value. Potion cost, 8075. Not worthwhile for a single lasanga.
 

heeheehee

Developer
Staff member
Lasagna is 5650 meat. QWOP is 2000 meat. 3x QWOP is 15 adventures on average; 1x lasagna is 14 adventures on average (ignoring milk, since it affects both equally). One adventure for 350 meat is well beyond the 1250 valueOfAdventure setting. There is no reason lasagna should be used without field gar over QWOP. (I make no claims about the optimality of QWOP at that VoA, just about the suboptimality of lasagna)

The issue here may be that EatDrink calculates lasagna as if Field Gar is active, then it checks to see if field gar is worth using when it gets around to consumption.
 

Theraze

Active member
No, it doesn't.
Code:
  if ($items[fishy fish lasagna, gnat lasagna, long pork lasagna] contains con.it && lasagna_do_garfield_good((fullness_limit() - get_fullness()) / 3, true))
  {
    con.adv.min += 5;
    con.adv.max += 5;
  }
If it will use lasagna, it adds 5 adventures.
 

heeheehee

Developer
Staff member
Well, if that's not the case, then the issue is that EatDrink is suggesting strictly suboptimal diets per any reasonable definition of "optimal".
 

Theraze

Active member
Possible. But you haven't given me any logs showing why that might have happened, only anecdotes which aren't really anything I can do anything about. Especially when I believe it still suggests the items properly for me the last time they were the best choice.
 

heeheehee

Developer
Staff member
Well, if I pretend that Monday doesn't matter (by removing that small block of code), then I get
Starting EatDrink.ash (version 3.2).
Consuming up to 15 food, 0 booze, and 0 spleen
Considering food from inventory closet Hagnk's Coinmasters NPCs the mall. Per-item budget cap is 25000.0.
Retrieval cap is 20000. Price will be a factor if you own it already.
An adventure has the value of 1250 meat. Muscle subpoint is 10.0. Nonprime stat subpoint is 2.0.
Simulating only; no purchases or food/drink/spleen consumption.
food: At 0, consuming to 15 with 248134 meat.
0: milk of magnesium price: 829 value: 17921
1: spectral pickle lev:8 gain:4.0 adv:23.0 musc:29.5 myst:29.5 mox:29.5 meat:4350 own:0 value:6203
2: spectral pickle lev:8 gain:4.0 adv:23.0 musc:29.5 myst:29.5 mox:29.5 meat:4350 own:0 value:6203
3: spectral pickle lev:8 gain:4.0 adv:23.0 musc:29.5 myst:29.5 mox:29.5 meat:4350 own:0 value:6203
4: gnat lasagna lev:10 gain:3.0 adv:19.0 musc:49.5 myst:0.0 mox:0.0 meat:6000 own:0 value:6081
choc: Checking non-filling crimbo chocolates - all 3 kinds
1: chocolate seal-clubbing club lev:0 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:0.0 meat:3250 own:94 value:500

However, since it is Monday today, and EatDrink acknowledges that field gar does nothing, I get
Simulating only; no purchases or food/drink/spleen consumption.
food: At 0, consuming to 15 with 248134 meat.
0: milk of magnesium price: 829 value: 17921
1: spectral pickle lev:8 gain:4.0 adv:23.0 musc:29.5 myst:29.5 mox:29.5 meat:4350 own:0 value:6203
2: spectral pickle lev:8 gain:4.0 adv:23.0 musc:29.5 myst:29.5 mox:29.5 meat:4350 own:0 value:6203
3: spectral pickle lev:8 gain:4.0 adv:23.0 musc:29.5 myst:29.5 mox:29.5 meat:4350 own:0 value:6203
4: super salad lev:11 gain:3.0 adv:14.5 musc:40.0 myst:36.0 mox:35.5 meat:1995 own:0 value:5557
choc: Checking non-filling crimbo chocolates - all 3 kinds
1: chocolate seal-clubbing club lev:0 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:0.0 meat:3250 own:94 value:500

Today is just not a very good day for reproducing this particular scenario.
 
Last edited:

Magus_Prime

Well-known member
I'll be able to give you an EatDrink run with increased verbosity and VOA information tomorrow. Monday's are bad for lasagna. :)
 

xKiv

Active member
Well, if that's not the case, then the issue is that EatDrink is suggesting strictly suboptimal diets per any reasonable definition of "optimal".

Because if it wasn't guaranteed to give strictly suboptimal results for *some* inputs, it would either solve NP-hard problem in polynomial time, or take *really* long time to run.

No, it doesn't.

An important part there is that lasagna_do_garfield_good will make sure that you actually have the effect (by getting and using the potion if it needs to) if it returns true. Long before any consumption takes place.
 

Theraze

Active member
Spectral pickle is just too good with your current VoA. Since you have the same VoA as I did, 1250, your single-lasagna value is not worth using the potion. Once you have it choose multiple lasagna, we'll see...
 
Top