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

suinoq

New member
carboloading

In pastamancer aftercore I usually don't want to eat pasta and trigger carboloading. As I understand it, the correct way to make that happen is to put all the triggering foods onto the avoid list, by modifying the vars_name.txt file. I tried it out, and here's the lines that were added:

Code:
eatdrink_avoid_wet_stew	true
eatdrink_avoid_boring_spaghetti	true
eatdrink_avoid_delicious_noodles	true
eatdrink_avoid_delicious_spicy_noodles	true
eatdrink_avoid_painful_penne_pasta	true
eatdrink_avoid_pr0n_m4nic0tti	true
eatdrink_avoid_ravioli_della_hippy	true
eatdrink_avoid_spicy_noodles	true
eatdrink_avoid_fettucini_Inconnu	true
eatdrink_avoid_gnocchetti_di_Nietzsche	true
eatdrink_avoid_Hell_ramen	true
eatdrink_avoid_spaghetti_with_Skullheads	true
eatdrink_avoid_asparagus_lo_mein	true
eatdrink_avoid_olive_lo_mein	true
eatdrink_avoid_Knoll_lo_mein	true
eatdrink_avoid_Knob_lo_mein	true
eatdrink_avoid_spooky_lo_mein	true
eatdrink_avoid_cold_hi_mein	true
eatdrink_avoid_hot_hi_mein	true
eatdrink_avoid_sleazy_hi_mein	true
eatdrink_avoid_spooky_hi_mein	true
eatdrink_avoid_stinky_hi_mein	true
eatdrink_avoid_Knob_sausage_chow_mein	true
eatdrink_avoid_bat_wing_chow_mein	true
eatdrink_avoid_rat_appendix_chow_mein	true
eatdrink_avoid_tofu_chow_mein	true
eatdrink_avoid_pr0n_chow_mein	true
eatdrink_avoid_gnat_lasagna	true
eatdrink_avoid_long_pork_lasagna	true
eatdrink_avoid_fishy_fish_lasagna	true
eatdrink_avoid_sausage_wonton	true
eatdrink_avoid_tofu_wonton	true
eatdrink_avoid_unfortunate_dumplings	true
eatdrink_avoid_carob_chunk_noodles	true

Seems like a lot of variables for such a simple thing - perhaps a single 'avoid pasta' variable could be implemented, and the specific food avoidances handled internal to the script.



In other news: Today the script ate 3 super salads and 1 nutty organic salad. These foods are 3 fullness, so it seems strange that there would be a different choice here. There was a milk used prior to eating the 3 super salads, and then a second milk prior to eating the nutty organic. The milk usage was correct, but with the above talk about issues with milk handling I thought there might have been some costing calculation that resulted in the final consumed item (the nutty) being of lesser quality...

Btw, I've got 'considerCostWhenOwned' set at true, stats set to 0 value, ver 13.2 of eatdrink, and build 9213 of mafia. Maybe there was only 3 super salads available at the desired price?
 

fronobulax

Developer
Staff member
Comments noted. I've never used the avoid functionality so I can't comment on possible improvements.

The milk problems I was seeing became not repeatable so I am hoping they have been resolved.

Most of the time I have seen EatDrink "switch" items it has been because of a difference in cost to acquire. For whatever reason the first one consumed cost less than the second candidate and as a result something else appears to be better.
 

Theraze

Active member
Yeah... if you don't like what it's buying, the best general solution I've found is to increase the value of adventures. Better food, more adventures...
 

Ferdawoon

Member
The milk problems I was seeing became not repeatable so I am hoping they have been resolved.
I did not have any issues for a while either, but now all of a sudden my multi got the "Do you want to eat without Milk" while having 2 milk of Magnesium in the inventory. =S
 

slyz

Developer
It looks like there was a small 100 meat spike in MoM prices this week, would that explain it? You would need to have a pretty low meat per adventure setting for it to matter, though.
 

fronobulax

Developer
Staff member
It looks like there was a small 100 meat spike in MoM prices this week, would that explain it? You would need to have a pretty low meat per adventure setting for it to matter, though.

How low is low? I think I run with 500 or 600 or whatever the default was at whatever time I last looked at the value.
 

xKiv

Active member
A single milk should give 15 adventures, always, so with valueOfAdventure=500, you would have to be looking at 7500 meat for a milk before it becomes unprofitable ...
 

Theraze

Active member
Well, technically milk has a base of 10 adventures, but if you have Impetuous Sauciness or are a Sauceror...

And mine didn't start trying to consume milk regularly until I set the value to 1000... remember that it doesn't try to run at a loss, so while it might always seem logical to run with milk on, it won't necessarily use it with a spike.

For likely guesses in terms of what food will be suggested at what levels, check out the Kingdom of Loathing optimal diet lists... milk isn't included until you hit a value of adventure of 895-995. That's part of why I doubled my personal VoA. To get milk to show up, you have to add a semi-rare (fortune cookie) to your eating schedule which makes sense, since if you just consider it by itself, you'd only get a single adventure for that milk :) Anyways, eating has been more stable since I raised my VoA, including using a variety of the 16 different fruity drinks instead of sometimes having it fail to use them because they sell too well...
 

slyz

Developer
can't it give 10 turns if you don't have Impetuous Sauciness? Even so, you would need a ridiculously low meat per adventure for it not to be profitable.
 

Theraze

Active member
If you have IS, it should be 15 turns, since base is 10. But yeah, a 100 spike in the mall costs (and it works based on the 5th cheapest, right...?) might be enough to affect whether or not it thinks it's profitable at 500. As I said, I've had much less problems with "WTF? Why would it DO that?" type decisions since I raised my VoA to 1000.
 

lostcalpolydude

Developer
Staff member
For likely guesses in terms of what food will be suggested at what levels, check out the Kingdom of Loathing optimal diet lists... milk isn't included until you hit a value of adventure of 895-995.

Diet page said:
The lists currently do not include milk/ode since they now don't rely on exactly which items you eat.
The only way it shouldn't be worth using milk is if you're eating a single fortune cookie. The second one a no-skill person uses will give 5 adventures, which at current prices (more than a thousand at 895) is worth using with VoA = 200.
 

Theraze

Active member
So, here's the milk code that decides if it should move along...
Code:
  int pullcost = 0;
  if (USE_STORAGE && get_ronin() && pulls_remaining() > 0)
    pullcost = COST_OF_PULL;
  int milkprice = mall_price($item[milk of magnesium]);
  float milkvalue = fullness * VALUE_OF_ADVENTURE;
  boolean shouldgetmilk = (milkvalue > (milkprice + pullcost));
Basically, it looks like it evaluates milk per consumption, not based on total consumption desired... so if your value of adventure is 500, you're eating 1 fullness (caviar, apricot, etc)... that means that milk is only 'worth' 500. Not worth it if milk costs over 800...

We could rework it based on desired total fullness left, but that will screw people up who are food-poor early during HC/BM runs... Easier just to tell people to put their VoA above milk cost.
 

slyz

Developer
That made sense when eating didn't use turns of Milk of Magnesium. That logic was never changed? ^^

EDIT: why would it screw people in early HC/BM ? If they can't make MoM, surely EatDrink will skip it? And if they can make it, even taking a turn to craft it is worth it turngen-wise (and if you are running EatDrink, you're probably not doing a speed run).
 

Theraze

Active member
If you have (as sad example) 1 stalk of asparagus, a goat milk, the sauce to convert it, and a VoA of <900. :)
 

Veracity

Developer
Staff member
You have to be level 8 to find a goat's milk in HC or BM.
In HC, I eat mostly reagent pasta from L6 until the Island War is underway.
Even in Bad Moon, I can't imagine not having, at least, pies or pizzas available.
"1 stalk of asparagus" available at L8?
You've GOT to be kidding.
 

Theraze

Active member
Realistically, I'd expect caviar or apricots or something cookable. But the fact remains that it currently works based on what you actually are consuming, which is something guaranteed to be accurate for at least that consumption.

If ConsumeLast had ever been implemented into EatDrink, then you could be certain that your total consumption was accurate, you weren't wasting turns of milk (for those without box servants or Inigo's), and VoA v. milk cost could actually be validated properly...
 

xKiv

Active member
For likely guesses in terms of what food will be suggested at what levels, check out the Kingdom of Loathing optimal diet lists... milk isn't included until you hit a value of adventure of 895-995.

Actually, it isn't included at all, ever:
optimal_diets said:
The lists currently do not include milk/ode since they now don't rely on exactly which items you eat.

Veracity said:
You have to be level 8 to find a goat's milk in HC or BM.
Unless you fax a dairy goat earlier (in HC). Which appears to currently be one of the best day 1 faxes (if you do that, which I do).
Still, people who do that also probably wait to eat until we can eat something better.

Theraze said:
If you have (as sad example) 1 stalk of asparagus, a goat milk, the sauce to convert it, and a VoA of <900.
You could decide whether to use milk *after* seeing what (and how much) you would eat, and adjust per-fullness value accordingly.
 
Last edited:

Theraze

