Mods / Hungry While Injured
Author: traugdor
Side: Server
Created: Sep 21st at 2:23 AM
Last modified: 4 days ago
Downloads: 329
Follow Unfollow 23
Recommended download (for Vintage Story 1.21.2 - 1.21.5):
hungrywhileinjured_2.0.0.zip
1-click install
Ever play with an extremely low health regeneration rate?
And as a result, do you ever think, "Man, my hunger paused while I'm injured? This is kind of broken...", to yourself before?
Do I ever have a solution for you!
This mod is inspired by Smooth Digestion mod, but designed to actually be compatible with other mods.
It's not a hard dependency, but this mod is required for Expanded Stomach to work properly.
This mod is recommended for every version of the game.
Hunger will continue to drain as normal even with extremely low regeneration rates to mimic how an injured person still needs to eat, more so if they are actively healing from an injury!
Planned features (in no particular order):
- Increased health regeneration based on nutrition levels. A balanced diet restores the body faster.
Enjoy!
| Mod Version | For Game version | Downloads | Released | Changelog | Download | 1-click mod install* |
|---|---|---|---|---|---|---|
| 2.0.0 | 34 | 4 days ago | hungrywhileinjured_2.0.0.zip | 1-click install | ||
|
refactored code for 1.21.2 - 1.21.5 | ||||||
| 1.0.1 | 278 | Sep 21st at 3:07 AM | HungerPatcher.zip | 1-click install | ||
|
removed debugging output set to server-only | ||||||
| 1.0.0 | 17 | Sep 21st at 2:23 AM | HungerPatcher.zip | 1-click install | ||
|
Initial release | ||||||
Misteyes
> (None of these details matter for the fix - I checked your PR and it does fix the bug, so I assume the mod is good as well.)
Yes, the source code is on my Expanded Stomach mod. I will probably split it out into it's own repo, but since ES requires this mod as a soft dependency, I will keep them in the same repo. I have a branch that hasn't been merged yet because I'm still working on it but the code is there. :)
traugdor - Yeah, the souce of the damage doesn't matter, but your current satiety does. I suggested starvation damage because it conveniently sets up both conditions for optimal repro (very low satiety and less-than-full health). The rate at which health regerneration consumes
SaturationLossDelay*is proportional to your current satiety. So if you're starving and eat a flax grain, you'll get only 10 points ofSaturationLossDelayGrain, but those 10 points will last a really long time because your current satiety is 30/1500. Meals provide a lot moreSaturationLossDelay*than flax grains do (in fact, in vanilla, everything except pies and cooked meals grants exactly 10 LossDelay, regardless of satiety), but because meals also provide a lot more satiety, your health regeneration will eat through that loss delay sooner, leading to the hunger clock restarting. Flax grains specifically work well because they have the "best" ratio of Satiety to LossDelay in the game.Eating a meal while starving will pause the timer for 1/3 as long as eating a flax grain while starving. Eating a meal while not starving will pause the timer for less time, proportionately with your current satiety.
(None of these details matter for the fix - I checked your PR and it does fix the bug, so I assume the mod is good as well.)
Misteyes I have updated it to say that...sort of. What you point out is one extreme example, but I tested it with a TON of debugging output to make sure that meals weren't the problem and basically what it amounted to was that it didn't really matter where the damage came from (I tested with fall damage) and it didn't matter what food you ate immediately after. All that mattered was that the hungerCounter was going negative, so I put a stop to that.
SeniLiX In all fairness, it's a bit of a difficult bug to spot outside of multiplayer. I'm not entirely sure why. I usually play Blackguard though and it's definitely suspect when the Blackguard is able to go multiple days without needing even a snack! 😂 But like traugdor noted, it's not necessarily a pesky bug, unless you are playing with Expanded Stomach...in which case, players can get unfairly penalized quite easily due to the game assuming they have bad dietary habits, when they don't.
traugdor I stand corrected.
I guess I never encountered (or noticed) this myself.
Hopefully it gets fixed.
"Take damage then eat a meal" sounds like it could plausibly be intended behavior. I recommend changing the repro to say, "Take starvation damage, then eat a flax grain (and nothing else)." This will pause your hunger for multiple in-game days, and is obviously not intended.
SeniLiX this mod is not for the saturation delay given by eating meals. It is for a BUG that causes your satiety meter to pause of an indefinitely period of time (like 5-6 in-game hours!) that is triggered by eating any food after taking damage. I can walk you through the bug and how it works if you want to read below, but there are at least 5 issue tickets on the issue tracker for Vintage Story and 1 pull request (authored by me) that is intended to fix those bugs.
How to trigger the bug
Why it does this:
So to summarize:
This is a real problem, and that is what this mod is addressing.
The pause after eating a meal is not a bug.
It is by design to reward the player into using the meal system.
MrMutant is correct. This mod is a fix directly related to that bug. It is triggered by taking any damage and then immediately eating a meal afterwards.
If you don't find the bug annoying or game-breaking, then you don't have to use this mod, but I designed it specifically to be used with my other mod, Expanded Stomach, because this causes my other mod to think the player is just constantly overeating or not getting any exercise via running, walking, working in the mines or hammering ingots into tools, etc. As a result they start to experience the drawbacks of overeating a lot sooner than they should. This mod fixes that bug in a way that makes my other mod less likely to break.
hopefully this isnt related to the meal pause, but for those that dont know there is a bug that makes hunger pause outside of meals, and even a pretty easy to do "trick" where you eat after taking starvation damage and your hunger wont drain for a couple mins. Possibly a fix for that
you do know your hunger bar is supposed to pause when you eat a cooked meal right?
its one of the benefits of eating cooked meals rather than chowing down on a dozen carrots.
i have never noticed any satiety meter pause that was not due to eating a meal, but i could have missed it.