Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17

Thread: vcon - Veracity's consumable library

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,410

    Default vcon - Veracity's consumable library

    Here is some experimental code I'm developing for use in VeracityMeatFarm. I'm releasing it now - although it is still under development - so people can see where I'm going, perhaps use it themself, and give me suggestions and comments.

    Install it like this.
    Code:
    svn checkout https://svn.code.sf.net/p/veracity0/code/vcon/
    It has a "main" function which will look up every food or booze and decide which are the most "profitable" for every size.
    It assumes that an adventure will yield XXX amount of Meat. If you've been running VeracityMeatFarm, it will use the statistics that script collects. Otherwise, it uses valueOfAdventure.

    First run in a session, it will do a mess-of-mall-searches.
    Subsequent runs, mall_price() is cached by KoLmafia, so it's a lot faster.

    Here is a sample (second) run:

    Code:
    > vcon
    
    Calculating expected profit for consumables, given Meat Per Adventure = 3883
    
    ice-cold Sir Schlitz (100 cost; 3783 expected_profit) is better than none (0)
    bloody beer (120 cost; 7646 expected_profit) is better than ice-cold Sir Schlitz (3783)
    shot of orange schnapps (110 cost; 7656 expected_profit) is better than bloody beer (7646)
    can of Swiller (170 cost; 11479 expected_profit) is better than shot of orange schnapps (7656)
    distilled fortified wine (3950 cost; 17406 expected_profit) is better than can of Swiller (11479)
    pumpkin beer (3000 cost; 18356 expected_profit) is better than distilled fortified wine (17406)
    Ambitious Turkey (3990 cost; 19308 expected_profit) is better than pumpkin beer (18356)
    iced plum wine (4555 cost; 20684 expected_profit) is better than Ambitious Turkey (19308)
    reverse Tantalus (1220 cost; 22078 expected_profit) is better than iced plum wine (20684)
    elemental caipiroska (828 cost; 22470 expected_profit) is better than reverse Tantalus (22078)
    bottle of popskull (130 cost; 11519 expected_profit) is better than none (0)
    bottle of Pinot Renoir (700 cost; 22598 expected_profit) is better than bottle of popskull (11519)
    dusty bottle of Zinfandel (100 cost; 23198 expected_profit) is better than bottle of Pinot Renoir (22598)
    dusty bottle of Marsala (120 cost; 27061 expected_profit) is better than dusty bottle of Zinfandel (23198)
    Hodgman's blanket (19325 cost; 38920 expected_profit) is better than dusty bottle of Marsala (27061)
    Vodka Matryoshka (2385 cost; 42269 expected_profit) is better than Hodgman's blanket (38920)
    Tequiz Navidad (2199 cost; 42455 expected_profit) is better than Vodka Matryoshka (42269)
    ice-cold fotie (100 cost; 11549 expected_profit) is better than none (0)
    salty dog (245 cost; 21111 expected_profit) is better than ice-cold fotie (11549)
    bloody mary (130 cost; 21226 expected_profit) is better than salty dog (21111)
    extra-spicy bloody mary (272 cost; 28850 expected_profit) is better than bloody mary (21226)
    white lightning (100 cost; 29022 expected_profit) is better than extra-spicy bloody mary (28850)
    icy mushroom wine (13999 cost; 32597 expected_profit) is better than white lightning (29022)
    stinky mushroom wine (10999 cost; 35597 expected_profit) is better than icy mushroom wine (32597)
    pointy mushroom wine (1599 cost; 44997 expected_profit) is better than stinky mushroom wine (35597)
    knob mushroom wine (1500 cost; 45096 expected_profit) is better than pointy mushroom wine (44997)
    gloomy mushroom wine (6500 cost; 49803 expected_profit) is better than knob mushroom wine (45096)
    crystal skeleton vodka (7850 cost; 54278 expected_profit) is better than gloomy mushroom wine (49803)
    perfect cosmopolitan (3200 cost; 68635 expected_profit) is better than crystal skeleton vodka (54278)
    roll in the hay (230 cost; 46366 expected_profit) is better than none (0)
    Divine (2225 cost; 59903 expected_profit) is better than roll in the hay (46366)
    Gordon Bennett (1100 cost; 61028 expected_profit) is better than Divine (59903)
    tangarita (990 cost; 61138 expected_profit) is better than Gordon Bennett (61028)
    Ice Island Long Tea (6700 cost; 70960 expected_profit) is better than tangarita (61138)
    hacked gibson (6070 cost; 75473 expected_profit) is better than Ice Island Long Tea (70960)
    Ye Olde Meade (184 cost; 58061 expected_profit) is better than none (0)
    mulled berry wine (4801 cost; 72859 expected_profit) is better than Ye Olde Meade (58061)
    ice stein (14890 cost; 31706 expected_profit) is better than none (0)
    corpse on the beach (9200 cost; 72343 expected_profit) is better than ice stein (31706)
    corpsetini (9090 cost; 72453 expected_profit) is better than corpse on the beach (72343)
    Psychotic Train wine (1800 cost; 73918 expected_profit) is better than corpsetini (72453)
    Bowl of Scorpions (450 cost; 20906 expected_profit) is better than none (0)
    bucket of wine (9500 cost; 60394 expected_profit) is better than none (0)
    hot buttered roll (100 cost; 3783 expected_profit) is better than none (0)
    fortune cookie (38 cost; 3845 expected_profit) is better than hot buttered roll (3783)
    chorizo taco (104 cost; 7662 expected_profit) is better than fortune cookie (3845)
    asparagus stir-fry (689 cost; 10960 expected_profit) is better than chorizo taco (7662)
    olive stir-fry (359 cost; 11290 expected_profit) is better than asparagus stir-fry (10960)
    tofu stir-fry (210 cost; 11439 expected_profit) is better than olive stir-fry (11290)
    gingerbread bugbear (100 cost; 11549 expected_profit) is better than tofu stir-fry (11439)
    tasty tart (4585 cost; 16771 expected_profit) is better than gingerbread bugbear (11549)
    Knob pasty (3474 cost; 17882 expected_profit) is better than tasty tart (16771)
    snow crab (4975 cost; 18323 expected_profit) is better than Knob pasty (17882)
    meteoreo (6370 cost; 18869 expected_profit) is better than snow crab (18323)
    bowl of cottage cheese (100 cost; 7666 expected_profit) is better than none (0)
    ghuol-ear kabob (104 cost; 13486 expected_profit) is better than bowl of cottage cheese (7666)
    rat appendix kabob (102 cost; 13488 expected_profit) is better than ghuol-ear kabob (13486)
    bat wing kabob (100 cost; 13490 expected_profit) is better than rat appendix kabob (13488)
    White Citadel burger (174 cost; 19241 expected_profit) is better than bat wing kabob (13490)
    Knob stir-fry (999 cost; 20357 expected_profit) is better than White Citadel burger (19241)
    Knoll stir-fry (285 cost; 21071 expected_profit) is better than Knob stir-fry (20357)
    pr0n stir-fry (800 cost; 24439 expected_profit) is better than Knoll stir-fry (21071)
    tofurkey gravy (799 cost; 24440 expected_profit) is better than pr0n stir-fry (24439)
    bat-shaped Crimboween cookie (3000 cost; 31947 expected_profit) is better than tofurkey gravy (24440)
    blob-shaped Crimbo cookie (2400 cost; 32547 expected_profit) is better than bat-shaped Crimboween cookie (31947)
    skeleton quiche (6998 cost; 35715 expected_profit) is better than blob-shaped Crimbo cookie (32547)
    This Charming Flan (3745 cost; 38968 expected_profit) is better than skeleton quiche (35715)
    bowl of maggots (3260 cost; 39453 expected_profit) is better than This Charming Flan (38968)
    spicy noodles (199 cost; 34748 expected_profit) is better than none (0)
    insanely spicy bean burrito (300 cost; 40471 expected_profit) is better than spicy noodles (34748)
    insanely spicy enchanted bean burrito (690 cost; 43964 expected_profit) is better than insanely spicy bean burrito (40471)
    can-shaped gelatinous cranberry sauce (1793 cost; 48686 expected_profit) is better than insanely spicy enchanted bean burrito (43964)
    nutty organic salad (2400 cost; 50020 expected_profit) is better than can-shaped gelatinous cranberry sauce (48686)
    super ka-bob (1900 cost; 50520 expected_profit) is better than nutty organic salad (50020)
    pumpkin pie (15300 cost; 50711 expected_profit) is better than super ka-bob (50520)
    ultrafondue (1500 cost; 54803 expected_profit) is better than pumpkin pie (50711)
    whole roasted chicken (2800 cost; 55445 expected_profit) is better than ultrafondue (54803)
    lihc eye pie (321 cost; 32684 expected_profit) is better than none (0)
    Hell broth (1906 cost; 38865 expected_profit) is better than lihc eye pie (32684)
    Boris's key lime pie (18999 cost; 39246 expected_profit) is better than Hell broth (38865)
    Jarlsberg's key lime pie (16960 cost; 41285 expected_profit) is better than Boris's key lime pie (39246)
    pr0n m4nic0tti (130 cost; 42583 expected_profit) is better than Jarlsberg's key lime pie (41285)
    Hell ramen (2700 cost; 45837 expected_profit) is better than pr0n m4nic0tti (42583)
    boring spaghetti (425 cost; 46171 expected_profit) is better than Hell ramen (45837)
    spectral pickle (5998 cost; 83311 expected_profit) is better than boring spaghetti (46171)
    fettucini Inconnu (1250 cost; 70585 expected_profit) is better than none (0)
    hot hi mein (4546 cost; 94470 expected_profit) is better than fettucini Inconnu (70585)
    stinky hi mein (4453 cost; 94563 expected_profit) is better than hot hi mein (94470)
    spaghetti with Skullheads (5999 cost; 89134 expected_profit) is better than none (0)
    gnocchetti di Nietzsche (1233 cost; 93900 expected_profit) is better than spaghetti with Skullheads (89134)
    bowl of fishysoisse (4475 cost; 104249 expected_profit) is better than gnocchetti di Nietzsche (93900)
    fleetwood mac 'n' cheese (985 cost; 117446 expected_profit) is better than bowl of fishysoisse (104249)
    penguin focaccia bread (1499 cost; 80044 expected_profit) is better than none (0)
    deluxe layer cake (3899 cost; 170836 expected_profit) is better than none (0)
    sheet cake (1400 cost; 99558 expected_profit) is better than none (0)
    pie man was not meant to eat (1795 cost; 580655 expected_profit) is better than none (0)
    Churchill (12340 cost; 7075 expected_profit) is better than none (0)
    Gnomish sagngria (2600 cost; 16815 expected_profit) is better than Churchill (7075)
    Siberian sunrise (843 cost; 18572 expected_profit) is better than Gnomish sagngria (16815)
    Bloody Nora (2600 cost; 20698 expected_profit) is better than Siberian sunrise (18572)
    elemental caipiroska (828 cost; 22470 expected_profit) is better than Bloody Nora (20698)
    Aye Aye, Captain (1500 cost; 23739 expected_profit) is better than none (0)
    Chakra Libre (1150 cost; 24089 expected_profit) is better than Aye Aye, Captain (23739)
    Drunken Neurologist (700 cost; 24539 expected_profit) is better than Chakra Libre (24089)
    More Humanitini than Humanitini (495 cost; 24744 expected_profit) is better than Drunken Neurologist (24539)
    Aura Libre (2999 cost; 30006 expected_profit) is better than More Humanitini than Humanitini (24744)
    Crazymaker (2000 cost; 31005 expected_profit) is better than Aura Libre (30006)
    Drunken Astrophysicist (1000 cost; 32005 expected_profit) is better than Crazymaker (31005)
    Shot of the Living Dead (800 cost; 32205 expected_profit) is better than Drunken Astrophysicist (32005)
    perfect cosmopolitan (3200 cost; 68635 expected_profit) is better than none (0)
    
    ******Best Food by Size******
    food[1] is meteoreo (6370 cost per size) (18869 profit per size)
    food[2] is bowl of maggots (1630 cost per size) (19726 profit per size)
    food[3] is whole roasted chicken (933 cost per size) (18481 profit per size)
    food[4] is spectral pickle (1499 cost per size) (20827 profit per size)
    food[5] is stinky hi mein (890 cost per size) (18912 profit per size)
    food[6] is fleetwood mac 'n' cheese (164 cost per size) (19574 profit per size)
    food[7] is penguin focaccia bread (214 cost per size) (11434 profit per size)
    food[10] is deluxe layer cake (389 cost per size) (17083 profit per size)
    food[15] is sheet cake (93 cost per size) (6637 profit per size)
    food[100] is pie man was not meant to eat (17 cost per size) (5806 profit per size)
    
    ******Best Booze by Size******
    booze[1] is elemental caipiroska (828 cost per size) (22470 profit per size)
    booze[2] is Tequiz Navidad (1099 cost per size) (21227 profit per size)
    booze[3] is perfect cosmopolitan (1066 cost per size) (22878 profit per size)
    booze[4] is hacked gibson (1517 cost per size) (18868 profit per size)
    booze[5] is mulled berry wine (960 cost per size) (14571 profit per size)
    booze[6] is Psychotic Train wine (300 cost per size) (12319 profit per size)
    booze[8] is Bowl of Scorpions (56 cost per size) (2613 profit per size)
    booze[10] is bucket of wine (950 cost per size) (6039 profit per size)
    
    ROBORTENDER[1] is elemental caipiroska (828 cost per size) (22470 profit per size)
    MEDIUM[2] is Shot of the Living Dead (400 cost per size) (16102 profit per size)
    PERFECT[3] is perfect cosmopolitan (1066 cost per size) (22878 profit per size)
    It is still under development.

    For now, it will obey autoBuyPriceLimit.
    For now, it will not consider candy, since you may want those for Sweet Synthesis

    I envision usage will be something like this:

    Code:
    while (I have fullness left) 
        look at all foods whose size is l<= my available fullness
        eat as many of the "most profitable" food of any size as fullness allows
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  2. #2
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,574

    Default

    Cool! I have similar code in my login/logout script. It seems to be a fair bit less thorough, but there may be something in there which may help you.

    PHP Code:
    item top_consume(string type) {  // accepts 'booze' or 'food'
       
    if (type == "food") {  // special priorities
          
    if (item_amount($item[steel lasagna]) > 0) return $item[steel lasagna];
          if (
    get_counters("Fortune Cookie",0,280) == "") return $item[fortune cookie];
       }
       
    int firstcookie;
       for 
    i from 0 to 200 if (get_counters("Fortune Cookie",i,i) != "") { firstcookie i; break; }
       
    item[intsorted;       // sortable index
       
    float[itemdex;        // profitability index
       
    int avail_hit() { return type == "booze" max(0,inebriety_limit() - my_inebriety()) : max(0,fullness_limit() - my_fullness() - 
          
    to_int(firstcookie 160 my_adventures() + (fullness_limit() - my_fullness())*4)); }
       
    float hit(item ed) { return type == "booze" ? (avail_hit() == min(1.0,ed.inebriety) : ed.inebriety) : ed.fullness; }
       foreach 
    i in $items[] {
          if (
    item_type(i) != type || !is_tradeable(i) || i.levelreq my_level() || $strings[crappy,decent,goodcontains i.quality || hit(i) == 0) continue;
          if (
    avail_hit() > && hit(i) > avail_hit()) continue;
          if (
    type != "booze" && i.inebriety 0) continue;
          if (!
    be_good(i) || historical_price(i) > 40000 || mall_price(i) < 100 || mall_price(i) > 34000) continue;
          switch (
    my_primestat()) {
             case 
    $stat[muscle]: if (collapse(i.muscle) == 0) continue; break;
             case 
    $stat[mysticality]: if (collapse(i.mysticality) == 0) continue; break;
             default: if (
    collapse(i.moxie) == 0) continue;
          }
          
    sorted[count(sorted)] = i;
          
    dex[i] = (1.5*collapse(i.adventures)*to_int(get_property("valueOfAdventure"))-mall_price(i))/hit(i);      
       }
       
    sort sorted by -dex[value];
       for 
    n from 0 to 4 print((n+1)+": "+sorted[n]+" ("+rnum(hit(sorted[n]))+" hit, "+rnum(collapse(sorted[n].adventures))+" advs, "+mall_price(sorted[n])+" meat) => "+dex[sorted[n]]);
       return 
    sorted[0];

    I can see a few issues I ran into which you may or may not wish to handle in your script:

    • Prioritize intake of any steel items, in the off chance that they are in inventory.
    • Look ahead and leave enough fullness/inebriety for projected fortune cookie/Lucky Lindy needs. The code above predates Lucky Lindy so it's only considering fortune cookies, but checking for both would be splendid.
    • Was going to add 'watch out for food that also gives inebriety', but looks like you're already ignoring those. I didn't think to check for that originally, which lost me a day's adventuring!


    Hope this is the sort of comment you were looking for.
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Wossna | Om*****st (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mercenary Mood | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | Drag-n-Drop Inventories | CanAdv | Script Registry | Map Manager
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  3. #3
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,410

    Default

    Interesting. Our solutions satisfy different constraints.

    Mine is intended as a utility library for selecting "profitable" - defined as ( "expected income" - "cost" ) - food and drink in aftercore. Hence, no "be_safe" type stuff, since in aftercore, you can buy and use anything you want. Similarly, it does not deal with steel organs or fortune cookies, since those are part of the consumption strategy; what I calculate is how to use the "not steel organ or fortune cookie or lucky lindy" part.

    For example, VeracityMeatFarm has a "eat_up" function which has several specific things hardcoded to consider: spaghetti breakfast, Dinsey foodcone, jumping harseradish. It also deals with Mayoflex, TT barrel prayer, milk of magnesium, and so on. As of today (soon to be released), there are two available "how to finish eating" strategies:

    1) From a (soon to be configurable) set of 3-full foods, eat as many of the most profitable. Finish with 1 full foods.
    2) My proposed strategy using this package to look at all foods. Here's how it coded up:

    Code:
        // *** Strategy: eat as many of the most profitable food available that
        // *** your stomach can hold. Iterate based on new capacity until
        // *** your stomach is full.
    
        if ( count( vcon_best_foods ) == 0 ) {
    	calculate_best_foods( mpa );
        }
    
        while ( full_remaining > 0 ) {
    	consumable food;
    
    	foreach size, con in vcon_best_foods {
    	    if ( con.size <= full_remaining && con.pps > food.pps ) {
    		food = con;
    	    }
    	}
    
    	if ( food.size == 0 ) {
    	    print( "Internal error: unable to select a food; fullness left = " + full_remaining );
    	    break;
    	}
    
    	int foods = full_remaining / food.size;
    	if ( foods == 0 ) {
    	    print( "Internal error: selected size " + food.size + " food with fullness left = " + full_remaining );
    	    break;
    	}
    
    	eat_food( foods, food.it );
    	current_full = my_fullness();
    	full_remaining = max_full - current_full;
        }
    Something I quite like from your code is filtering out "crappy", "decent", and "good" foods. That would surely end up with the same results with a whole lot fewer mall searches - although if your VoA is too low, you may not get any matches.

    I'll try that. Thanks!

  4. #4
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,574

    Default

    Code:
    	current_full = my_fullness();
    	full_remaining = max_full - current_full;
        }
    Originally Posted by Veracity View Post
    If full_remaining accounted for future fortune cookie/Lucky Lindy consumption (as in the avail_hit() function in my version), I would use this myself. Thus far, I've been letting my login script handle consumption before I run VMF (which will then somewhat frustratingly use a milk and eat a single-fullness food, losing me a semirare), but it looks like I'll be using this instead going forward -- either the code from VMF itself or something else that imports your library. I quite like it.

    Thanks!
    Originally Posted by Veracity View Post
    Glad I could be of some small assistance. Thank you for sharing.
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Wossna | Om*****st (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mercenary Mood | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | Drag-n-Drop Inventories | CanAdv | Script Registry | Map Manager
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  5. #5
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,144

    Default

    Thank you.

    How do you define profit when you calculate it? My guess is that you "buy" and consume one of an item costing X, it generates Y adventures so the profit is (Y * meat per adv) - X, but it would be nice to have confirmation.

    At what point, if any, will you consider profit calculations with other factors such as purchase discounts (Travoltan trousers, etc.), consumption enhancements such as Ode or the various ways to drink martinis, etc.?

    ******Best Booze by Size******
    booze[1] is elemental caipiroska (825 cost per size) (15507 profit per size)
    booze[2] is Tequiz Navidad (1099 cost per size) (14552 profit per size)
    booze[3] is perfect cosmopolitan (1133 cost per size) (15652 profit per size)
    booze[4] is hacked gibson (1500 cost per size) (12790 profit per size)
    booze[5] is mulled berry wine (960 cost per size) (9927 profit per size)
    booze[6] is Psychotic Train wine (266 cost per size) (8579 profit per size)
    booze[8] is Bowl of Scorpions (56 cost per size) (1815 profit per size)
    I'm not quite sure what to do with the above information. Do I want as many perfect cosmopolitans as I can handle because that's the best profit per size? Does the absence of booze [7] mean anything? Perhaps I was expecting some kind of ordering when in reality you have told me that booze[i] is the "best" booze that "uses" i drunkeness?

    I note your proposed "fill algorithm" but I think you have simplified things enough that a no kidding optimization "maximize profit by consuming to X" would be feasible. I'm thinking xKiv may already have an LP solver in ash...

  6. #6
    Senior Member
    Join Date
    Apr 2009
    Posts
    1,813

    Default

    I'm thinking xKiv may already have an LP solver in ash...
    Originally Posted by fronobulax View Post
    That's not a LP problem. LP isn't very good with integer constraints, and integer programming is unnecessarily complicated for this.

    For this (known and unchanging value for each size, unlimited availability), the solution is something like
    Code:
    best_found_diet=[]; // dynamic array
    for (i=1; i<= organ_size; i++) {
      best_found_diet[i] = [ vcon_best_foods[i] ];
    }
    for (i=1; i<= organ_size; i++) {
      for (j=1; j<i; j++) {
        // how do you concatenate arrays in ASH, again?
        combined_diet = best_found_diet[j] + best_found_diet[i-j]; // try beating the single food item of size i by eating multiple smaller foods
        if (profit(combined_diet) > profit(best_found_diet[i])) {
          best_found_diet[i] = combined_diet;
        }
      }
    }
    which is, to my knowledge, essentially what houeland's diet calculator did (and now tehtmi's does). Possibly inverted ("starting from already known-to-be-optimal point, fill all larger diet sizes with any better found diets, using intiger multiples of best single consumables)
    (it's actually more complicated, because there are consumables that use both stomach and liver; you need to do something smarter with a map of all organ-fill-level combinations and iterating over increasing total organ usage, or something like that)

  7. #7
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,410

    Default

    How do you define profit when you calculate it? My guess is that you "buy" and consume one of an item costing X, it generates Y adventures so the profit is (Y * meat per adv) - X, but it would be nice to have confirmation.
    Originally Posted by fronobulax View Post
    That is correct. Y is the "average" adventure yield. "meat per adv" is either what VMF has calculated for your specific character, or is the valueOfAdventure setting.

    At what point, if any, will you consider profit calculations with other factors such as purchase discounts (Travoltan trousers, etc.), consumption enhancements such as Ode or the various ways to drink martinis, etc.?
    Well, since the assumption is that we buy from mall, rather than NPCs, I don't think there any applicable discounts - for any item that would be considered "best".
    Ode and milk are perfectly reasonable things to consider. Thanks for that suggestion. I'll add it to the TODO list.
    martinis and lasagnas and such seem complicated. I know that I've never taken advantage of them.

    I'm not quite sure what to do with the above information. Do I want as many perfect cosmopolitans as I can handle because that's the best profit per size?
    Yes, that is how I am using this info.

    Does the absence of booze [7] mean anything?
    It means that there are no size 7 boozes.

    Perhaps I was expecting some kind of ordering when in reality you have told me that booze[i] is the "best" booze that "uses" i drunkeness?
    That is correct. It is up to the caller to use the raw data. If the size 3 booze is the best yield, but you don't have 3 inebriety available, I'm not telling you to go drink the size 3 booze.

    I note your proposed "fill algorithm" but I think you have simplified things enough that a no kidding optimization "maximize profit by consuming to X" would be feasible. I'm thinking xKiv may already have an LP solver in ash...
    This is a library intended to help make such things possible. Suggestions that I take Ode and Milk into account are good, since those are things that I expect will be used every time. TT and AT barrel prayers are also possible - although you only get them for at most 10 size per day.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  8. #8
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,410

    Default

    Heh. Doing that with my main, who has the highest VoA, I no longer get the following:

    food[7] is penguin focaccia bread (214 cost per size) (11443 profit per size)
    food[15] is sheet cake (93 cost per size) (6642 profit per size)
    booze[8] is Bowl of Scorpions (56 cost per size) (2615 profit per size)
    booze[10] is bucket of wine (939 cost per size) (6054 profit per size)

    all of which are inferior to other options, anyway.

    bucket of wine might be a good nightcap, but for adventure yield to use today, you don't want it anyway.

  9. #9
    Senior Member
    Join Date
    Apr 2009
    Posts
    1,813

    Default

    Managed to double-post.
    The above is an example of dynamic programming, see https://en.wikipedia.org/wiki/Knapsa...ance_algorithm

  10. #10
    Developer
    Join Date
    Apr 2010
    Posts
    4,810

    Default

    With autoTuxedo and autoGarish the martini and lasagna stuff should already be calculated in.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •