CONSUME.ash - A diet handler script

soolar

Member
Instructions and details can be found at the github page here: https://github.com/soolar/CONSUME.ash

Preferred place for feedback is on the github issue tracker, but if you don't have an account and don't want to sign up for some reason, I'll still check this thread fairly regularly, or you can kmail me @ soolar the second (#2463557)
 

fronobulax

Developer
Staff member
Interesting. Thank you. I am unlikely to get a github account since the only reason I have to do so now would be to comment but if I get one I will comment there and I will not expect a lot of response here.

Demanding "superior capital letters" is cute, once, but I see no reason to make that a requirement. You could, for example call to_upper_case on the input and we would both be happy.

Is there any anecdotal data comparing your consumption results to eatDrink or vcon?

How do you decide what to consume? Are you using an algorithm that can be mathematically proven to be optimal or something that works "pretty good"?

I'm still not sure I understand how to compute VOA for meat farming according to your instructions but I also think using actual results would be good enough. Using gross profit is definitely wrong but net profit is probably right. If you take the difference between meat on hand at the end of farming, meat on hand at the beginning and divide by the number of adventures the result will account for meat spent on buffs and just about any other player controlled variable. Maybe you are aiming your instructions at someone who has no actual, personal meat farming data yet?

I had a little spleen left. CONSUME told me homeopathic mint tea. EatDrink told me nasty snuff. Superficially it looks like the adventures are the same but the tea was cheaper. That sounds like a good reason to investigate further. Thank you.
 

Veracity

Developer
Staff member
Instructions and details can be found at the github page here: https://github.com/soolar/CONSUME.ash
Interesting. I'll have to study this.

I confess to being amused by this:

Next, let's look at the drops from the Robortender, from giving it a Feliz Navidad. Frankly, I have absolutely no idea how much MPA this adds. Candy is worth a decent bit though since the advent of Sweet Synthesis. Going by a brief grepping of my log files, it looks like the robort drops candy roughly... a quarter of the time? Let's go with that. Candy can be worth anywhere from 400 to 3000 meat, give or take.
And many other examples of "look at the asking price in the Mall for item drops and add that into MPA".

A lot of that seems like advice for "how to optimize my outfit and buffs", which is cool, but I don't think I agree with the general philosophy of "if I can sell items in the mall for big bucks, they count for MPA". I'll have to ponder.
 

Crowther

Active member
Certainly using your marginal MPA from the end of the day is better than using your mean MPA, but it is not optimal either. The optimal value is usually lower. Using your final MPA means you are making near zero profit for your ending adventures. Fewer adventures with more meat coming in could provide more profit. Hitting optimal is actually a very hard problem.
 

soolar

Member
The biggest selling point I think my script has when compared to eatdrink or vcon is considering the spleen gained back from hobopolis consumables, which to my understanding neither of those do. I'm not 100% sure about that for vcon since I haven't experimented with it much, but I've used eatdrink for a long time and it has never used sliders or pickle juice for me, which this script finds as optimal for my valueOfAdventure.

It's not strictly optimal per se, especially because it tries to fill an organ all at once when possible, so if blood drive stickers are optimal it will usually eat one of them, a voodoo snuff, and a size 2 spleen item instead of eating a blood sticker, emptying spleen, and repeating.

It is still under very active development though, so it's getting better all the time!

As for how I decide what's "optimal," it probably is closer to pretty good than objectively perfect, the name is mostly just a cute acronym one of my friends came up with for CONSUME. To be kind of brief, it takes the valueOfAdventure * average adventure yield - price of item, then factors in the value of any organ cleanings in the same way, and sorts by this net value of a consumable divided by space taken. It then tries to fill up with whatever's best that fits.
 

fronobulax

Developer
Staff member
Certainly using your marginal MPA from the end of the day is better than using your mean MPA, but it is not optimal either. The optimal value is usually lower. Using your final MPA means you are making near zero profit for your ending adventures. Fewer adventures with more meat coming in could provide more profit. Hitting optimal is actually a very hard problem.

Since you are using the word optimal, what are you trying to optimize? Adventures generated by consumption? Average cost of generated adventures? Something else?

Meat per Adventure is really nothing more than a weighting factor so adventures can be compared in some meaningful way to the cost of items that produce them. If you were motivated enough you could assume a fixed set of mall prices and compute the MPA that yielded the largest number of adventures. I suspect you could recast the problem so that MPA was a variable with constraints and not even need to estimate it.

I ran some sensitivity analysis using EatDrink in simulate mode several years ago. I did my best to fix mall prices and then looked at adventures produced as a function of MPA. At that time it turned out that there were three regions in MPA between 0 and 10000 that yielded different adventures and consumption. So instead of worrying about a specific value of MPA you could just choose High, Medium or Low.

Since the assumption of a constant MPA is a concern, the right way to do this would be to determine how many turns each MPA could be generated for and recast the problem with a variable weight. But if "the problem" is still as insensitive to MPA as it was then, this might not be worth the effort unless the possible MPAs were in different regions.

I guess I'm saying that while it might be fun to worry about the specific value of MPA it probably won't make as much difference as people think it might.

:)
 

Veracity

Developer
Staff member
vcon doesn't calculate adventure yields of spleen items yet. I'll make it do that.

vcon is a package which doesn't actually consume items for you; it just calculates which are the most cost effective per size given the value of MPA you feed it, based on expected adventure yield and mall price.

It is up to the user of that package to decide how to use that info. I.e., do what CONSUME or EatDrink do. The main (only?) user so far is VeracityMeatFarm, which eats to capacity, drinks to capacity, and uses spleen for sweet synthesis and/or numberology. If there is left over spleen, I suppose it could seek extra adventures, given the change to vcon I will make soon.

Cleaning your spleen with Hobopolis consumables is an advanced strategy which I have not implemented. Haven't looked yet, but I assume your script spleens up for sweet synthesis and then spleen cleans & respleens for adventures. Or something. If you do that, impressive!
 

fronobulax

Developer
Staff member
I apologize for the verbal shorthand. When I say "vcon" I am really thinking of something wrapped around it that is using the information to do the consumption. VMF has does that and it could be copied or imported.
 

soolar

Member
Actually, the script just gets a full diet, then goes backwards from the end (because presumably the least valuable things will be at the end) and replaces a size x spleen item with enough spleen items to fill up x-1 space and a synthesis call, then keeps working backwards like that until there's synthesis turns >= the average adventure yield.

As for how it handles organ cleaning, it just goes through filling organs in the order of spleen, stomach, liver, and any time it runs in to something that cleans out some space in another organ, it ups how much space it has available in that organ, unless that would put it over the max, in which case it pauses what it's doing to go fill that organ up instead.
 

Veracity

Developer
Staff member
Clever.

Revision 120 of vcon calculates adventure profitability for spleen toxins, in the same way it does for foods and boozes, but doesn't consider just "superior" items, since Jick's idea of a "superior" spleen toxin seemingly has nothing to do with adventure yield.
 

heeheehee

Developer
Staff member
My impression from a first glance: this should be comparable to EatDrink (in that it uses a greedy approach) in results. vcon attempts to solve knapsack, so would have better results, ignoring special handling.

That said, given that this script handles more of the special cases that KoL consumption is rife with, I'd expect this to be slightly better than vcon (as of the last time I looked at it, anyhow).

Certainly using your marginal MPA from the end of the day is better than using your mean MPA, but it is not optimal either. The optimal value is usually lower. Using your final MPA means you are making near zero profit for your ending adventures. Fewer adventures with more meat coming in could provide more profit. Hitting optimal is actually a very hard problem.

I'm not convinced. Your marginal MPA should be just fine in computing the value of an item, as long as you take into consideration its cost.

You would be making near zero profit compared to an alternative, slightly-cheaper diet. Not zero profit entirely. There's a big difference between those two options.

Clever.

Revision 120 of vcon calculates adventure profitability for spleen toxins, in the same way it does for foods and boozes, but doesn't consider just "superior" items, since Jick's idea of a "superior" spleen toxin seemingly has nothing to do with adventure yield.

At least in my case, I determined that most spleen items are inferior to sweet synthesis (which I value at ~20k meat per spleen, which for me requires a minimum of 4 adv/spleen to even start being considered, i.e. blood-drive sticker).
 

Magus_Prime

Active member
I enjoyed reading through the readme and the usage instructions and, very much, appreciated the detailed walk-through of the though process behind the script.
 
Top