Mafia internal value of chef/bartender usage?

El Bobbo

New member
I recently noticed that kolmafia (version 13.8) does the following, and am confused by its logic. If I type

> acquire knob stir-fry

It purchases a knob stir-fry from the mall at price 1100 meat.

However, I am fairly certain that it would be cheaper to create the knob stir-fry myself, using a chef-in-the-box. The ingredients are:
1 knob mushroom - 430
1 herbs - 64
1 spices - 130
2 chef uses

I estimate the cost of a chef use to be 62 meat (mall price 5500 / 90 uses per chef). Therefore, the total cost of making a knob stir-fry is only 748 meat.

I am wondering if there is maybe some setting that mafia uses for the value of using a chef (or bartender) that I may have set too high? I looked in both the global and character prefs files and couldn't find anything obvious, but I don't really know what I am looking for...

I also tried setting valueOfAdventure=50 and requireBoxServants=false, and it still continues to buy knob stir-fry, even after closing and restarting mafia. I found this really puzzling, as even if it places a large value on a chef, I would think it should have burned an adventure to cook with these settings.

Are my calculations crazy, or is mafia doing something strange here? Any help would be greatly appreciated.
 

jasonharper

Developer
The way to debug this would be to issue commands like:
historical_price chef-in-the-box
immediately after the questionable acquire command, to see the exact values that mafia based its decision on.

The value of a chef use is 1/90th of the chef price - there is no setting that affects this.

The valueOfAdventure and requireBoxServants settings aren't relevant if you actually have a chef installed in your campground..
 

El Bobbo

New member
Thanks very much for your reply. The behavior you described is what I had expected mafia would be doing, but it doesn't seem to be working properly for me. I get:

Code:
> historical_price knob mushroom

Returned: 410

> historical_price herbs

Returned: 64

> historical_price spices

Returned: 169

> historical_price chef-in-the-box

Returned: 6400
which puts the price to use a chef at 6400/90=71.1, bringing the total cost for cooking knob stir-fry to 785.2. However, when I ask mafia to acquire it:

Code:
> acquire knob stir-fry

Searching for "knob stir-fry"...
Purchasing Knob stir-fry (1 @ 1,100)...
You acquire an item: Knob stir-fry
Purchases complete.

I also checked that mafia has the right price for knob stir-fry:

Code:
> historical_price knob stir-fry

Returned: 1100

I feel like I must be missing something here, but I don't know what it is.
 

jasonharper

Developer
Seems to work for me:
Code:
> acquire knob stir-fry

Searching for "knob stir-fry"...
Searching for "knob mushroom"...
Searching for "secret blend of herbs and spices"...
Searching for "spices"...
Verifying ingredients for Knob stir-fry (1)...
Using cached search results for Knob mushroom...
Purchasing Knob mushroom (1 @ 400)...
You acquire an item: Knob mushroom
Purchases complete.
Verifying ingredients for secret blend of herbs and spices (1)...
Using cached search results for spices...
Purchasing spices (1 @ 165)...
You acquire an item: spices
Purchases complete.
Creating secret blend of herbs and spices (1)...
You acquire an item: secret blend of herbs and spices
Successfully created secret blend of herbs and spices (1)
Creating Knob stir-fry (1)...
You acquire an item: Knob stir-fry
Successfully created Knob stir-fry (1)
Does create knob stir-fry work? It looks like mafia isn't even considering the possibility of crafting the item, although I can't think of any likely reason for that - no special skills or equipment are needed in this case.
 

El Bobbo

New member
If it tell Mafia to create a knob stir-fry, I get
Code:
> create knob stir-fry

Verifying ingredients for Knob stir-fry (1)...
Searching for "knob mushroom"...
Purchasing Knob mushroom (1 @ 400)...
You acquire an item: Knob mushroom
Purchases complete.
Searching for "secret blend of herbs and spices"...
Purchasing secret blend of herbs and spices (1 @ 335)...
You acquire an item: secret blend of herbs and spices
Purchases complete.
Creating Knob stir-fry (1)...
You acquire an item: Knob stir-fry
Successfully created Knob stir-fry (1)
Which is still not quite right, as it should have created the secret blend of herbs and spices rather than buying it. To get it to behave properly, I need to do:
Code:
> create secret blend of herbs

Verifying ingredients for secret blend of herbs and spices (1)...
Purchasing herbs (1 @ 64)...
You acquire an item: herbs
You spent 64 Meat
Purchases complete.
Searching for "spices"...
Purchasing spices (1 @ 169)...
You acquire an item: spices
Purchases complete.
Creating secret blend of herbs and spices (1)...
You acquire an item: secret blend of herbs and spices
Successfully created secret blend of herbs and spices (1)

> create knob stir-fry

Verifying ingredients for Knob stir-fry (1)...
Searching for "knob mushroom"...
Purchasing Knob mushroom (1 @ 400)...
You acquire an item: Knob mushroom
Purchases complete.
Creating Knob stir-fry (1)...
You acquire an item: Knob stir-fry
Successfully created Knob stir-fry (1)
I thought that maybe something was wrong with my installation/preferences, so I downloaded daily build 8004 and moved my .kolmafia folder to another location, which I believe should cause it to create new preferences from defaults (I am running on Ubuntu linux 9.10, using Sun Java 6). Even after doing this, it still does the same thing. I also tried running from a different computer (Red Hat linux, did have an old version of my prefs on it), and still the same result. I will try running from a Windoze :)eek:) computer that has never seen any form of my prefs later.

Is it possible that somehow I disabled item creation as method for acquiring items in my mafia prefs, and that removing the .kolmafia folder from my home directory is not enough to fix this? Is there somewhere else it looks for preferences?
 

El Bobbo

New member
I installed Kolmafia 13.8 on a windows box which had never before had kolmafia installed (and therefore must be using the default kolmafia file), and got the same result. It is possible that there is some equivalent of autoSatisfyWithCloset such as autoSatisfyWith{ItemCreation} that is not set as true by default, and needs to be set for Kolmafia to properly consider item creation when it tries to acquire an item?
 

El Bobbo

New member
It seems to me that mafia may only consider item creation if you already have at least one component of the item you are trying to acquire. As the most helpful Jasonharper noted, he got acquire to create knob stir-fry as expected, but upon reading his output again I realized that he already had herbs. I therefore tried this:
Code:
> acquire herbs

Purchasing herbs (1 @ 64)...
You acquire an item: herbs
You spent 64 Meat
Purchases complete.
Transferring items to store...
Items offered up for sale.

> acquire knob stir-fry

Searching for "knob stir-fry"...
Searching for "knob mushroom"...
Searching for "secret blend of herbs and spices"...
Searching for "spices"...
Verifying ingredients for Knob stir-fry (1)...
Using cached search results for Knob mushroom...
Purchasing Knob mushroom (1 @ 410)...
You acquire an item: Knob mushroom
Purchases complete.
Verifying ingredients for secret blend of herbs and spices (1)...
Using cached search results for spices...
Purchasing spices (1 @ 100)...
You acquire an item: spices
Purchases complete.
Creating secret blend of herbs and spices (1)...
You acquire an item: secret blend of herbs and spices
Successfully created secret blend of herbs and spices (1)
Creating Knob stir-fry (1)...
You acquire an item: Knob stir-fry
Successfully created Knob stir-fry (1)

However, if I try to get another, it goes back to the usual:

Code:
> acquire 2 knob stir-fry

Using cached search results for Knob stir-fry...
Purchasing Knob stir-fry (1 @ 990)...
You acquire an item: Knob stir-fry
Purchases complete.

Is Mafia meant to only consider item creation if you already have at least one component of the item you are trying to acquire? Or is there a setting somewhere that one can change to alter this behavior?
 

lostcalpolydude

Developer
Staff member
I'm curious, if you start with only spices, will it buy the other components to cook the item? My previous thought is that mafia was avoiding buying herbs for you unless specifically told to. It is the only item from an NPC store...
 

El Bobbo

New member
Acquiring spices first instead of herbs seems to work as well. It happily buys the herbs from the NPC store, and creates everything else. This is a good thought though, as not everyone has access to the hippy store so it would be possible that Mafia would not realize that I have access. Thanks for the suggestion.

Code:
> acquire spices

Searching for "spices"...
Purchasing spices (1 @ 100)...
You acquire an item: spices
Purchases complete.

> acquire knob stir-fry

Verifying ingredients for Knob stir-fry (1)...
Searching for "knob mushroom"...
Purchasing Knob mushroom (1 @ 410)...
You acquire an item: Knob mushroom
Purchases complete.
Verifying ingredients for secret blend of herbs and spices (1)...
Purchasing herbs (1 @ 64)...
You acquire an item: herbs
You spent 64 Meat
Purchases complete.
Creating secret blend of herbs and spices (1)...
You acquire an item: secret blend of herbs and spices
Successfully created secret blend of herbs and spices (1)
Creating Knob stir-fry (1)...
You acquire an item: Knob stir-fry
Successfully created Knob stir-fry (1)
 

El Bobbo

New member
I found the following within the source code of /session/InventoryManager.java at line 530:
Code:
// If it's creatable, and you have at least one ingredient, see
// if you can make it via recursion.
Therefore I believe it is the desired behavior of mafia to only attempt to create items if you have at least one ingredient. I will try to see if I can see exactly where this is enforced in the code, but I am not sure if I know enough java to read through something as sophisticated as kolmafia.

I am not sure exactly why this is the desired behavior, but I assume that someone with much more knowledge of KOL than me had a good reason.

Thanks very much for the helpful replies.
 
Top