Bay 12 Games Forum

Dwarf Fortress => DF Gameplay Questions => Topic started by: andrei901 on October 10, 2018, 09:23:08 pm

Title: What is a "decent meal"?
Post by: andrei901 on October 10, 2018, 09:23:08 pm
Literally every single one of my dwarves has the "no decent meals in too long" negative stressor. I have hundreds of masterwork roasts and a legendary dining room. Do the meals have to coincide with the dwarf's preferences? Due to the nature of my current fort design, aboveground farming is...severely impractical.
Title: Re: What is a "decent meal"?
Post by: Shonai_Dweller on October 10, 2018, 09:58:24 pm
Yeah, it's one of the issues currently with the stress system (along with relationship building, inability to take breaks or see to ones needs properly during breaks and stacking body-part stress). The decent meals is far too exact. I enjoy monkey brains and no other part of a monkey will do. And don't get me started on how wrong gorilla is...
Title: Re: What is a "decent meal"?
Post by: anewaname on October 10, 2018, 10:42:49 pm
I buy up every bit of food from caravans in hopes of meeting a food preference.
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on October 11, 2018, 02:47:23 am
"Decent meal" ceased to refer to the quality of the meal when the current needs system was introduced, and instead refers to meals containing preferred ingredients (where the UI hides the important detail that it's actually only the brain that's of interest). I've seen indications that meal quality may come into play when the meal contains a favored ingredient, but I haven't had it confirmed.

Even if you manage to get hold of monkey brain, there's a significant risk some other bugger who can't get his favorite food will eat it rather than one of the bazillion plump helmets.
Title: Re: What is a "decent meal"?
Post by: feelotraveller on October 11, 2018, 05:41:27 am
This thread http://www.bay12forums.com/smf/index.php?topic=171322.0 (http://www.bay12forums.com/smf/index.php?topic=171322.0) should answer your questions (and explain why monkey brains are being talked about).  In short, decent meal thoughts arise when dwarfs eat foods that they have a preference for, quality of meals effects the strength of the thought and preferences for animal parts are not fully reported on the thought and preferences screen.
Title: Re: What is a "decent meal"?
Post by: mikekchar on October 11, 2018, 08:42:13 am
Yes, basically as long as a meal includes an ingredient (either favoured food *or* drink), then it will meet the criteria as "decent meal".  If the meal increases in quality, then the qualifier on the thought will change.  The highest is "legendary meal" I think -- I've probably had them all, but I can't remember what they all are (though "sublime" is in there somewhere).  I don't know what difference this qualifier has on stress levels, etc (if anything).

I've been able to satisfy most of my fortress for food preferences (somewhere around 80 percent, anyway).  The trick is to make sure to get drink into your meals because most drinks are easy to produce or acquire.  If you are in an acceptable biome, you can grow a lot of them and there are a lot less of them than the meat.

My general rule is: don't have any food in the fortress that a dwarf doesn't like.  Use the manager to make meals and make 1 every day if you have the ingredients (no more than that).  Put a stockpile of drink of 2 tiles right next to the kitchen and "take" from the main booze stockpile.  Don't have it too far away from the main stockpile.  This will ensure that there is exactly 1 barrel of booze next to the kitchen virtually at all times (and the timing of the making of the meals leaves time to haul a new barrel there).

When making meals dwarfs will semi-randomly select ingredients.  In reality, they will take the closest ingredient from where they are when they need the ingredient.  There is a *very* important rule.  If an ingredient came from a container (any container -- barrel, bag, pot), the dwarf will preferentially choose the next ingredient from the *same* container.  So the rule is: never store ingredients for the kitchen in a container (unfortunately some ingredients like seeds have no choice :-( -- avoid using them if possible).

Make a stockpile for the other ingredients a few tiles farther than the booze stockpile next to the kitchen, but closer than the main booze stockpile.  This means that when a dwarf selects an ingredient, they will pick something randomly (based on how close it is).  The second ingredient they choose will always be the booze because it is next to the kitchen (you can also put other liquids like milk next to the kitchen for the same effect).  After that because the booze is already gone, they will continue to select dry ingredients based on how close they are from the kitchen.

This will ensure that *every single meal* will contain booze (assuming that you don't make a mistake somewhere).  Booze is made from plants and for every plant in the stack you get 5 booze.  That means that usually you have 10-15 booze in your ingredient.  This lets you extend your monkey brains -- if you have 5 monkey brains and 15 rice wine, then you will have 20 monkey brains and rice wine biscuits.  I've been making only simple meals because I *think* it's more efficient -- because each meal will get a different booze extender, but I'm not really sure (I need to think of all of the corner cases).

Dwarfs eat anywhere from 6-10 times a year and will seek out meals that contain ingredients that they like.   In the example above, our monkey brains biscuits will satisfy dwarfs who like monkey brains *and* rice wine.  Assuming you only grew rice because one or more dwarfs like rice wine, then you can satisfy at least 2 dwarfs with these 20 meals.  If you keep enough variety in your fortress, then your 2 (or more) more dwarfs will have plenty of opportunity during the year to partake of those meals.  Even if they eat it only once, they will *still* get good thoughts from remembering eating a legendary meal.

One of the keys is to stagger the production throughout the year.  Cooking a maximum of 1 meal a day helps (which is why I suggest using the manager).  Also you should stagger your growing schedule.  There are 4 seasons.  You should stagger growing so that you grow a quarter of your booze producing veggies/fruit each season -- that way you ensure more variety when you are making meals.  Also, don't over grow!  You probably only need between 1-3 (and likely only 1 or 2) tiles per plant type.  You don't want to get in a situation where you have lots of stacks of a single plant and you end up making the same booze over and over again.  Similarly, when you buy ingredients, only buy as much as you need.  Probably 5 is enough, even if someone eats one or two before you have a chance to cook with it -- because each meal is being extended by the booze.  If you decide to buy a lot, then consider forbidding most of it so that you don't end up with 1000 monkey brains biscuits and only one dwarf that likes monkey brains.

I could go on, but hopefully that inspires people to experiment.  It really isn't so hard, but it requires some knowledge about how dwarfs work with stockpiles.  Also it *requires* that you don't put food for your kitchen in containers!  That bit is the most important, so don' forget :-)
Title: Re: What is a "decent meal"?
Post by: Fleeting Frames on October 11, 2018, 10:24:52 am
I considered mentioning that, but OP disbars aboveground farming.

Plus, I've got the impression that temperate-tropical boundary forts aren't highly selected for.
Title: Re: What is a "decent meal"?
Post by: andrei901 on October 11, 2018, 10:32:57 pm
Oof.

Okay. Guess I'm gonna have to figure out some aboveground farming after all, in a fortress where the distance between the surface and the military camp at the entrance to my fort is over 2000 tiles away...

Anyone know why all my dwarves are constantly "picking up equipment"? Are they changing their socks or something?
Title: Re: What is a "decent meal"?
Post by: anewaname on October 11, 2018, 11:33:55 pm
...Anyone know why all my dwarves are constantly "picking up equipment"? Are they changing their socks or something?
Any time there is a "better" item assigned to their current uniform (civilian uniform or military), they drop something and go to get the new item. So socks, and other stuff.
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on October 12, 2018, 03:10:15 am
And this "new equipment" ripples down the ranks, so if the top soldier replaces his weapon for a better one, his old weapon may be better than what the second dorf had, so the second dorf drops his weapon to pick up the first one's weapon. The third one suddenly finds a better weapon (dropped by the second one)... Thus, production of a single new item can potentially result in 10 replacements.
Title: Re: What is a "decent meal"?
Post by: andrei901 on October 12, 2018, 10:27:52 pm
And this "new equipment" ripples down the ranks, so if the top soldier replaces his weapon for a better one, his old weapon may be better than what the second dorf had, so the second dorf drops his weapon to pick up the first one's weapon. The third one suddenly finds a better weapon (dropped by the second one)... Thus, production of a single new item can potentially result in 10 replacements.

Ah. Yep, I'd just made three new ☼Steel Battle Axe☼ in the last batch. My squads were probably upgrading. At least 3-4 of them are still attached to some -copper battle axe- I threw together in the first year, though...
Title: Re: What is a "decent meal"?
Post by: em312s0n on October 28, 2018, 08:47:23 pm
I found a amazingly useful feature of dfhack just a few moments ago that actually helps a lot. press alt + a. while querying the workshop then indicate what materials to use.
Although with fish you can't specify which fish to cook but as far as I can tell that's the only one that you cant.
For fish search under globs and then choose the part of the fish or under meat then choose the kind of fish meat you want cooked

anways screenshots:

assorted stockpile looks like this:
(https://i.imgur.com/GupDcZI.jpg)

set preferences
(https://i.imgur.com/kDuLvfN.jpg)

and then...
(https://i.imgur.com/6T1LMHN.png)


Dfhack thread on how to use said feature as well as other useful things dfhack does
http://www.bay12forums.com/smf/index.php?topic=142622.0 (http://www.bay12forums.com/smf/index.php?topic=142622.0)


hope this helps somebody
Title: Re: What is a "decent meal"?
Post by: Wannabehero on October 30, 2018, 10:16:05 am
I found a amazingly useful feature of dfhack just a few moments ago...

Thank you for posting that em312s0n. Micromanagment of stockpiles to control ingredients is a very tedious way to try and cope with some of DF's quirks.
Title: Re: What is a "decent meal"?
Post by: em312s0n on October 30, 2018, 05:31:30 pm
Micromanagment of stockpiles to control ingredients is a very tedious way to try and cope with some of DF's quirks.

Agreed. You also may want to use this script by PatrikLundell that tells you what the preferences are of your dwarves in your fort


This DFHack Lua script lists them.

Spoiler (click to show/hide)
[/quote]
Here's a somewhat improved version that sorts the entries and removes duplicates (which resulted because the original script just added preferences as they were encountered, without checking of another dorf had the same one).
Spoiler (click to show/hide)

EDIT: Oh and if you see something that refers to "animal pancreatic tissue" or "animal stomach". It is refering to sweetbread and tripe respectively
Title: Re: What is a "decent meal"?
Post by: Saiko Kila on October 31, 2018, 03:31:19 am
Number of possible different roasts that carry only preferred food (or drink in 2nd, 3rd or 4th spot) in my fortress:
3661038000 (that's 3661 millions).


I think the best approach is to identify the biggest whiners, and try to make their preferred alcohol (or solid food, if more common) a part of the meal, and just forget the rest. And maybe nag Toady from time to time so he makes the "decent meal" requirements a bit more sensible.


Title: Re: What is a "decent meal"?
Post by: em312s0n on October 31, 2018, 03:47:17 am
Number of possible different roasts that carry only preferred food (or drink in 2nd, 3rd or 4th spot) in my fortress:
3661038000 (that's 3661 millions)

Woah! how many dwarves do you have! lol. I dont think it would get to that number I mean even if you have 240 dwarves(a ludricous amount IMO) with no dwarf preferring the same food as another you'd only need at least 60 varieties of roasts that everyone can choose from and be satisfied

EDIT: I keep checking my math if I'm wrong lol but yeah. 1 roast= 4 ingredients that can satisfy. 240 dwarves/ 4 = 60 varieties of roasts.
Title: Re: What is a "decent meal"?
Post by: Saiko Kila on October 31, 2018, 03:59:26 am
Yes, I don't need that many of course (and I have about 350 dwarves, fluctuating). It's the maximum of different combinations, where each of them would satisfy at least one dwarf (but almost always more). Problem is, that the best combination will not satisfy more than a handful of dwarves, so the minimum number is also big. How big exactly - I don't know, because it's much harder to calculate.
Title: Re: What is a "decent meal"?
Post by: em312s0n on October 31, 2018, 04:12:54 am
Well 350 dwarves(I have got to know your PC specs) assuming they don't have overlapping food preferences would require at least 350/4=87.5 round up to 88 varieties of roasts. at most well its easy 1 custom roast per dwarf = 350 varieties.

I do agree on the strategy of identifying whiner dwarves lets call em snowflakes lol. Having to work up the effort to maintain 88 varieties man that is tedious.
Title: Re: What is a "decent meal"?
Post by: Saiko Kila on October 31, 2018, 04:48:44 am
To me even working on more than 10 roasts would be overwhelming. What I tried is to create manually roasts with the most liked alcohols - but turned out that the most popular alcohol, and the one I have in sufficient quantity, is liked by 4 dwarves. It takes top spot ex aequo with several other alcohols, liked by 4 dwarves each, followed by a bunches of alcohols liked by 3 dwarves and so on. It's even worse with solid foods.

But there's also problems with availability - most of what they love to eat is simply not available, and never will be. Unless the trading overhaul will allow to order items from any biomes... Heck, I even live in a savage non-freezing biome, and don't have whip vine!
Title: Re: What is a "decent meal"?
Post by: mikekchar on October 31, 2018, 09:23:53 am
You can satisfy most of your dwarfs without *that* much effort (especially if you use Patrik Lundell's script).  The main trick is to ensure that you don't over produce foods (e.g. massive farms of plump helmets).  Having shortages of some foods means that you get variety automatically.  You can also potentially make several kitchens with different ingredients nearby to enforce some variety.  Also, you *must* avoid using containers in your kitchen stockpiles (or else you end up with the same ingredient in each slot).

There are a couple of issues that are unavoidable with the current system, though.  First, there is no way to satisfy all of your dwarfs.  I think this is a big problem because eventually some of them will start dwelling on it.  The other issue is that while it isn't actually a huge amount of effort to satisfy most of the dwarfs, it *is* a huge amount of effort to figure out how to set up a system to do it.  It also requires some players to fairly comprehensively change their play style.  Before, you could make a massive farm, set up a kitchen, make thousands of roasts and forget about it.  Now it's actually pretty tricky to set up the production line -- and while *I* find that fun, I can imagine that there are many others who don't.

I kind of wish we could separate discussions based on this kind of criteria: I want to find out how to do it OR I want to express my desire to avoid doing it.  Mixing the two makes discussions hard to navigate IMHO.
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on November 01, 2018, 01:05:45 pm
I've tried to attack the "decent meal" issue from a script angle, i.e. write a repeating script that orders the kitchens to make lavish meals that have 3 random components and 1 drink that's favored by at least one resident. Rather than trying to cram as many favored ingredients into each roast, I'm gunning for the booze cooking angle, for a number of reasons:
- There's a limited number of kinds of drinks
- My standard fortress design already aims at producing every kind of booze known to dwarf (but not any kind of milk...).
- It's tricky trying to optimize among several favored foods.

The ideal would be to optimize ingredients such that only a single ingredient is favored, and all the others are "meh" to everyone, as that would reduce the risk of "wasting" ingredients when the dorf who likes sewer brew grabs the only remaining roast that has lamprey eyelid eyelash dandruff in it, ignoring the 305 other roasts that has sewer brew in it, which Urist McPicky only likes lamprey eyelid eyelash dandruff to eat, and wants to drink water (I've had a dorf with water as favorite drink, and I've also had dorfs who have no favorite food at all), and don't have anything left he likes, so he randomly takes the only roast containing purring maggot brain stem in it (rare indeed, as I don't think purring maggots have brain stems).

However, that gets a bit messy, so my initial approach would be to just go for the booze and let everything else get thrown in as they may be (which doesn't guard against other kinds/more booze being added). A fully fledged solution ought to specify the complete set of ingredients to make sure things aren't wasted. The drinks approach has the advantage from a complexity point of view that each dorf seems to have exactly one favored drink, while it can be quite messy to try to figure out which combinations you should go for if trying to take all preferences into consideration, especially given that you can't control who takes what.

My initial script attempt seems to be working, but I've got a groundhog day fortress that crashes after 2-6 days, so any real testing is hard to do.
Title: Re: What is a "decent meal"?
Post by: LordPorkins on November 01, 2018, 01:10:14 pm
Roasted Plump helmet made from a sauce derivative from Elven Blood.

Oh your talking code. NVM.
Title: Re: What is a "decent meal"?
Post by: em312s0n on November 01, 2018, 02:17:08 pm
My initial script attempt seems to be working, but I've got a groundhog day fortress that crashes after 2-6 days, so any real testing is hard to do.

☼«☼Script☼»☼

This is a masterwork script by PatrikLundell. It is encircled with bands of masterful lua code. On the item is an Image of Patrik Lundell the dwarf in unicorn leather. Patrik Lundell is typing code. The artwork relates to the creation of a masterwork script on the DF Forums in the early winter of 2018

Title: Re: What is a "decent meal"?
Post by: PatrikLundell on November 02, 2018, 04:45:09 am
This is the booze_cooker script in its current state:
Spoiler (click to show/hide)

It can be noted that it does in fact cook non booze potable liquids (such as milk) as well, but I have no idea what it will do when water is called for. In my testing I ran the script on a 1 day repeat, while the posted version has a 7 day one. Also, I only have one kitchen, and I haven't been able to test it wrap around to start from the beginning.
Anyway, it might be useful in itself, or might be used as inspiration for others to develop further.
The script currently prints every roast order entered, which is probably useful initially to see what's happening, but annoying later on. Early in the script there's the definition of the 'verbose' variable, and changing "true" to "false" should turn off that output-
Title: Re: What is a "decent meal"?
Post by: em312s0n on November 02, 2018, 12:56:20 pm
I like how you just nonchallantly solved the problem. will be testing once I get home from work. Cheers
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on November 02, 2018, 05:16:09 pm
I like how you just nonchallantly solved the problem. will be testing once I get home from work. Cheers
It's something I've been thinking of for quite some time for starters, and it's far from a proper solution, but rather the beginning of a path towards one. Also, those who look at the script will see it's built around the earlier script for determining fortress food preferences (the printout of that is commented away), so it's not really something just whipped up from nothing.
Anyway, I hope it may be of some use.
Title: Re: What is a "decent meal"?
Post by: Saiko Kila on November 05, 2018, 05:29:30 am
You can satisfy most of your dwarfs without *that* much effort (especially if you use Patrik Lundell's script).  The main trick is to ensure that you don't over produce foods (e.g. massive farms of plump helmets).  Having shortages of some foods means that you get variety automatically.  You can also potentially make several kitchens with different ingredients nearby to enforce some variety.  Also, you *must* avoid using containers in your kitchen stockpiles (or else you end up with the same ingredient in each slot).

I can't agree, unfortunately, after examining my dwarves. Note that Patrik's script takes only full citizens into account. When I modified it to count every guy from the Citizen tab (i.e. both citizens and long-term residents), I've got these numbers:
All citizens and long-term residents: 358
 Different Drinks: 101
 Different Foods: 347

It's simply not possible to meet needs of most of my dwarves, even if I try to make only meals with drinks. The variability is too high, almost everyone needs something different, and the number of unobtainable drinks (not to mention foods) is higher than number of obtainable ones, by wide margin. It's rare than dwarves need more than three things, usually they need 1, 2 or 3 things.

Some examples of unobtainable drinks (or liquids, since honey or moghopper juice don't really count as alcohols) in my population:
whip vine (biome doesn't contain despite being savage, not obtainable otherwise, I've got a guy who likes only this, no other food or drink, and total of six dwarves need it as alcohol)
bumblebee honey (not obtainable)
bumblebee mead (source ingredient not obtainable, I've got four guys who drink only this, and eat something not obtainable)
mead (can't use as food ingredient, I've got THREE guys who like only this, no other food or drink, and two guys who like mead and some unobtainable food)
rice beer (can't make rice beer from rice, and it's not plantable)
moghopper juice (can't find moghoppers, I've got a guy who likes both this and gutter cruor)
gutter cruor (evil savage biome only; aka sliver barb alcohol, one of my starting dwarves needs it)
sunshine (good biome only I think; aka sun berry alcohol, never seen it, I've got a guy who likes only this, no other food or drink)
tuber beer (only marshy biome, no merchants from such biome, two of my starting dwarves need it, very popular for some reason)

It's still better than the solid stuff, where statistical dwarf likes something like worm gut, i.e. part of vermin which is not obtainable. In case of plants though most alcohol-source plants are simply not brought by merchants, or not seen in my biome.

Rice beer and mead seem to be quite popular in my population, I don't know why mead can't be made into meals, or why rice can't be planted (it is both [DRY] and [WET]), but it prevents use of it as food even though I do have mead and I do have rice seeds, so it's a good example of problems the overseer has to face.
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on November 05, 2018, 08:29:47 am
I haven't had problems with making rice wine. It's made from Rice Plants, while the seeds are called only Rice (and can't be brewed), according to the UI in my fortress (I don't have any Rice Wine at the moment, though, but Rice Plant is marked by the UI as Brewable, and I've had a fortress where I did at least once have every kind of booze on the wiki it the same time). Rice is ANY_TROPICAL according to the wiki. Banana beer can only be produced from elven imports because of a bug that causes "trees" that don't produce wood to never appear in an embark even if it should. Hacking Banana to produce wood allows it to appear in suitable embarks, though.

Mead can be used for cooking, but the DFHack interface for it doesn't support it, possibly because it's produced from honey via a reaction rather than through normal brewing of a plant. I believe my script can use mead, though, although I haven't been able to verify it. I haven't tried to set up a use of it the "normal" way (that's mikekchar's domain...).

A problem is that elves bring only fruit, which means they leave out berries (such a Sun Berries, should they have access to Good biomes). Since I embark in a good savage embark (with a slice of evil for Gutter Cruor and Glumprong) I typically don't have any problem with this one.

I've considered whether there's a need/use for a script that would replace specific food preferences with the generic animal one (i.e. cow, rather than cow heart) matching what the UI displays, and a vermin one with a randomly selected real creature, and possibly add a random food preference if the number of food preferences is zero.
Title: Re: What is a "decent meal"?
Post by: mikekchar on November 05, 2018, 09:05:30 am
I have to admit that I've never run a fortress with more than about 120 dwarfs.  I think the needs system in general would make it impossible to satisfy 350 dwarfs in just about anything.  However, there are special challenges for a large fortress like that.

When I look at my dwarfs, about 80% of them have either a food *or* a drink that is obtainable.  20% have all foods/drinks that are unobtainable.  The order screen from the dwarf caravan is crucial -- you have to order ahead of time to ensure that you get as much as you can.  And then for fruits, you have to trade with the elves.  Living in a biome that grows many plants is helpful too.   You should also try to get as much livestock as possible for making various cheeses -- again, for some animals order from the dwarfs and for others get what you can from the elves.  You can even grow livestock for meat and catch whatever fish you can get in your biome.
 Finally get various things from the humans.

With a smaller fortress the above is manageable (even without scripts) because it's all about setup.  You start with 7 dwarfs and you make sure that you have access to as much food as possible for them.  Then as you get migrants, you have to keep improving your setup.  It takes hours (like everything in DF), but once you have it set up, there isn't that much you need to do.  However, with 350 dwarfs (especially if you are just starting to set it up now), then you are in for a world of hurt.   I even limit my migrants to 10 or so per year so I have time to set up everything for their needs.

The other problem with a really large fortress is that you are probably going to want multiple kitchens, multiple farms, multiple breweries, etc, etc.  It's going to cover a large area.  I think there is considerable possibility that even if you make all the food you need, you won't easily be able to store your food in a small enough area that the dwarfs will search for the food they want.  Or if you do, it won't be possible to get the distribution to the kitchens right so that you can hack the production methods.

So I can definitely see that for your fortress it's probably going to be very difficult or impossible to fulfil their food needs.  That doesn't mean it's impossible to satisfy the majority of food needs in general, though.
Title: Re: What is a "decent meal"?
Post by: Sylverone on November 05, 2018, 09:22:25 am
Okay raiding parties need to be able to start raiding NATURE for these missing ingredients. Problem half-solved then. It would also be neat if someday distant you could make requests to foreign companies who would send parties to gather things and then trade them to you. Not that this is the suggestions forum, just thinking aloud.
Title: Re: What is a "decent meal"?
Post by: Fleeting Frames on November 05, 2018, 12:13:11 pm
Nature raiding is neat idea. For now, you can use adventurers and retired fort immigrants carrying what they were hauling when fortress was retired.
Title: Re: What is a "decent meal"?
Post by: Saiko Kila on November 09, 2018, 07:49:41 am
I haven't had problems with making rice wine. It's made from Rice Plants, while the seeds are called only Rice (and can't be brewed), according to the UI in my fortress (I don't have any Rice Wine at the moment, though, but Rice Plant is marked by the UI as Brewable, and I've had a fortress where I did at least once have every kind of booze on the wiki it the same time). Rice is ANY_TROPICAL according to the wiki.

I mentioned biome of rice, because I thought it could be the reason I can't plant it. But I don't know why I can't plant it. Rice doesn't appear in my list of plants in the farm plot, even though plants like sliver barbs or sun berries appear. Rice bought from merchants can't be milled, can't be brewed, and can't be planted (maybe its GMO). This particular world was created in v0.44.10, maybe there was or is a bug of some kind, though the RAWs for rice seem to be identical between v0.44.10 and v0.44.12.

Quote
Banana beer can only be produced from elven imports because of a bug that causes "trees" that don't produce wood to never appear in an embark even if it should. Hacking Banana to produce wood allows it to appear in suitable embarks, though.

But what if you elves don't bring bananas? You looking for another embark?

Quote
Mead can be used for cooking, but the DFHack interface for it doesn't support it, possibly because it's produced from honey via a reaction rather than through normal brewing of a plant. I believe my script can use mead, though, although I haven't been able to verify it. I haven't tried to set up a use of it the "normal" way (that's mikekchar's domain...).

I'm a "micromanager", so manually setting input is enough for me. Maybe it would be hard if I had access to all alcohol related plants, but as it happens, I have only about 15 alcohol types on average, and peak at 20. So my way is to use ALT+S to set the input in the kitchen job, then chosen alcohol in the fourth slot (which will give name to the roast), another plentiful alcohol in the third slot (for quantity), and optionally other plentiful items in the second or first slots (tallow, meat from a giant animal, quarry bushes). This way I often gets stack of 50-80 roasts containing and named after a single alcohol. It would be a fraud in real life (like liquor chocolates which contain only 1% of liquor), but dwarves like that.

The underlying problem is lack of access to the ingredients, i.e. alcohols or their components.

Quote
A problem is that elves bring only fruit, which means they leave out berries (such a Sun Berries, should they have access to Good biomes). Since I embark in a good savage embark (with a slice of evil for Gutter Cruor and Glumprong) I typically don't have any problem with this one.

Well, my dwarves want 78 alcohols. The game contains 77 of them, the missing one is bumblebee mead. But a single alcohol is wanted by maximum of ten dwarves, and a minimum of one. (the only one wanted by ten is turnip wine, I suppose they are more like gnomes than dwarves). Since I have at most 20 of them, and only rarely, I won't be able to fulfil their needs this way.

I think that your goal to have every alcohol is very ambitious, but it's somehow which is hardly possible without careful selection of embark place (to get many different biomes), luck and some modding. There seems to be a limit of species of plants available. For example I would expect whip vine in a savage biome, but I get it about half the time.

It's most impressive if you are able to achieve production of all required alcohols.

Quote
I've considered whether there's a need/use for a script that would replace specific food preferences with the generic animal one (i.e. cow, rather than cow heart) matching what the UI displays, and a vermin one with a randomly selected real creature, and possibly add a random food preference if the number of food preferences is zero.

Is it possible to have preference for animal and not for a part of it at all?

I've got only one dwarf with no food/drink (or any other) preferences. It is a hillock dwarf, the first one obtained from hillocks. All other 357 dwarves have one alcohol preference, and sometimes other food preferences, but not alcohol. So the only dwarf without preferences is certainly a bug, and normally all creatures have one alcohol preference, and random number of other food/non-alcohol drinks preferences, if any.

If I were making script adding preferences, I would maybe omit dwarves who do not have need to eat decent meal, and would certainly not add impossible meals (which could be tricky, maybe choose from something which already is in the fortress instead of total randomness?). The one dwarf with no preferences I got does have such a need, and it can never be fulfilled of course, but still is happy enough.

I have to admit that I've never run a fortress with more than about 120 dwarfs.  I think the needs system in general would make it impossible to satisfy 350 dwarfs in just about anything.  However, there are special challenges for a large fortress like that.

When I look at my dwarfs, about 80% of them have either a food *or* a drink that is obtainable.  20% have all foods/drinks that are unobtainable.  The order screen from the dwarf caravan is crucial -- you have to order ahead of time to ensure that you get as much as you can.  And then for fruits, you have to trade with the elves.  Living in a biome that grows many plants is helpful too.   You should also try to get as much livestock as possible for making various cheeses -- again, for some animals order from the dwarfs and for others get what you can from the elves.  You can even grow livestock for meat and catch whatever fish you can get in your biome.
 Finally get various things from the humans.

I think that here is where the luck strikes first - if you had such poor elves as mine, you would curse their race. There's also issue with ordering - I tend to become mountainhome quite quickly. But probably most important is that 10 dwarves can like something unobtainable, while 1 can like your main export wine...

Quote
With a smaller fortress the above is manageable (even without scripts) because it's all about setup.  You start with 7 dwarfs and you make sure that you have access to as much food as possible for them.  Then as you get migrants, you have to keep improving your setup.  It takes hours (like everything in DF), but once you have it set up, there isn't that much you need to do.  However, with 350 dwarfs (especially if you are just starting to set it up now), then you are in for a world of hurt.   I even limit my migrants to 10 or so per year so I have time to set up everything for their needs.

I agree that script is not needed in smaller fort, if you care about some micromanaging (as I do), but my point is also that you need some luck in addition to work. I have nothing against more work with setup personally.

Quote
The other problem with a really large fortress is that you are probably going to want multiple kitchens, multiple farms, multiple breweries, etc, etc.  It's going to cover a large area.  I think there is considerable possibility that even if you make all the food you need, you won't easily be able to store your food in a small enough area that the dwarfs will search for the food they want.  Or if you do, it won't be possible to get the distribution to the kitchens right so that you can hack the production methods.

One kitchen is enough for this number of dwarves (I have two kitchens, but they often are unoccupied, and roasts are what buys me iron and steel). As for still, I had to make a fourth one after including alcohols in meals, though two working full time and one part-time are generally enough for drinks if I don't care about their type too much. For storage I use quantum stockpiles.

Farming would be harder if I had access to more seeds, but for general food and alcohol production 10 farms 7 tiles each seem sufficient. I added 5 more for rare alcohols. Don't have more seeds. I also have gathering zones (mostly for fruit), it also fulfils need for wander.

Quote
So I can definitely see that for your fortress it's probably going to be very difficult or impossible to fulfil their food needs.  That doesn't mean it's impossible to satisfy the majority of food needs in general, though.

I made some statistics with my population, and it seems that:
~19% of dwarves have access to their favourite alcohol (including these made from entirely imported ingredients)
~10% of dwarves do not have a need to eat decent meals (they still have good thought after eating it)
~10% of dwarves do not have a need to drink alcohol (they still have good thought after drinking)
One alcohol is favoured by 1-10 dwarves, with 4.5 being avarage (this is for 350+ dwarves).

All except one of not needing decent meals also don't need alcohol, officially. One doesn't have to drink, but has to eat.

I have bad luck with alcohols needed, because the most produced are below the average request level, except dwarven rum and alcohol from potato. But for instance this potato alcohol (I named it vodka) is as much favoured as mead, which is more hard to obtain in large number (there are dwarves who love honey).

There are 78 possible needs in regard to alcohol, with one impossible to make (bumblebee mead), and several rather restricted. Some of these restrictions are from bugs, when it's impossible to culture needed plants, some are bad luck (merchant's and own biomes), and some are by design (limited number of plants in a biome).

I buy almost every plant, and most foods, except those I make on site. I admit that my elves are the worst possible, with very poor choice of both plants and animals (they like to bring domesticated animals like llamas or duck instead of cool stuff, and crappy plants), but merchants of humans and dwarves seem standard. So from these numbers I'd say that is impossible to fulfil needs of most, unless lucky (if they  like dwarven ale all, or something other easy to acquire), though probably bigger fort makes this harder.
Title: Re: What is a "decent meal"?
Post by: scourge728 on November 09, 2018, 11:27:49 am
If bumblebee mead doesn't actually exist but is still a preference, then that should probably be added to bug tracker if it isn't already
Title: Re: What is a "decent meal"?
Post by: Saiko Kila on November 09, 2018, 12:36:56 pm
If bumblebee mead doesn't actually exist but is still a preference, then that should probably be added to bug tracker if it isn't already

It was added multiple times years ago (in 2011 mostly), and for certain reason all these are marked as resolved. Bumblebee mead cannot be made because you can't use them in artificial hive (no tag). Which is supposedly intentional. And being intentional it was marked as resolved...

Here is one of these bug with Toady's explanation:
http://www.bay12games.com/dwarves/mantisbt/view.php?id=4003
I won't say that I understand this rationale.

One solution is to just remove mead and other materials (honey, jelly) from bumblebee RAW, but this is still modding.
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on November 09, 2018, 02:40:34 pm
@Saiko Kila:

Bumblebee mead: If I understand the rationale correctly, it was that it doesn't matter that the mead making reaction doesn't work for bumblebee honey as you can't get bumblebee honey to fuel that reaction. If so, it has no relation to food preferences for bumblebee mead (or honey, for that matter). In food preferences case it's really a matter of preferences for things that don't exist (which includes vermin body parts), and I don't know if you can actually make Dwarven milk (I've never seen a purring maggot anywhere).
A somewhat related, but less important, issue is that you can obtain impossible leather from the dwarven caravan (I very much doubt you can make cave fish leather in a fortress, but you can usually order if from the mountainhome).

Rice: Have you checked that you haven't got a multi biome embark and that your farm plots happen to be in the wrong one (if you use DFHack http://www.bay12forums.com/smf/index.php?topic=160856.msg7194572#msg7194572 (http://www.bay12forums.com/smf/index.php?topic=160856.msg7194572#msg7194572) could be used to find out)?

Manual cooking interface: Well, Australian Meat Pies are required to contain at least 2, or possibly 5% (I don't quite remember) meat...
Another thing the DFHack interface can't set up is specific kinds of eggs (you can specify egg, but not the species), but it's possible to do it if you access the kitchen directly with a script or gui/gm-editor. All that's needed is to set the mat_index to the correct animal (my first attempt resulted in creepy crawler eggs, rather than peafowl eggs, but when corrected, the first ingredient fetched (the one I hacked to see if it would work as a solid) was peafowl eggs.

Bananas: I hack bananas to yield wood and I hack all surface biomes to contain all eligible plants and animals... This means it's only a matter of time before they show up in my embark (which is carefully created [and hacked] to contain 9 biomes, although only 6 is needed to get all boozable plants).

Animal preferences: Yes, if you look carefully (and use a script to see any difference at all, of course), you ought to have a fair number of cases where only the animal is listed. It's certainly the case with fish. Replacing the mattype with -1 results in the animal in general, rather than a specific part. If scripting around bugged preferences I guess you could always add booze from one of the underground crops, as that should always be available as an easy setting, with a correction setting just replacing impossible choices with possible ones, without regards for how hard they are to fulfill. Taking what's available (beyond the defaults) into consideration would require you to determine what you mean by "available": is it "might be present in one of the biomes of the embark", "stuff that currently grows on the embark", "stuff that happen to be in the inventory at the moment", or something else (and note that I haven't even mentioned animals, but you could consider current livestock, as well as potentially migrating animals [including and/or excluding ones that can be hunted but not domesticated]).
Title: Re: What is a "decent meal"?
Post by: Miles_Umbrae on November 09, 2018, 06:01:05 pm
*Trying to imagine how a dorf would manage to acquire a taste for something like Bumblebee-brains or other such practically "impossible" ingredients*
Title: Re: What is a "decent meal"?
Post by: Fleeting Frames on November 10, 2018, 04:52:44 pm
Problem with picking from stuff dwarf has eaten is that it'll probably be most common stuff, thus making that preference both common among such dwarves and easy to fulfil. I don't think that's intended..."Rare but theoretically possible" seems about right, so something which can grow/appear but fortress doesn't currently own?

Small correction for booze, only 5, not 6 biomes - Tropical Dry Broadleaf, Tropical Savanna, Tropical Grassland, Temperate Grassland, and any wetland (and the wetland and one tropical plain could be done with just seeds from trade w/o soil, provided there's suitable air biome.)
Title: Re: What is a "decent meal"?
Post by: OmahaMH on November 12, 2018, 10:08:02 am
So reading this thread makes me sad.  It seems that having my cook work hard to make meals from the sundry meat products produced by my livestock industry and the various food that I import is not actually making my dwarves happy and may actually be contributing to their bottomless depression.
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on November 12, 2018, 11:58:35 am
@Fleeting Frames: I stand corrected. I use 6 biomes for farm plots, but the desert one is definitely not required.

So reading this thread makes me sad.  It seems that having my cook work hard to make meals from the sundry meat products produced by my livestock industry and the various food that I import is not actually making my dwarves happy and may actually be contributing to their bottomless depression.
Making lavish meals definitely does not contribute to depression, but it might be fairly ineffective in negating it, but it might have a small effect in that the limited amount of desired stuff you do have gets multiplied by about 4 if you make lavish meals (as those take 4 ingredients, although all of them can be the same, and you can also end up with both of the only desired ingredients in the same one).
Title: Re: What is a "decent meal"?
Post by: OmahaMH on November 12, 2018, 12:51:47 pm
Is a cooked meal, even with 4 ingredients, is still one "food unit" that a dwarf will eat fully in a single serving, and mood impact aside, doesn't leave him fuller (i.e. needs to come back to eat sooner) than just eating one raw plumper, right?
Title: Re: What is a "decent meal"?
Post by: feelotraveller on November 12, 2018, 05:00:48 pm
That's right.  However you get cooked meals equal to the stack sizes of all ingredients added together.  (So if your ingredients are plump helmet, plump helmet, plump helmet, plump helmet you will have will have 4 x plump helmet roast, so it still feeds 4 dwarfs...)

Don't have the expectation that you can satisfy the food desires of all your dwarfs all the time and you are golden.  There are many levers to pull and this is just one of them.
Title: Re: What is a "decent meal"?
Post by: Saiko Kila on November 13, 2018, 02:22:15 pm
Rice: Have you checked that you haven't got a multi biome embark and that your farm plots happen to be in the wrong one (if you use DFHack http://www.bay12forums.com/smf/index.php?topic=160856.msg7194572#msg7194572 (http://www.bay12forums.com/smf/index.php?topic=160856.msg7194572#msg7194572) could be used to find out)?

I used your script to check it out - turns out I don't have any tropical biome. So no rice for me, as well as no many other plants. I was hoping there's no more need for specific biome when I saw plants from evil/good alignments, and plants from tropical biomes (in real life) in the planting menu, but then I realised that the alignment isn't considered when biome checks are made, and that some tropical plants are not tropical in DF (and vice versa, like flax or maize).

Quote
Manual cooking interface: Well, Australian Meat Pies are required to contain at least 2, or possibly 5% (I don't quite remember) meat...
And they are still named "meat"? I suppose I know what business the writer of these laws was involved in...

Quote
Another thing the DFHack interface can't set up is specific kinds of eggs (you can specify egg, but not the species), but it's possible to do it if you access the kitchen directly with a script or gui/gm-editor. All that's needed is to set the mat_index to the correct animal (my first attempt resulted in creepy crawler eggs, rather than peafowl eggs, but when corrected, the first ingredient fetched (the one I hacked to see if it would work as a solid) was peafowl eggs.

For things like eggs I prefer that dwarves eat it themselves. Assuming they can, I don't have any dwarves with needs for eggs. One dwarf wants "feather tree yolk", that's closest to the egg they need.

Actually, I've checked for needs for some common farm animals I have (like pigs, horses, chickens, turkeys or cows), and to my surprise no one seems to need any of these animals or their parts as food - except milk or cheese. And only guy likes to eat dogs (a spleen to be exact).

For comparison I have at least four guys each who love anchovies, moghoppers, herrings, hakes, seahorses, sailfin mollies, mackerels or soles. I haven't checked all, but it seems that water vermin is handled as whole creatures (as it should be), but land vermin (like moghoppers here) are treated as source of meat, and very specific part of them is needed (like "moghopper stomach tissue"). Also surprisingly large number of people like parts of giant animals, 65 dwarves like 65 different parts of giant animals... (I didn't even know that giant ticks have gizzards, I think they are needed to crush giant erythrocytes.)

Quote
Bananas: I hack bananas to yield wood and I hack all surface biomes to contain all eligible plants and animals... This means it's only a matter of time before they show up in my embark (which is carefully created [and hacked] to contain 9 biomes, although only 6 is needed to get all boozable plants).

All plants including trees?

Quote
Animal preferences: Yes, if you look carefully (and use a script to see any difference at all, of course), you ought to have a fair number of cases where only the animal is listed. It's certainly the case with fish.

Yeah, that's the one I noticed. I was curious what part of fish they want, but no-one wanted anything specific. Which makes this particular need quite easy if the caravans are coming.

Quote
Replacing the mattype with -1 results in the animal in general, rather than a specific part. If scripting around bugged preferences I guess you could always add booze from one of the underground crops, as that should always be available as an easy setting, with a correction setting just replacing impossible choices with possible ones, without regards for how hard they are to fulfill. Taking what's available (beyond the defaults) into consideration would require you to determine what you mean by "available": is it "might be present in one of the biomes of the embark", "stuff that currently grows on the embark", "stuff that happen to be in the inventory at the moment", or something else (and note that I haven't even mentioned animals, but you could consider current livestock, as well as potentially migrating animals [including and/or excluding ones that can be hunted but not domesticated]).

I suppose that counting both inventory and history of eating (which is no help in case of roasts) should be enough to have a great variability. I would also add animals and plants present, animals from home civ, though it would probably be needed to account for their edible status (like sapients who are not edible, or magma critters). But this would be based on my fort, where there are lots of food (just not the one needed). Maybe this list would be too short in a fresh embark with seven dorfs. In any way, testing would be required if it isn't worse.

Problem with picking from stuff dwarf has eaten is that it'll probably be most common stuff, thus making that preference both common among such dwarves and easy to fulfil. I don't think that's intended..."Rare but theoretically possible" seems about right, so something which can grow/appear but fortress doesn't currently own?

Isn't it the point to be easy to fulfil? The current requirements are not hard, they are impossible without hacking...

Quote
Small correction for booze, only 5, not 6 biomes - Tropical Dry Broadleaf, Tropical Savanna, Tropical Grassland, Temperate Grassland, and any wetland (and the wetland and one tropical plain could be done with just seeds from trade w/o soil, provided there's suitable air biome.)

...as seen in this example. How often one embarks naturally in place with five or six so different biomes? Or any six biomes, for that matter. I could hardly find such place in my world.

Still, anything which could be brought by merchants (which may be hard to find or not, I'm not sure yet), plus growing or potentially showing up locally, plus domesticated plants/animals of your own civ should be variable enough. And of course, no specific parts, at least till the DF interface won't start showing them. As for alcohols, if the source plants can be brought and planted, but this may be tricky.

Maybe two modes of actions (easy and sure, and adventurous and uncertain) would be needed to fulfil needs of all gamers.
Title: Re: What is a "decent meal"?
Post by: Starver on November 13, 2018, 03:02:47 pm
Problem with picking from stuff dwarf has eaten is that it'll probably be most common stuff, thus making that preference both common among such dwarves and easy to fulfil. I don't think that's intended..."Rare but theoretically possible" seems about right, so something which can grow/appear but fortress doesn't currently own?
I was thinking perhaps of a straw poll of 'product' available to the site biome (including quantities available from traders via whatever algorithm it is that populates a Caravan carry-on, perhaps sum a few iterations to get a representative distribution), rendering live trade animals down to their butcherable components, and then choose from between the 1st and 2nd percentile* of frequency to be 'challenging' or below the 1st percentile (but without zero-count products anywhere in that count) to be 'annoying'.

The same could happen with other preferences (rock-types seen in a geological 'survey' of the site, plus likely caravanised ones, similar processes for other materials, and goods) so that there's justification for a dwarf having experienced the thing they have arrived with a preference for, above all other things experienced.

(Newborns might be best to develop from a blank slate, maybe spawning preferences over time, or else epigenetically/uterine-environmentally 'picking up' the morphic resonance of practical choices during gestation. Maybe sample, in the case of foods, the mother's diet (possible diet? - maybe over-iterated of all possible choices that can be deconstructed, rather than strictly just the actual intake) and use that to generate their postpartum ingrained preferences. This would mean that if you over-supply cow-brain meals to a cow-brain-obsessed mother, because you're particularly good at getting cow-brains, this food-type sits well above the range which for the developing child is 'not common' and forces you to deal with another (practical but not so over-provisioned) preference in its stead.)


Or I'm sure there's other ways, but that's one direction to mull over.


* Or equivalent method, like straight ranking and rejecting all items above the median, then all items below the median of this new list?
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on November 14, 2018, 04:23:45 am
@Saiko Kila:

I think I've seen a DF natural (i.e. not hacked) 3*3 embark with 6 biomes once, and ones with 5 biomes a small number of times. They're very rare, though.

Savage/evil/good plants: As far as I know, all the ones you can grow on farm plots lack a requirement for that particular environment, as well as any biome ties at all, which means that as long as you can get the seeds, you can plant them in any biome that supports farming. However, I've never seen humies bring Sliver Barb, and I don't think I've seen them bring Sun Berries either.

I don't think I've ever seen anyone have a preference for eggs, but I've been able to hack such a preference in (without seeing if it actually took effect).

Eggs, fish, and raw fish all lack the kind of internal structure (other) animals and plant have, so they can only be preferred as the whole items. Eggs are particular in that the actually have a different internal structure in the form of shell, white, and yolk.
It can also be noted that Feather Tree Eggs are bugged and cannot be acquired, but eleven caravans litter the trade depot with Feather Tree Egg Yolk (which cannot be picked up and used).

My biome hacking includes trees, yes. For some reason it tends to take a few years for saplings of most temperate fruit trees to appear, but since they only take 3 years to mature, it's not a big deal.

Ideally, migrant (and petitioner) preferences ought to be based on their background, which means it ought to be based on what was available in the places they've lived (which ought to include what's available via trade). I agree preferences ought to develop over time, with newborn being blank slates, but if so, the process ought to be capable of blocking stuff exposed to (i.e. I've only ever eaten Plump Helmet, and I don't like it and will never do so. Please let me try other things! Hm, Cave Wheat. Novel, but no, I won't grow attached to that either). However, currently newborn are fully formed with preferences, views, personality traits, etc.

Edit: Looking more into preferences, I see no whole creature preferences in my fortress, except for vermin (moghopper) and vermin fish, while there is a preference for Pike Kidney Tissue (and looking at the raws for Pike shows it's a creature, not vermin).
I've also found that mead isn't actually booze cookable.

Edit 2: Is it known what the size limits for butchering and slaughtering are, and if there's more than just bones that won't appear if the creature is too small to yield anything but skull and meat? I'm fairly sure a Magpie is too small to be butchered (to satisfy a need for Magpie Gut), but would a Buzzard (which appears to be a borderline species that sometimes yields just a skull and meat, and sometimes a more complete result) produce a Gut part in either or both cases?

Edit 3: I've found that the "[NOT_BUTCHERABLE]" token from the raws can be accessed from the creature raw to determine if a creature is labelled as butcherable (which showed that the Magpie in Edit 2 is marked as [NON_BUTCHERABLE]).

A marginally updated food_needs script that flags the impossible items I know of as impossible (butcher products from creatures that can't be butchered, bumblebee honey/mead, feather tree egg parts).
Spoiler (click to show/hide)
Title: Re: What is a "decent meal"?
Post by: therahedwig on November 14, 2018, 10:48:03 am
Here's the butcher-results science thread (http://www.bay12forums.com/smf/index.php?topic=78108.0).

As for things like sun berries and sliver barb, afaik, those have been known not to appear in trade, as good/evil aligned biome features are supossed to be a sort of, er, reward for hanging out in those biomes to begin with. (I wonder if that is going to survive the myth worldgen changes, because I am pretty sure good/evil won't.)

I am also wondering whether the bug isn't 'dwarves don't consider cooked meals decent anymore' rather than 'dwarves' favourite food is too specific'. I mean, it makes more sense that dwarves would prefer cooked meals, but will have that need satisfied, but will also satisfy it with their favourite ingredient even if raw, than having it only be satisfied with their favourite ingredient...
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on November 14, 2018, 02:14:31 pm
Thanks for that thread reference, therahedwig, it looks like it contains exactly what I was looking for (and in more detail than I realized I needed)!

I suspect Sun Berries/Sliver barb may be available in trade if conditions are exactly right. If I understand it correctly, the resources available to a civ depends on what's available to the starting site of the civ, and I think those resources are drawn from a rectangle around the site, rather than from a single world tile (and sites tend to be larger than a single world tile and/or straddle world tiles anyway).
When it comes to the revamped system, I'd expect similar effects to the current ones to appear, with some spheres (and their corresponding resources) being too hostile to some or all species you trade with. As your own species can be more or less random (as can the others), what you can have access to in a specific world may probably vary considerably from what's available in another even within the same weirdness/magic level, with mundane worlds being rather mundane and samey in comparison.

Edit: Updated "food_needs" to flag preferences for unobtainable butcher products based on Urist Da Vinci's research:
Spoiler (click to show/hide)

Edit 2: Updated the script above again to flag unavailable items, i.e. items based on plants and creatures that do not exist in the world because they haven't been selected by DF to appear in any region (and aren't common domestic, as some of those don't exist in the wild), possibly because no region has a suitable biome.
Title: Re: What is a "decent meal"?
Post by: Saiko Kila on November 16, 2018, 08:36:17 am
Eggs, fish, and raw fish all lack the kind of internal structure (other) animals and plant have, so they can only be preferred as the whole items. Eggs are particular in that the actually have a different internal structure in the form of shell, white, and yolk.
It can also be noted that Feather Tree Eggs are bugged and cannot be acquired, but eleven caravans litter the trade depot with Feather Tree Egg Yolk (which cannot be picked up and used).

After last post some lover of aquatic vermin body parts have appeared in my fortress. Here's excerpt from your (older) script's output:
Code: [Select]
hagfish gut     1
hake    5
hake liver tissue       1

Both hagfish and hake are water vermin, apparently sometimes dwarves are inquisitive enough to find what hides inside these vermin...
The guys who love hake have this preference:
 item_type: 48 (i.e. FISH)
 item_subtype: -1
 mattype: 550 (this one is race ID of the creature, hake in default RAWs)
 matindex: -1

The guy who loves hake's liver has this preference (he also likes a whole vermin fish of another species, he's a fish guy):
 item_type: 47 (i.e. MEAT)
 item_subtype: -1
 mattype: 29 (this means liver)
 matindex: 550 (and here the ID)

So clearly sometimes, when choosing meat, the vermin are considered by game. I don't know why so rarely, but still in my game it's more often than pigs, llamas, cows, horses or other domestic animals, which have zero lovers. Except cheese and milk, yeah, these are preferred by some gourmands.

Quote
My biome hacking includes trees, yes. For some reason it tends to take a few years for saplings of most temperate fruit trees to appear, but since they only take 3 years to mature, it's not a big deal.

Ideally, migrant (and petitioner) preferences ought to be based on their background, which means it ought to be based on what was available in the places they've lived (which ought to include what's available via trade). I agree preferences ought to develop over time, with newborn being blank slates, but if so, the process ought to be capable of blocking stuff exposed to (i.e. I've only ever eaten Plump Helmet, and I don't like it and will never do so. Please let me try other things! Hm, Cave Wheat. Novel, but no, I won't grow attached to that either). However, currently newborn are fully formed with preferences, views, personality traits, etc.

Yep, their initial state should be blank, though they should have some preference chances. But even if it remained like it is, it should be more rational when choosing. You can't like something no one ever seen ;)

Quote
Edit: Looking more into preferences, I see no whole creature preferences in my fortress, except for vermin (moghopper) and vermin fish, while there is a preference for Pike Kidney Tissue (and looking at the raws for Pike shows it's a creature, not vermin).
I've also found that mead isn't actually booze cookable.

Ah, so they won't make mead roasts.  But it's a kind of moot point, you see, because of peculiar behaviour of eaters and drinkers who do not have their preferred food: they choose whatever was produced or brewed recently. In case of food it's often horse tripe or pig intestine (i.e. not a big deal usually), but in case of alcohol it can be mead - which is rarely made. I have over 20 hives, and when mead is made, even if it's more than one unit, it's all gone before sunset, because of this behaviour. So I wouldn't be able to make a mead roast anyway.

In case of meat I sometimes butcher the extra rare creature surrounded by common creatures - for example a beak dog, an eagle (rare), a llama and another llama. This usually "saturates" the market so the rare eagle parts won't be instantly eaten by some boor who can't appreciate them. But this can tedious, and I can do it only for the most valued dwarves anyway.

As for aquatic vermin parts - as seen in my example above, they can happen. But they are quite rare for some reason.

Quote
Edit 2: Is it known what the size limits for butchering and slaughtering are, and if there's more than just bones that won't appear if the creature is too small to yield anything but skull and meat? I'm fairly sure a Magpie is too small to be butchered (to satisfy a need for Magpie Gut), but would a Buzzard (which appears to be a borderline species that sometimes yields just a skull and meat, and sometimes a more complete result) produce a Gut part in either or both cases?

Edit 3: I've found that the "[NOT_BUTCHERABLE]" token from the raws can be accessed from the creature raw to determine if a creature is labelled as butcherable (which showed that the Magpie in Edit 2 is marked as [NON_BUTCHERABLE]).

A marginally updated food_needs script that flags the impossible items I know of as impossible (butcher products from creatures that can't be butchered, bumblebee honey/mead, feather tree egg parts).

I've run the new script (after modifying to count my long-term residents) and here's the part about vermin:
Spoiler (click to show/hide)

These are some queer preferences, I'd say.

Now, about the script: it proved most useful, but I had to make some modifications, and there's a part which apparently works differently for you. The modifications I made are logging (because output is too big for my console's buffer), and determination of long-term residents (because otherwise only full citizens are counted, and my fortress has more long-terms than citizens). As a side note, the flag "resident" means that the critter is a and underground cave dweller (I don't know why it's named resident, "underground" or "caverns" would be better), just like "underworld" means that it is a hell dweller.

The part I do not understand is the one which checks the plots (and zones), specifically compares their name to the material id. In my game this field contains the nickname of the field the player can give, so the result of comparison is always false, i.e. #drink_demands and #food_demands will be always zero. Do you use a script which populates these names with IDs maybe?
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on November 16, 2018, 09:09:15 am
Given that "normal" vermin body parts can appear, it might not be too surprising aquatic can appear as well. The output pasted also show Dwarven Cheese flagged incorrectly, as it's supposed to be possible to milk purring maggots.

If the "resident" flag means "cavern denizen", how do you determine if a non citizen is a resident (and not e.g. a visitor from your own civ)?

The plot and zone name matching are indeed based on other scripts I use, and shouldn't be used in scripts shared with others (unless the others are as well, as part of a package). I use one script for logging to spare useful trees and, in its latest version, set up gathering zones around them (I did that manually previously), and another one yearly to enable/disable farm plots and zones to attempt to keep a desired booze supply. The script names plots after what's planted on them by the player and uses the name to find fallow plots allocated to a given crop when it's time to plant again. However, it's tailored to my play style of trying to grew crops in spring (those that can't be planted in spring are allocated to the earliest possible season), harvest fruit in summer, catch up on all the hauling that's built up over the first half of the year, and R&R (and militia training) during winter.
Title: Re: What is a "decent meal"?
Post by: Starver on November 16, 2018, 10:32:23 am
Again, perhaps a reason to (internally) sandbox the possibility of an animal-type and only proceed to choose its component parts if it's sandbox-butcherable thing (if, as it might well be, DF is just making the assumption that they exist for everything it picks). You'd expect it to at least directly reference the raws (to make it sensitive to modding) to look for possible subtrees, but with my "pick something rare (yet possible)" scheme it does the spadework for the other circumstantials involved.

But, really, I was wanting to post about the image Dwarf with "LOVE" and "HAKE" tattooed on their knuckles.
Title: Re: What is a "decent meal"?
Post by: Saiko Kila on November 16, 2018, 02:39:56 pm
Given that "normal" vermin body parts can appear, it might not be too surprising aquatic can appear as well. The output pasted also show Dwarven Cheese flagged incorrectly, as it's supposed to be possible to milk purring maggots.

It's not surprising that it appears, what I find surprising is that it seems to be much rarer than the proper (whole) vermin, which supposedly is an artefact of the algorithm which determines the whole preference. I think it may run and choose whether a dwarf wants a vermin or a meat (or whatever), and if it wants meat, is just runs through all, including vermin. And maybe aquatic vermin are counted separately.

Ad for purring maggot, yes, that's how it shows. But I would love to see actual purring maggot and processing of it - maybe it is bugged in game, and the script shows truth?

Quote
If the "resident" flag means "cavern denizen", how do you determine if a non citizen is a resident (and not e.g. a visitor from your own civ)?

I just include your script with modifications I made (i.e. one with logging and with counting citizens and long-term residents). I use a function I made for other script. Similarly to isCitizen() function, it checks flags and conditions - it calls isCitizen() in the beginning, and only performs checks if false is returned. I assume that it is faster than rewriting the isCitizen() in Lua to account for the long-term residents, also it's easier to customize (for example it returns 3 for visitors and diplomats, but not merchants, since merchants don't use my taverns while diplomats do).

At the end the total sum of citizens and LTRs is shown, and it should be the same as number of people in the Citizen tab in "u"-screen. If it is different, then there's something wrong. I had to make this function for my scripts, because sometimes there are goblins or necromancers with visitor flags, and other irregularities. But the most important is determination of all guys in the Citizen tabs, since they do most stuff, like eating, drinking, clothes wearing etc.

Spoiler (click to show/hide)

Quote
The plot and zone name matching are indeed based on other scripts I use, and shouldn't be used in scripts shared with others (unless the others are as well, as part of a package). I use one script for logging to spare useful trees and, in its latest version, set up gathering zones around them (I did that manually previously), and another one yearly to enable/disable farm plots and zones to attempt to keep a desired booze supply. The script names plots after what's planted on them by the player and uses the name to find fallow plots allocated to a given crop when it's time to plant again. However, it's tailored to my play style of trying to grew crops in spring (those that can't be planted in spring are allocated to the earliest possible season), harvest fruit in summer, catch up on all the hauling that's built up over the first half of the year, and R&R (and militia training) during winter.

OK, clear then. I think I can modify it to look for plants in the structure of fields, at least. Anything, this part of the script is useful anyway, because it shows all these poor critters and their preferences as it is. And now I can log it, to maybe make some statistics if I do it for more forts, to satisfy my curiosity.

One thing about the too small items - this is probably more a warning that exact declaration, because bigger specimens could potentially bring these items (like dog's spleen or coyote's heart), right? My non available items now look like this. Very singular tastes, these dwarves have :)

Spoiler (click to show/hide)
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on November 17, 2018, 12:20:55 pm
Purring maggots have the Underground Chasm biome, a.k.a. muddy cavern, so it might not be too surprising they're not found more frequently (I've never seen one as far as I know, but I don't look too carefully after vermin). If I read the raws correctly mog juice isn't alcoholic and is edible only if cooked, and I haven't found any other LIQUID MISC preferences that cannot be "eaten" (i.e. drunk) raw. Apart from vermin butchering, I don't think there's any relation between butcherability and creature extraction (such as mog juice and dwarven milk), and I don't think there should be any.

Creepy crawlers do not, in fact have the NOT_BUTCHERABLE tag, while all (?) other vermin do, so it ought to be legal for creepy crawler meat to be a preference as they're large enough to provide it.

I don't think DF should generate a preference for a body part that can only be obtained through butchering of the very largest specimens of a species (with necro bacon processing being the extreme of that), while I consider it reasonable to allow preferences for items that may be missing on smaller than standard members.

df.global.ui contains a number of useful fields, by the way (I don't know how far back those fields existed):
- civ_id = you civ entity id
- site_id = fortress site id
- group_id = fortress entity id
- race_id = civ race

Edit: An attempt to make a script that fixes food need bugs (but does NOT do anything to address "unreasonable", but technically possible, preferences). Note that it's been tested very little, and as it changes preferences, I'd try it on a freshly loaded save that can be discarded.
Spoiler (click to show/hide)

The script replaces vermin parts with the whole vermin, unobtainable butchery products with muscle (which is checked that it should be possible to obtain), and otherwise replaces unavailable drinks with a random possible one, and unavailable food with a random possible one.
Title: Re: What is a "decent meal"?
Post by: Saiko Kila on November 17, 2018, 05:36:39 pm
I'd look at it when I have time tomorrow (since it would be 7th version I'd need to to modify for my fortress :) ) but there's one bug I noticed earlier: the thresholds for animal size are one order of magnitude too high. This is reason why things like wolf's spleen is tagged as "too small". The thresholds are apparently in grams (the same as in real RAWs, for example 40000 for wolf's adult size), while the raw structure in dfhack uses decagrams (the same as in-game displayed size for traps, or body size in unit structures, for example 4000 for wolf). So line
Code: [Select]
          if min_butcher_size [material.material.id] > material.creature.adultsize thenshould be
Code: [Select]
          if min_butcher_size [material.material.id] > material.creature.adultsize*10 thento account for that.
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on November 18, 2018, 03:33:43 am
Thanks. I'll adjust the size structure rather than try to hunt down the usages, though.

I've updated the booze_cooker script:
- It now covers residents as well as citizens
- All food item slots are populated, not just the last ("booze") one. The logic tries to select cookable items that exist in the fortress, excluding STRUCTURAL plants unless they yield fruit (because the structure is what produces seeds and everything else). Seeds are permitted to be cooked only if there are at least 50 of them or they're from trees.
- An attempt at a "just in time" cooking order is used, so the script adds up to 3 cooking jobs (it seems you can't actually do more than at most 2 in a week).
- Very limited testing. It's likely some things don't work as intended. I offer only the money (0) back, but don't accept damages!
Spoiler (click to show/hide)
Title: Re: What is a "decent meal"?
Post by: Saiko Kila on November 20, 2018, 06:25:42 pm
Regarding the first script, the one http://www.bay12forums.com/smf/index.php?topic=172335.msg7888383#msg7888383
I've spent more time with testing it. First technical, the script is a quote not a "code", needs to be copied, and since some lines are too long for my web browserI had to edit it to prevent related errors. Not a big deal if someone knows Lua commenting style, but there it is. Second technical was I had to change
Spoiler (click to show/hide)
because new_str is treated as userdata data type, not as a string and it throws an error.
Third technical was I had to change lines
Spoiler (click to show/hide)
I suppose this is how it was intended, but I note it in case it causes some funny things.

Now about the workings, the actual working and changes to dwarves. During first pass it caused some changes, for instance
  IMPOSSIBLE bumblebee mead [bumblebee]
  to
  dwarven milk [purring maggot]
You may say that it's changing something impossible to something theoretically possible, so it's theoretically fine, but it also does change alcohol into non-alcohol. Now I don't know if it at all matters to the dwarf to have one alcohol, but sans the one hillock generated imigrant (which was created by the game de novo, like seven initital dwarves) all people do have one alcohol preference, and sometimes (often, I would say) it's the only food preference they have. So I think it would be good after change to still have one alcohol (or two).

Another change was
  TOO SMALL desert tortoise gizzard tissue [desert tortoise]
  to
  donkey stomach tissue [donkey]
which was OK, but after I ran the script second time (because there were still two impossible foods) this happened
  donkey stomach tissue [donkey]
  to
  giant slug liver tissue
Hm. Only reason I can think of is some residual cache of Lua, a problem which I also run into sometimes with my scripts, when they can reuse a variable between different runs (instead of having it reinitialised/cleared). So in this cases the variable needs to be cleared explicitly or something. Not that big deal overall, but something which can surprise an user.

However, third weird change I noticed was harder to explain:
  cow cheese [cow]
  to
  UNAVAILABLE roc muscle [roc]
It was on the first run. This was changed again in the second run:
  UNAVAILABLE roc muscle [roc]
  to
  hippo heart tissue
Which is OK. But why change the perfectly fine cheese to roc meat in the first place?

There was similar issue with other dwarf:
  penguin muscle [penguin]
  to
  UNAVAILABLE giant damselfly stomach tissue [giant damselfly]
which in second run was repaired with this change:
  UNAVAILABLE giant damselfly stomach tissue [giant damselfly]
  to
  giant hedgehog pancreatic tissue
There were of course many other changes (I ran it on fortress of 160 people), but these struck me as somewhat strange. You may keep an eye on cases like this.

----------

Regarding the second script, the booze cooker, this is first time I ran it, so I didn't fully know what to expect. First a technical: it throws an error (or rather warning) of "take_stock encountered unexpected LIQUID_MISC material mode: inorganic          0       33", which is caused by milk of lime. I added lines         
Code: [Select]
elseif i == "liquid_misc" and
               material.mode == "inorganic" then
in appropriate place, and the error disappeared.
      
            
As for the working, it seems it is working. I'm not quite accustomed to reading scripts of other people, this is the third dfhack script I read (other than mine own), so I don't fully understand what it is doing yet, but apart from one error once (it was expecting integer in line "job.job_items [l].item_type = df.item_type [vector [categor_iterator]]", I don't know why it wasn't getting an integer), it creates up to three jobs per kitchen, with seemingly preference for powder (flour) in the first three, but maybe it's because they are the freshest thing.
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on November 21, 2018, 03:55:22 am
Thanks for the testing. I'll try to understand what's happening and fix the problems.

The booze cooker script is set up to generate a callback every 7 days, at which time it tries to fill each kitchen queue up to 3 lavish meal orders. The reason you get flour in the first 3 spots is because of how the script tries to allocate resources. The take_stock function collects what's available at every callback, while an iterator group of 3 variables iterates over all items deemed suitable for filling out meals. This iteration starts with the first category you have in your fortress, which seems to be powder_misc, and allocates one item to each of the first 3 slots (they should all be different flours). When all powder_misc entries have been sampled, it moves over to the next category to take one of each of those. Note that the iteration is a rather convoluted construction because it's intended to iterate over the whole stock over several iterations, taking into account that the stock will change between the callbacks. This means that the next week you may get more flour containing roasts, while the week after you'll get one with the last kinds of flour, and the rest taken from the next category (whichever that is). If it works as intended, it should eventually return back to powders again when all items have been sampled.

Edit: I've updated the fix_food_needs script:
Spoiler (click to show/hide)

I think my mistake of adding quote rather than code is what caused the indices to go missing (I think the board tries to create a bullet list, or something like that), as they weren't missing in my version (and the index should be "i" in both cases, which might be responsible for some of the weird things you saw (and when I tried this with brackets rather than quotes in this paragraph, the preview shows my subsequent text in italics, so that's probably what it did)).

- I've changed the drinks replacement to ensure booze is replaced with booze.
- I've added setting of item_type and item_subtype on the preferences: the combination of "PLANT" and hippo brain is not a valid one. I didn't see any effect from subtype, but it ought to be provided correctly anyway.
- I wasn't able to replicate any of the weirdness seen. In particular, I modded my first dorf to have the first food preference set to cow cheese, and the script did not try to replace it. Also, I've never seen replacements when the script has been run a second time.
- I've split the longest lines.
- I've added tostring () where indicated, although I've never seen any problem without it (and I don't see any problem with it either, so adding it doesn't seem to cause any trouble).

Title: Re: What is a "decent meal"?
Post by: Saiko Kila on November 21, 2018, 08:01:36 am
Allright, I'll try with changes. Also I removed a follow up answer,  where I've seen such things like replacing cow, pig, alpaca and sheep milk and cheese (but not from other animals), and also one instance of replacing available milk with unavailable booze. But this was with this flawed copy of your script, so maybe it was caused by these "printing errors".

OK, I've found an issue, but it is very rare. Sometimes I need a few thousand dwarves to run before it happens. It terminates the script with "attempt to index a number value (field '?')", which always happens in one of
Code: [Select]
preference.item_subtype = edible [rng_number].subtype lines. There are some of these, and I had the error in three of them. Last time it was when trying to replace something with phantom spider, and it was when "Replacing unbutcherable".
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on November 21, 2018, 01:28:53 pm
Ah, bugger. The "preference.item_type = edible [rng_number].subtype" entries where the script has just checked that "edible [rng_number]" is a number rather than a struct will blow up when used as if it was a struct, of course... There are 3 of those.
The element is a number when it references a vermin animal (which may be a fish).
I don't think the field is used in that case, and that it probably ought to be set to -1 (which I haven't done below).

Corrected script:

Spoiler (click to show/hide)
Title: Re: What is a "decent meal"?
Post by: Saiko Kila on November 22, 2018, 06:12:04 am
It seems it works in newer games. But I have issue in older games, imported from v0.40.06 (but run in 0.44.12). It gives an error "attempt to index a nil value (global 'mat')" in line
Code: [Select]
old_str =  mat.material.prefix .. " " .. mat.material.state_name.Solid Is this "mat" declared at all?

Also regarding the changes: one of them was logged as:
Replacing unavailable bumblebee royal jelly with one-humped camel's milk on `MERC Hode /' Siegeplunged
However, the milk is actually from one-humped camel man... :)

I was also thinking more generally about replacements like of worm's gut by gut, or fly's brain by fly. Are creatures like these available as food normally in any way? I mean a dwarf can eat them if very hungry and has no other choice I believe (and has to catch them, and the mood change is probably negative), but how to make him eat them under normal circumstances? They can't be butchered, they can't be used as a part of roast, I don't think they can't be obtained other than by trade - but I'm not sure if it's in the form allowing eating (the are live).

I think that only aquatic vermin are obtained in a way allowing eating them (either from trade or from fishing, after preparing)? The only others are maybe purring maggots, moghoppers and various spiders, which are killed after extraction, but I don't remember last time I saw it, so don't know if they are edible (in the same state as prepared vermin fish), or just remains to be thrown away.
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on November 22, 2018, 10:02:19 am
The "mat" is an error: it should be "old_mat". There's another bug in the vicinity, however, causing the no part branch above to be incorrect as well.

Dorfs eat eggs from animal people, so why not milk/cheese? ;) However, I agree that ought to be changed.

Vermin can be caught in vermin traps, and DF obviously generate preferences for eating vermin, but I haven't seen or heard of anyone catching and eating them except to stave off starvation. I don't know if dorfs with a preference for vermin can actually eat trapped vermin, though. If a dorf caught vermin to eat for a preference it shouldn't generate a bad thought though, as the dorf isn't forced to eat vermin.
The only vermin I know can be eaten "normally" is creepy crawler, which apparently can be slaughtered after being caught. I would expect that the non "fish" vermin that can be processed in other ways wouldn't leave any edible results, but I have never processed any.

I looked into the one humped camel man milk issue, and found it's common to all animal people that yield milk and cheese, namely that the product is named after the base creature, not the man variant. The bug tracker is unavailable at the moment, but I'll write a bug report later.

I tried to get the script to replace vermin, but ran into an unexpected problem: Not all the vermin fish that are edible according to the wiki Vermin page have the VERMIN_FISH flag set. The set of any_vermin and CASTE_MUST_BREATH_WATER includes Moon Snail but excludes Lungfish and Pond Turtle.
Title: Re: What is a "decent meal"?
Post by: Saiko Kila on November 22, 2018, 03:08:42 pm
The "mat" is an error: it should be "old_mat". There's another bug in the vicinity, however, causing the no part branch above to be incorrect as well.

Right.

Quote
Dorfs eat eggs from animal people, so why not milk/cheese? ;) However, I agree that ought to be changed.

Because it's gross ;) No, seriously I was more concerned that the item is described as camel's milk, but also because I don't see it can be obtained in any
meaningful way.

Quote
Vermin can be caught in vermin traps, and DF obviously generate preferences for eating vermin, but I haven't seen or heard of anyone catching and eating them except to stave off starvation. I don't know if dorfs with a preference for vermin can actually eat trapped vermin, though. If a dorf caught vermin to eat for a preference it shouldn't generate a bad thought though, as the dorf isn't forced to eat vermin.

There are vermin which can't be caught in traps, at least not in baited ones (there's a tag for it), and since some are in places not accessible to animal trappers, I think that these can't be really caught. An being non-fish, can't be bought.

Quote
The only vermin I know can be eaten "normally" is creepy crawler, which apparently can be slaughtered after being caught. I would expect that the non "fish" vermin that can be processed in other ways wouldn't leave any edible results, but I have never processed any.

I wonder what causes it. Maybe because it has no [NOT_BUTCHERABLE] tag.

Quote
I looked into the one humped camel man milk issue, and found it's common to all animal people that yield milk and cheese, namely that the product is named after the base creature, not the man variant. The bug tracker is unavailable at the moment, but I'll write a bug report later.

I noticed after changes that I had three dwarves with three different one-humped camel milk requirements. One of these was normal, another was from giant version, and third was from animal man, despite the same name. Talk about fussy eaters.

Quote
I tried to get the script to replace vermin, but ran into an unexpected problem: Not all the vermin fish that are edible according to the wiki Vermin page have the VERMIN_FISH flag set. The set of any_vermin and CASTE_MUST_BREATH_WATER includes Moon Snail but excludes Lungfish and Pond Turtle.

It think the [FISHITEM] is what causes vermin to be available both in stocks category (as fish), and in trade. It is available in caste flags, I'm not sure if also in general race flags. Since this tag is related specifically to their edibility, I would say it is a good choice for tests. Quite possible it's also the tag which creates this general (no specific part) food preference in the dwarves.
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on November 23, 2018, 06:36:32 am
Milk: The cause of the naming problem is that milk and cheese doesn't use a prefix like other tissues do. Again, however, MySQL reports an error when I try to access Mantis for a bug report...
I believe I've managed to remove animal people from the list of eligible milk and cheese products, though.

The Creepy Crawler can be butchered because it doesn't have the [NOT_BUTCHERABLE] tag together with being large enough to generate meat when slaughtered.

The [FISHITEM] tag is set on every vermin fish, plus the moghopper. The only things I've found that sets the moghopper apart from the rest is that it can't be eaten (according to the wiki) and that it has a creature extract reaction.

I haven't looked at CASTE flags before, but there seems to be some general flags buried down there. It can be noted that the script still iterates over the raw strings for NON_BUTCHERABLE, for instance: I haven't changed that yet.

The updated version if the script. Note the variable "replace_vermin" at the top. It's set to "false", so the script behaves as before (minus some bugs). If the variable is changed to "true", the script should replace all non "fish" vermin (no Creepy Crawler, Mog Juice, or Dwarven Milk/Cheese as a collateral result).

Spoiler (click to show/hide)

Edit: I finally managed to file a bug report: http://www.bay12games.com/dwarves/mantisbt/view.php?id=10959 (http://www.bay12games.com/dwarves/mantisbt/view.php?id=10959)
Title: Re: What is a "decent meal"?
Post by: Saiko Kila on November 23, 2018, 06:45:59 pm
I think it works very good now. I needed to personalize it only by adding logging. Maybe also I will modify so vermin is changed to aquatic vermin, because that would be easier to fulfil, and I like to cheat.

Regarding moghopper, I don't believe it is inedible and I wanted to prove it (also wiki on moghopper says it's edible). However, I tried and failed to find an embark where moghopper is present in the population list. Actually, in most embarks (with unmodded game!) pools are empty since the beginning, and I can't fish anything. I'm not sure if it's my luck or some kind of a bug. Dwarves trying to catch a live fish vermin (using the Fishery workshop task) when pools are empty (i.e. in all my tested cases) will just stand somewhere in the corner till I cancel the task, even if they are hungry or thirsty...

Regarding the bug with milk and cheese: it seems impossible to easily modify it with RAW. I was able to correct it by changing c_variation_default.txt so it removed milk and cheese tags from all giant versions, and then manually adding milk and cheese tags to proper RAWs for female giant animals (I did it only for a few, to test it). The same could be done with animal men. It's too much work to be fun (the new tags need to be in proper place and sequence), but it's doable.
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on November 24, 2018, 03:34:39 am
The wiki page on vermin claims the moghopper is not edible, but yes, the page on the moghopper claims it is, so the pages are conflicting.
It can be noted that the raws for the creature makes it available only in summer, so for a "live" testing I'd consider removing the season restrictions. However, I've found pools to be surprisingly empty of vermin fish when a blasted mood require shells, forcing me to try some emergency fishing for pond turtles.

Your testing with the raws shows that it is possible to fix the bug with raws only, though, even if it's tedious, which is probably better than changing the code (especially if the community would do the work and Toady would accept the results). Personally I'd leave animal women out, as I don't think they should produce theoretically milkable but practically unavailable, milk (and hence cheese).
Title: Re: What is a "decent meal"?
Post by: Saiko Kila on November 24, 2018, 06:06:54 am
I tried proper live tests with moghopper at first - in my fort in summer, and then on new embark in new world, using spring time to prepare traps and workshops. But the only fish I can catch are in the rivers or oceans, not in the ponds. Maybe caverns are viable, but I don't fish there, instead buying cave fish from caravan.

The bug with milk is still a bug, even if in RAWs, and maybe it would actually need some code changes for easier modification, or rather generation of name? Currently names have to be explicitly declared, and giant/animal men versions simply copy the names from the base creature. You could name liquid cow's milk "a rainbow puke", frozen one "elixir of youth No.5" and gaseous "bar of soap", and if the giant cows existed their milk would be named the same.

After some tries I find that the best modification to me is these steps:
1. extract raws of critters as the game sees them
2. modify raws of giant/animal men
3. overwrite original definition in the proper txt files with the new changes.

So for example in giant kangaroo's case, find the giant kangaroo in creature_temperate_new.txt, remove [CREATURE:GIANT_KANGAROO] and everything below to the line about sponsorship of koala's, and insert
Spoiler (click to show/hide)

Sure, this way the giant kangaroo's definition is divorced from the base creature's definition, but at least the only thing which changes from the game's perspective is the only thing I want to have changed. This is also guaranteed to be save compatible, while I'm not so sure about the product of tag changing, which is prone to mistakes. This can be automated by a script, but since this script would need testing anyway, maybe it's not worth doing, time-wise. Besides, manually changing can help in finding bugs in RAW definition (for example giant koala doesn't have opening bracket in GENERAL_CHILD_NAME tag, so the tag is not applied, and giant koalas don't have specific names for young, I found out only because it is just after kangaroos).

The new definition of giant kangaroo takes 5815 characters, the original definition has 1039 characters. Downside is that the file size is bigger, but file size would have to be bigger anyway, if the strings are to be changed.
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on November 24, 2018, 07:51:42 am
If I was to change the code in a limited way, I'd use wildcards such that generic milk would be defined as "*milk"/"frozen *milk"/etc. and the parsing of the RAWS replacing '*' with the name of the creature in possessive form (i.e."'s") followed by a blank (allowing for very generic milk being called "milk" rather than " milk"). I'd allow this to be overridden both by a [WILDCARD] tag (similar to the current [PREFIX]) and possibly by specific string tag overrides. Purring Maggot would have a [WILDCARD] of "Dwarf" for both milk and cheese. However, it's Toady who'd have to do code changes.
Title: Re: What is a "decent meal"?
Post by: Saiko Kila on November 24, 2018, 08:09:33 am
Eh, I've checked all RAWs, and there are only four species which produce both milk and animal/giant version. I thought there are more. So it is perfectly possible to change it manually without a script, heh. These animals are both kind of camel, kangaroo and tapir. Probably modded versions of RAWs would need more, and they can use more work, but vanilla is pretty easy as it is.

Yes, Toady could think about using some tags which use more intelligent parsing and renaming, as you suggest, especially since he likes these variations. Funny thing with this purring maggot, good that dwarven women don't produce milk, would be confusing.
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on November 24, 2018, 02:11:14 pm
Dwarves being mammals, I assume dwarven women lactate while nursing their babies, but its all abstracted, and I don't see much point in simulating it beyond a nursing action for adventure mode offspring once that becomes possible. Only a small number of species have been bred to produce an excess of milk (and I don't believe kangaroos are among those: even milking them would be tricky, as I believe the teats are at the bottom of the pouch).
Title: Re: What is a "decent meal"?
Post by: Saiko Kila on November 25, 2018, 01:13:48 pm
I think this is abstracted too much now - when a dwarf woman is in depression and bears a baby, it is dropped down instantly and crawls around, until the mother comes to her senses and picks the baby up. It can take days, even a week, and the baby is still alive and well, before the mother pays attention to it for the first time. It makes life of an overseer easier, but means that the mother is kind of redundant.

I have compared amount of milk bigger kangaroos produce to amount of other animals, and even human females beat the bigger kangaroos in peak daily output. But the giant kangaroos in DF are much bigger, and since kangaroos (no matter size) lactate for longer than humans, and can feed even three different sized children at the same time, I believe that dwarves would find a way to utilise them. But why giant kangaroos (or tapirs) are milk producers in DF, but not for example giant goat mountain or giant goat I cannot fathom.
Title: Re: What is a "decent meal"?
Post by: Cjenz on January 16, 2019, 09:07:19 pm
@Saiko Kila:

Bananas: I hack bananas to yield wood and I hack all surface biomes to contain all eligible plants and animals... This means it's only a matter of time before they show up in my embark (which is carefully created [and hacked] to contain 9 biomes, although only 6 is needed to get all boozable plants).


9 biomes in one sounds quite FUN. Any chance of a link to a hacked map which contains one such dwarven playground?
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on January 17, 2019, 03:20:12 am
@Saiko Kila:

Bananas: I hack bananas to yield wood and I hack all surface biomes to contain all eligible plants and animals... This means it's only a matter of time before they show up in my embark (which is carefully created [and hacked] to contain 9 biomes, although only 6 is needed to get all boozable plants).


9 biomes in one sounds quite FUN. Any chance of a link to a hacked map which contains one such dwarven playground?

The world: https://www.dropbox.com/s/mgtay25ovjnuia0/Newhope%202.zip?dl=0
You'd embark in the north/center region (i.e. inside the "ocean" in the single good desert tile (towards the southern end of the area). Once your focus is in that world tile, you'd run this DFHack script:
Spoiler (click to show/hide)

The script hacks the mid level tiles to generate a 3*3 area with 9 biomes close to the center of the map, which is the intended embark area. Note that the effects of the script are removed if you move the focus to a different world tile and back (but you can run the script again). It's possible to generate the same kind of multi region embark using the Region Manipulator, but this script predates that tool, as well as does exactly what I want with a single command.

Edit: I screwed up the zip file, and accidentally provided one with a bug report save. I've corrected the link above (the file names differ with a blank character...).
Title: Re: What is a "decent meal"?
Post by: em312s0n on April 12, 2020, 12:36:11 am
I tried the updated script in 47.04 but its giving me a "...\Desktop\DF\Dwarf Fortress 0.47.04/hack/scripts/food.lua:250: Cannot read field BitArray<>.CASTE_COMMON_DOMESTIC: not found.
stack traceback:
        [C]: in metamethod '__index'
        ...\Desktop\DF\Dwarf Fortress 0.47.04/hack/scripts/food.lua:250: in global 'fix_food_needs'
        ...\Desktop\DF\Dwarf Fortress 0.47.04/hack/scripts/food.lua:594: in local 'script_code'
        ...0n\Desktop\DF\Dwarf Fortress 0.47.04\hack\lua\dfhack.lua:680: in function 'dfhack.run_script_with_env'
        (...tail calls...)"

Can you share if you've fixed it? thank you
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on April 12, 2020, 02:19:06 am
I updated the script to handle changed flag names and a weird issue with vermin flags not working as one would think.

Spoiler (click to show/hide)
Title: Re: What is a "decent meal"?
Post by: em312s0n on April 12, 2020, 04:29:04 am
Awesome as always thanks. On another note ive just found that the workflow plugin can automate brewing of specific alcohol.

I first made a repeating brew from plant task from the still:
Spoiler (click to show/hide)

alt A to specify material then esc to set:
Spoiler (click to show/hide)

Alt W creates the workflow restriction and it lists the possible products so choose dwarven wine:
Spoiler (click to show/hide)

and it creates the restriction
Spoiler (click to show/hide)

you can just change the range to fit your fort's needs shift R:
Spoiler (click to show/hide)

now it will queue up the order when needed to your specific range so you can just set it then forget it:
Spoiler (click to show/hide)

Just posting it here just in case someone finds it useful

You can't do this with prepared foods sadly. I tried. Workflow can create the restriction but the building cant attach the task to the restriction. I think it has something to do with meals using multiple materials or maybe because the kitchen really only outputs roasts, stews etc not like the still where it outputs dwarven rum, beer, sewer brew, etc depending on the input material.
Title: Re: What is a "decent meal"?
Post by: PatrikLundell on April 12, 2020, 07:28:53 am
I don't know anything specific about Workflow, but it's definitely possible for a script to specify the ingredients to use for specific kitchen jobs. A restriction is that the first ingredient has to be solid.
Title: Re: What is a "decent meal"?
Post by: em312s0n on April 12, 2020, 08:23:42 am
I don't know anything specific about Workflow, but it's definitely possible for a script to specify the ingredients to use for specific kitchen jobs. A restriction is that the first ingredient has to be solid.

Sorry when I wrote restriction I meant the workflow constraint(maintain x amount of y type of items). restriction is just a term that I use in my head when I use workflow hehe.

So what I meant was I could create a workflow constraint saying "maintain 40-50 roasts with a plump helmet as ingredient":

Spoiler (click to show/hide)

and I can have the kitchen create an order specifying to create a roast with a plump helmet as ingredient with alt A

Spoiler (click to show/hide)

but workflow wouldnt link the order with the constraint:
Spoiler (click to show/hide)

on that example it would just make plump helmet roasts regardless of whether its within the set range or not.
Spoiler (click to show/hide)
Title: Re: What is a "decent meal"?
Post by: Sarmatian123 on April 12, 2020, 12:59:45 pm
Not in vanilla though. Eh... Why Toady oh Why?  :'(
Title: Re: What is a "decent meal"?
Post by: em312s0n on April 12, 2020, 01:24:45 pm
yeah sorry dude but if youre insistent in sticking to vanilla, mikekchar's post from page 1 may help you out
Title: Re: What is a "decent meal"?
Post by: janamdo on April 13, 2020, 01:57:06 am
Awesome as always thanks. On another note ive just found that the workflow plugin can automate brewing of specific alcohol.



I am wondering what is the difference between the built in jobmanager [j]-[m] and the  DF hack workflow manager?
 
Title: Re: What is a "decent meal"?
Post by: em312s0n on April 13, 2020, 05:43:55 am
You can set a range of goods to be maintained for both but you can assign specific materials if you use workflow(alt A after creating the task) and then forget it because the task never goes away when the range is met. In the manager you can set specific materials(DFhack alt A after the job manager creates the task on the workshop) but the task will be gone when its done
Title: Re: What is a "decent meal"?
Post by: janamdo on April 13, 2020, 07:33:00 am
after the job manager creates the task on the workshop) but the task will be gone when its done
Thanks
This is also the case when you use conditionals in the task ?
Title: Re: What is a "decent meal"?
Post by: Fleeting Frames on April 13, 2020, 07:38:59 am
Yes; it generates new jobs each time rather than resuming old one repeating one like workflow.

Thankfully for most stuf you can set details for material, but in this particular example this is not possible. Here's a point-by-point comparison (http://www.bay12forums.com/smf/index.php?topic=158287.msg7575292#msg7575292).
Title: Re: What is a "decent meal"?
Post by: janamdo on April 13, 2020, 10:31:33 am
Thanks
Seems to be rather complicated.with all those conditionals to use.
At the moment i am using the inbuilt job manager in DF.
Title: Re: What is a "decent meal"?
Post by: Shonai_Dweller on April 14, 2020, 07:44:28 am
Thanks
Seems to be rather complicated.with all those conditionals to use.
At the moment i am using the inbuilt job manager in DF.
Yeah, learn the base game first before confusing yourself with mods and other utils (except one or two bits and pieces you find you really can't play without like Therapist or a tileset, etc).
Title: Re: What is a "decent meal"?
Post by: iceball3 on April 16, 2020, 05:37:06 am
Cooking alcohol is actually a really good idea, thinking about it.
Kind of unfortunate how much of a derp in style it is to have to skip wheat flour in favor of making drink, but at least it makes it possible to satisfy those needs now. Millers to be reassigned to cooking and brewing!