Active member
Yes/no, re-milk. If you include a semi-rare adventure, and have a VoA >= milk price, it will list the milk there, since it assumes you might be eating that in conjunction with the rest of your food.

Currently, it does decide *after* seeing what you would eat... the problem is, each consumption is an individual event, as ConsumeLast was never coded. As long as your first consumption item is at least 2 fullness, it will consume a milk to start you off. If your first is a 1, and your VoA < milkprice, you get this issue...

'Best' fix, I think, is to actually try to code the ConsumeLast bit that was commented in there once and never used again. That would allow for checking consumption on any amount of VoA and total EatDrink consumption properly. Guess I can make that my next little project...
Think the first step is having the system be more aware of how much you can actually craft, and not trying to make more than the max, as it always seems to try to make creatable_amount +1 if you can consume that much but can't craft that much... That would mean we can actually get semi-accurate consumption plans... create each item desired, adding it to a stack, then consume enough milk/ode to finish it off, and onwards...

Edit: Okay... think I've fixed the over-consumption. Made it remove from consumption list if availability < 1, in the filter_final function, which gets run every pass. Also made it remove items if it's trying to buy them from the mall, it recalculates the value, fails again, and the value is the same... if it's failed with the same value, it's unlikely to work the 3rd-20th (or 200th) times. Will test a few days then upload. Next step (after making sure I haven't broken things) will be splitting the consumption... create or buy or pull the food, put it on a stack, increase availability baseline by 1 and decrease desired food by its appetite amount... may still cause issues with things like quantum tacos (if they ever show up as best), but should work for the rest of it.
 
Last edited:

Theraze

Active member
Okay... here's ED 3.1.2 with the overconsumption fix (only tries to eat as many as you actually have) and failed purchase fix... haven't gotten to test the failed purchase, since that only happens when something goes wrong. If anyone wants to test this along with me, go for it. I mostly like that it's less annoying/more accurate. Doesn't affect the actual consumption system yet... that one will get more testing than 8 successful executions before people see it in the wild.

Note: I did actually test the overconsumption... it did only consume one painful penne pasta and not give me a failed consumption message on the second non-existing one.

Anyways, here's a quote of a 3 penne pasta consumption... the lihc eye pie after would have given an error after the penne pasta.
> eatdrink
Refreshing stash contents...
Stash list retrieved.
Internal checkpoint created.
Skipping favorites.
You're in ronin, and not simulating, so no shopping for you.
Starting EatDrink.ash (version 3.1.2).
Consuming up to 15 food, 19 booze, and 15 spleen
Considering food from inventory Hagnk's . Per-item budget cap is 12500.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 3000 meat each.
An adventure has the value of 1000 meat. Mysticality subpoint is 10.0. Nonprime stat subpoint is 2.0. Hagnk pulls are limited and their 'cost' is incorporated.
Pass 1: food.
food: At 2, consuming to 15.
Loading food map from Mafia's datafiles
Filtering by type
Filtering by level
Finding prices
Searching for "hot wing"...
Search complete.
Setting values
Choosing food to consume.
Creating a painful penne pasta in 0 seconds
Verifying ingredients for painful penne pasta (1)...
Robbing the hermit...
You acquire an item: jabañero pepper
Hermit successfully looted!
Creating painful penne pasta (1)...
You acquire an item: painful penne pasta
Successfully created painful penne pasta (1)
Using 1 milk of magnesium...
You acquire an effect: Got Milk (duration: 15 Adventures)
Finished using 1 milk of magnesium.
0: milk of magnesium price: 888 value: 2112.0
Since you are not in a Mysticality sign, you may not visit the restaurant.
Eating 1 painful penne pasta...
You gain 10 Adventures
You gain 17 Strongness
You gain a Muscle point!
You lose 20 hit points
You lose some of an effect: Got Milk
Finished eating 1 painful penne pasta.
1: painful penne pasta lev:3 gain:3.0 adv:8.0 musc:18.5 myst:0.0 mox:0.0 meat:265 own:2 value:2590
Choosing food to consume.
Creating a painful penne pasta in 0 seconds
Verifying ingredients for painful penne pasta (1)...
Robbing the hermit...
You acquire an item: jabañero pepper
Hermit successfully looted!
Creating painful penne pasta (1)...
You acquire an item: painful penne pasta
Successfully created painful penne pasta (1)
Since you are not in a Mysticality sign, you may not visit the restaurant.
Eating 1 painful penne pasta...
You gain 11 Adventures
You gain 17 Strongness
You lose 23 hit points
You lose some of an effect: Got Milk
Finished eating 1 painful penne pasta.
2: painful penne pasta lev:3 gain:3.0 adv:8.0 musc:18.5 myst:0.0 mox:0.0 meat:265 own:2 value:3590
Choosing food to consume.
Creating a painful penne pasta in 0 seconds
Verifying ingredients for painful penne pasta (1)...
Robbing the hermit...
You acquire an item: jabañero pepper
Hermit successfully looted!
Creating painful penne pasta (1)...
You acquire an item: painful penne pasta
Successfully created painful penne pasta (1)
Since you are not in a Mysticality sign, you may not visit the restaurant.
Eating 1 painful penne pasta...
You gain 12 Adventures
You gain 16 Strengthliness
You lose 22 hit points
You lose some of an effect: Got Milk
Finished eating 1 painful penne pasta.
3: painful penne pasta lev:3 gain:3.0 adv:8.0 musc:18.5 myst:0.0 mox:0.0 meat:265 own:1 value:3590
Choosing food to consume.
Creating a lihc eye pie in 0 seconds
Verifying ingredients for lihc eye pie (1)...
Verifying ingredients for pie crust (1)...
Searching for "gnollish pie tin"...
Search complete.
Purchasing Gnollish pie tin (1 @ 30)...
You acquire an item: Gnollish pie tin
You spent 30 Meat
Purchases complete.
Searching for "wad of dough"...
Search complete.
Purchasing wad of dough (1 @ 50)...
You acquire an item: wad of dough
You spent 50 Meat
Purchases complete.
Creating pie crust (1)...
You acquire an item: pie crust
Successfully created pie crust (1)
Creating lihc eye pie (1)...
You acquire an item: lihc eye pie
Successfully created lihc eye pie (1)
(usable quantity of milk of magnesium is limited to 0 by remaining fullness)
Since you are not in a Mysticality sign, you may not visit the restaurant.
Eating 1 lihc eye pie...
You gain 11 Adventures
You gain 11 Magicalness
You acquire an effect: Eye of the Lihc (duration: 5 Adventures)
You lose an effect: Got Milk
Finished eating 1 lihc eye pie.
4: lihc eye pie lev:2 gain:4.0 adv:8.5 musc:0.0 myst:11.5 mox:0.0 meat:100 own:5 value:3128
Pass 2: drink.
Skipping drink.
Pass 3: spleen.
spleen: At 0, consuming to 15.
Loading spleen map from Mafia's datafiles
Filtering by type
Filtering by level
Finding prices
Setting values
Choosing spleen to consume.
Best find was none with a value of 0. That's no good, so not consuming and moving on.
No spleen available that's good enough. Moving on.
Pass 4: drink.
Skipping drink.
Finished.
Spent 80 meat. Gained Fullness: 13. Inebriety: 0. Spleen: 0. Adventures: 41. Muscle: 50. Moxie: 0. Mysticality: 11.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
******************************************
Now, to recap...
******************************************
Starting EatDrink.ash (version 3.1.2).
Consuming up to 15 food, 19 booze, and 15 spleen
Considering food from inventory Hagnk's . Per-item budget cap is 12500.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 3000 meat each.
An adventure has the value of 1000 meat. Mysticality subpoint is 10.0. Nonprime stat subpoint is 2.0. Hagnk pulls are limited and their 'cost' is incorporated.
food: At 2, consuming to 15.
0: milk of magnesium price: 888 value: 2112.0
1: painful penne pasta lev:3 gain:3.0 adv:8.0 musc:18.5 myst:0.0 mox:0.0 meat:265 own:2 value:2590
2: painful penne pasta lev:3 gain:3.0 adv:8.0 musc:18.5 myst:0.0 mox:0.0 meat:265 own:2 value:3590
3: painful penne pasta lev:3 gain:3.0 adv:8.0 musc:18.5 myst:0.0 mox:0.0 meat:265 own:1 value:3590
4: lihc eye pie lev:2 gain:4.0 adv:8.5 musc:0.0 myst:11.5 mox:0.0 meat:100 own:5 value:3128
spleen: At 0, consuming to 15.
Best find was none with a value of 0. That's no good, so not consuming and moving on.
Finished.
Spent 80 meat. Gained Fullness: 13. Inebriety: 0. Spleen: 0. Adventures: 41. Muscle: 50. Moxie: 0. Mysticality: 11.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
 
Last edited:

fronobulax

Developer
Staff member
Explain what you call the "overconsumption" problem and the failed purchase problem, please. It is quite likely that I will copy or paraphrase your answer as "release notes" but I want to make sure I understand the problems. Thanks.

Edit: Calling the script from the menu and entering 15, 19, 15, false, false absolutely refuses to consider consuming spleen items. The previous version does so just fine.
 
Last edited:
Top