1
DF Suggestions / Re: Food variety and basic metabolic biology
« on: March 02, 2012, 03:55:05 pm »
Ergh. I apologize for going absent for so long, and for not reading every post since last time in detail.
One thing to consider, from an implementation complexity point of view: If a nutrient system, or other reasonable food system for that matter, is ever to be implemented in Dwarf Fortress, it will have to follow the "embrace and extend" path to get into the game. DF is too complex to just rip out the old system entirely and code up a new one, IMO. So I'd say suggestions should be, at least to some extent, put in terms of existing structures, instead of trying to reinvent too much (even though that is ultimately desirable).
But even our modern day societies do not have the complete picture when it comes to nutrition, what more to say about a medieval society. So I'd say that even though the basic information should be easily visible to the player (foodstuffs and their avg nutrient densities, how they compare, what is a default/canon dwarven diet, a few interesting exceptions) there should still be a mystery-factor here and there that could take figuring out. "What is bothering my dwarves? Why is this one so agressive. Why are they having trouble concieving?" ... "Oh, this working environment has this bad effect on them which is only supressed by this vitamin which is rarely found in most of my crops, especially because I'm not using fertilizer." (a modder can place clear or not-so-clear challenges ahead of a player trying to pull of a certain feat eg. working without any sunlight)
Anyway, I thought that one way to overcome the high-satisfaction low-nutrient foods problem is to take over-satiation out of the equation entirely. Just have a raws-defined limit of how much of each 'nutrient' a certain creature can hold in their body before any additional intake is ignored. So Urist McScurvy may run off and eat a whole bunch of vitamin-c containing plants, beyond what a normal hungry dwarf would do, gain his needed amount of vitamin-c (and not suffer constipation for pigging out on the only findable vitamin source). Just to keep things a little simpler. So, dwarves will consume all they need, but may start 'wasting' food if they get deficiencies. In fact, this isn't too far off from how people instinctively sometimes handle deficiencies, except for IRL we do get constipation, vitamin overdoses and/or other ailments from over-eating.
Heh, thinking of it, if you do put over-satiation effects into the mix, you could lay the framework for drunkenness in the game. The over- and under-satiation effects on a creature could be defined by a single mechanism (ideally in the raws).
One thing to consider, from an implementation complexity point of view: If a nutrient system, or other reasonable food system for that matter, is ever to be implemented in Dwarf Fortress, it will have to follow the "embrace and extend" path to get into the game. DF is too complex to just rip out the old system entirely and code up a new one, IMO. So I'd say suggestions should be, at least to some extent, put in terms of existing structures, instead of trying to reinvent too much (even though that is ultimately desirable).
Kohaku, you should feel ashamed! This is exactly what I was trying to say from the beginning. "Generalization"? "Example"? "Framework"? Maybe it's just my English that isn't so good, or maybe I was vague. But being able to define the nutrient(-classes), their effects and how they are needed right in the raws was what I was getting at right from the start. In fact, I thought you were being sarcastic saying "that's a very good point, which I never even considered".I'd rather not have a static list of nutrients. We need oddball nutrients like ALCOHOL, which only dwarves need, and MEAT for carnivores.
...
Oh, now that's a very good point, which I never even considered. (And after thinking about it, I'm rather ashamed I didn't.)
Creating only a framework, and shoving the whole system off onto the raws allows for exotic systems to be raw-modifiable, gives modders the ability to scale the difficulty level to their own personal tastes, allows different creature types to have radically different diets, and encourages the creation of tangibly different civilizations.
Exactly. This kind of stuff is peanuts compared to (eg.) the order of complexity of temperature checks as it is currently implemented. Even more so if hunger/nutrient checks are set to compute every N frames instead of every single frame.In that case, I think you don't quite realize what sorts of "math" is actually killing the processor speeds right now.Ok, so I googled 'A* pathfinding' and while I knew it was a costly source of CPU usage, it's a bit worse then I imagined and I can see why that is infinitely more demanding then what you are proposing.
Less than 100 dwarves with a relatively simple 6 or so variable check, and with the potential for reducing the rate at which checks are made to every 10 frames or 20 frames so that that fiber thing I was talking about can properly work in an integer math situation is absolutely nothing in terms of complexity compared to A* pathfinding or temperature checks.
I entirely agree with Kohaku here, being one of those players that take a middle path between obsessive 'completionism' and being totally indifferent towards small benifits and cosmetics. I used to be more of a "completionist", but DF is in fact one of those games that helped me see how futile and tiring obsessive gain maximization can be. That, and growing utterly tired of collect-and-complete game genre. So yeah, I'd say add in the little benefits, let the system help the player a little more often than it creates game-problems (ie. nutrient deficiencies) for them.It's important that there are no effects until they're in the red zone--there shouldn't be obscure benefits for micromanaging your diets or players will feel obligated to do that. It should be enough of a challenge when you can't just feed everyone plump helmets all the time.On the contrary, having a "better foods means that dwarves will need to take breaks to eat marginally less often" is something that most players will probably not feel a need to maximize.
There is no "completionism" in DF - some players are obsessive about making their fortress floors and walls all of one proper color and symmetry, and others will leave their stone out in the halls and never bother move anything or engrave a single wall outside of their noble's rooms.
Actually, it's not completely the other way around. AFAIK the carbohydrates found in vegetables and fruit tend to be more complex and longer lasting, but they occur in vastly smaller quantaties than in say, corn, so fruits are generally not enough to keep people going energy-wise. Proper pasta is an example of a food that contains a high amount of fairly complex carbohydrates. And before foods became as refined as today, even average bread could give you plenty of long-lasting carbs.Like that. I'd almost want to nix calorie intake for the sake of simplicity, assume every meal a dwarf consumes is in sufficient quantities, I don't want to have dwarves subsisting on high density foods to become hungry later then lower calorie foods. So having a lot of plump helmets and vegetable type foods would just have dwarves running to the pantry every few minutes and players would insist on stocking nothing but tallow stew to keep their dwarves working at the furnaces. Or calorie intake requirements depending on how much exercise and work the dwarves are doing.Actually, it's the other way around - vegetables which have large amounts of fiber and complex carbohydrates take longer to digest, and make the body feel fuller longer, while simple carbohydrates (sugars) and fats are easily digested, and make the dwarf feel hungrier faster.
Too complicated and too much math and tracking with that, I think. I'd suggest that perhaps caloric intake would be similar to fat intake and it'd effect their weight, if they are belarded with untold layers of fat or not. Intake requirements would be based on their attributes. Superdwarvenly Strong dwarves would be more susceptible to calorie deficiency and would lose fat (then strength) unless sufficiently nourished. Which makes sense.
...
Quote
Also, this isn't complex math for the player to add in something like a "dwarves get hungry again faster on a diet of french fries", it's slightly more complex going on under the hood, but the player doesn't need to keep track of the math going on in the background.Yes, it makes sense. It should all ultimately work quite intuitively.
But even our modern day societies do not have the complete picture when it comes to nutrition, what more to say about a medieval society. So I'd say that even though the basic information should be easily visible to the player (foodstuffs and their avg nutrient densities, how they compare, what is a default/canon dwarven diet, a few interesting exceptions) there should still be a mystery-factor here and there that could take figuring out. "What is bothering my dwarves? Why is this one so agressive. Why are they having trouble concieving?" ... "Oh, this working environment has this bad effect on them which is only supressed by this vitamin which is rarely found in most of my crops, especially because I'm not using fertilizer." (a modder can place clear or not-so-clear challenges ahead of a player trying to pull of a certain feat eg. working without any sunlight)
Anyway, I thought that one way to overcome the high-satisfaction low-nutrient foods problem is to take over-satiation out of the equation entirely. Just have a raws-defined limit of how much of each 'nutrient' a certain creature can hold in their body before any additional intake is ignored. So Urist McScurvy may run off and eat a whole bunch of vitamin-c containing plants, beyond what a normal hungry dwarf would do, gain his needed amount of vitamin-c (and not suffer constipation for pigging out on the only findable vitamin source). Just to keep things a little simpler. So, dwarves will consume all they need, but may start 'wasting' food if they get deficiencies. In fact, this isn't too far off from how people instinctively sometimes handle deficiencies, except for IRL we do get constipation, vitamin overdoses and/or other ailments from over-eating.
Heh, thinking of it, if you do put over-satiation effects into the mix, you could lay the framework for drunkenness in the game. The over- and under-satiation effects on a creature could be defined by a single mechanism (ideally in the raws).
I think it's important for this not to require micromanaging what each dwarf eats, which means they have to be smart enough to eat a balanced diet on their own. With the system I outlined above, it could go something like this:Yes. Something along those lines. As we established, all the constants in such a system should be editable in the raws. There could be threshold levels defined for nutrients (which I'd still say should all be treated as generally as possible) below which the creature will start to look to fill up that nutrient in some way like what irmo explained there. From a few such constants 'nutrient priorities' can be inferred by the engine. Obviously, the adverse effects of going into the 'red zone' should be defined seperately. Eg.
- Energy and water are special, because they regulate the process.
- When Urist's energy drops below 1/4 of full, he'll finish his current job and then get a meal. Note that there are no ill effects at this point--energy shouldn't have a starvation syndrome until it's at zero.
- Suppose that when Urist goes to eat, his protein gauge is at 10%, his calcium is full, and all the others are somewhere in the middle (except energy, which is at 1/4). Protein's the lowest, so that's what he wants to eat.
- So he finds several food items containing protein, trying to avoid duplicates (for diversity) and any that contain calcium (because his calcium is maxed) and to include any of his preferred foods that qualify. He continues gathering food items until he's assembled a meal whose energy content is enough to get him back up above 3/4 full. Possibly gluttony/self-indulgence traits will affect that number.
- He sits down and eats all of this.
- When his water is at 1/4 of full, he'll go in search of a drink, following the same method, except limited to substances classified as "drinks", and without the "avoiding duplicates" rule. It's normal to just drink water until he's satisfied. Though if something else is lower than his water gauge at the time, he'll try to find a drink that contains that. The usual case of that for dwarves is alcohol.
- Special case: if any of Urist's gauges actually drop below their starvation limits, he'll immediately go find something that has that nutrient and eat it, regardless of energy. This should also generate a warning.
- Special case: hospital caretakers can see their patients' nutrient gauges, and will try to apply the same system when fetching food for them.
This should ensure that each dwarf stays out of the red zone on all nutrients as long as there are no gaping holes in your food supply. If there are, you'll be able to see this on the bar graph (your population is lacking in alcohol, better do something about this) and eventually you'll get warnings on the main screen when they start to suffer starvation.
Code: [Select]
NUTRIENT {
name="Vitamin-C"
defic_effect(defic_percent) { decreaseHealRate(defic_percent); addEffect(effectSCURVY, 2.5*defic_percent); }
defic_threshold[human] = 25%
defic_threshold[dwarf] = 15%
lookfor_threshold[human] = 40%
}et cetera. Sorry if that last bit is very unclear, but I'm not really versed in the art of RAWs, so I just scribbled down my idea in a format I think at least somewhat understandable.
.
) but I'm putting a lot of stress on conceptual simplicity for this idea.
Malicious Bitches FTW!