This mod reworks hunger thirst and/or sleep with associated items to match real life needs (modifiable). Based on research and scientific articles. Don't mind the blood on the preview image!
Features
General features:
- Intuitive values that relate to real life.
- Most values an be changed in the MCM options menu.
- By default you need 2 l of water/day, 2100 kcal/day and 8 h of sleep per day. Values come from high sitting lifestyle.
- In addition to base needs you'll need more food and water depending on how much and how fast you move (walking, running, sprinting).
- Your game will be miserable with default settings (just like in real life).
- You can survive 6.25 days without water, 9.5 days without food when not moving and will pass out (for certain) after 3 days without sleep. Before max values were respectively at 28 h, 14 h and 31 h. However, if you sprint all day long you'll die after 6.9 h and 11.3 h without drink and food respectively.
- Resource caps are now higher (less wasted resources): 12.5 l of water, 20 000 kcal of food and 72 h of sleep (before they were respectively 1.1 l, 1000 kcal and 31 h). Gray indicator is now a reminder not start of penalties.
- Normal values apply only if you are otherwise healthy. Eg. if you don't sleep 8 h/day then you will use more water per day and without drinking or eating you will die from dehydration or hunger in less time. Note that everything is about in-game time. Anomaly 1.5.1 has 6x faster time than in real life.
- LTX values make more sense. Now 1 unit is 1 l of water (before was 0.336 units), 1 unit of sleep is 1 h awake (before was 3.09 h) and 1 unit of satiety is 20 000 kcal (sorry, scale is hardcoded in engine, before was 1000 kcal).
- You can walk (not run which is the default movement) with backpack full even when you are hungry, thirsty and tired. Before in some conditions you would be stuck.
- I didn't touch values that I knew nothing about (eg. drugs, medicine or smokes etc. although I did research and add some nuances). I just scaled those to the new scales.
- I didn't touch item costs. Those can be modified with game difficulty sliders anyways. And sometimes people make wrong judgements and think something is very good if it is in fact pointless in their situation (glucose).
- Non-DLTX version has associated comments with calculations and references in every file.
- I don't chase absolute realism. If I have to choose between fun and realism I choose fun.
Hunger:
- Adult outside of the Zone needs 2100 kcal per day with a sitting lifestyle but you'll need more because of exercise.
- Just being alive burns 100 kcal/h and walking, running and sprinting burn extra 170, 820 and 1670 kcal/h respectively. I didn't include energy loss from carrying weight since the game needs to be fun too.
- You will die after 9.5 days of no food even if you don't move. If you sleep more than 8 h/day you'll die later.
- You lose less calories while asleep so you can postpone death by starvation when sleeping extra. You lose 100 kcal/h while awake and standing still and 65 kcal/h while asleep.
- Maximum stamina (also referred to as max power or max strength) is 20% lower after 48 h without sleep (before it was about the same). Any sleep fully recovers max stamina.
- Milestones: gray icon = 2000 kcal, yellow icon = 6000 kcal, orange icon = 10 000 kcal, red icon = 16 000 kcal, 18 000 kcal energy deficit is the start of small amount of damage, 20 000 lost kcals = death.
- Hallucinations of fleshes when red indicator lights. Hallucinations get worse the more near you are to death.
- I modified everything that had satiety to match real world values according to its mass. Eg. mineral water doesn't give calories but chocolate gives a lot more.
- Modified cooked meats to be consistent with (vanilla) recipes and real life effects. Again everything is based on research.
- You have 3000 kcal fat reserve. Excess energy goes into that.
Thirst:
- Adult outside of the Zone needs 2 l of water per day with a sitting lifestyle (about 1.5 l without food intake) but you need more because of exercise.
- Walking increases water loss (relative to body weight) by 0.3 %/h (150 ml/h), running by 0.5 %/h (300 ml/h) and sprinting by 2 %/h (1.7 l/h). I didn't include water loss from carrying weight since the game needs to be fun too.
- You will die after 6.25 days of no water even if you don't move. If you sleep more than 8 h/day you'll die later.
- You lose less water while asleep so you can postpone death by dehydration when sleeping extra. You lose 100 ml of water per hour while awake (without exercise) and 42 ml/h while asleep.
- Now food contains water. In real life we get 25 % of needed water from food and even peanuts and chocolate have some water that our bodies absorb.
- Exponential damage function starting at red icon. The more thirsty you are the more damage you get. It becomes successively harder to stay alive.
- Milestones: gray icon = 1.5 l of water deficit, yellow icon and start of penalties = 3 l, orange icon = 5.5 l, red icon and damage start = 8 l, 10.5 l chance to pass out and if you do then chance to die, 12.5 l = death.
- Chance to hallucinate when red indicator. Chance rises at 11.5 l.
- I modified everything that had thirstiness value to match real world values according to its mass. Eg. 1 l water gives 1 l water equivalent of thirstiness reduction and 200 g of bread gives 70 ml water equivalent of thirstiness reduction.
- Took into account the diuretic effect of alcohol and caffeine.
- Diarrhea (water loss) from old meat, can of tuna and raw meats. Old meat isn't the best/cheapest thing anymore if you consider water loss. However, the character has a very strong immune system and diarrhea lasts only for a day (balance between engine coding and game fun).
- Cooking makes meat 33% lighter (water loss) and decreases satiety 1.05 times.
- You have 500 ml water reserve. Excess water goes into that but you'll pee the rest after 500 ml.
Sleep:
- You need 8 h of sleep per day.
- You will pass out after 72 h of being awake.
- Now passing out and sleeping that way actually reduces tiredness.
- Milestones: gray icon = 16 h of being awake, yellow icon and start of penalties = 20 h, orange icon = 30 h, red icon = 40 h, 48 h chance to pass out, 60 h more annoying effects, 72 h = pass out for certain.
- Chance to hallucinate when red indicator (40 h). Chance rises at 60 h.
- Added an empirical (not researched) rest function (rest effectiveness is log-norm function so rest gained is like slanted "S"). Sleep is most effective in the middle of the sleep but long sleeps are still more effective than short ones. I made it that way instead of decreasing exponent in order to prevent players from taking three 1 h naps to get their 8 h need fulfilled.
- Sleepiness has smaller impact on stamina. You are able to run when dead-tired and not carrying too much stuff.
- Tweaked energy drink, caffeine pills, Beard's tea and sleeping pills according to research findings.
- Fixed energy drink: now it removes 1 h of awake time (before it was 2x less potent than water).
- Buffed sleeping pills by 15%. Now 1 pill gives 1 h of awake time equivalent for convenience.
Stamina
- I had to tweak stamina values because of the new scale but stamina isn't based on research. I tried to leave things mostly as they were since I don't feel confident with stamina stats (too many variables in a convoluted form). I also tried not to be on the walking simulator side.
- Stamina regeneration is influenced by the 3 needs, movement style and inventory weight (overweight is extra bad). Sprinting with full backpack without drinking and eating will drain stamina quickly.
- It makes a huge difference whether your backpack is 1/3 full, half full, etc.
- You won't get stuck when almost dead due to hunger thirst and sleep (previously you would a long time before death). You will slowly gain stamina when standing still. with 75% full backpack you can sprint about 10 s or run about 15 s and recover in 40 s.
- When backpack is 75% full and all stats are half-way to the end then you can sprint about 10 s or run about 40 s and you will regain stamina in 15 s when standing still.
- When all needs are satisfied and backpack is 75% full then you can sprint about 25 s or run infinitely. If backpack is 50 % full then you can sprint for 60 s.
- Stamina might not be balanced if you use only one of the stats install. I calculated and somewhat tested only the "everything" version.
More fun facts (both in real life and in game)
Food:
- Cooking shrinks meat mass by 33%
- Considerable amount of ethanol remains with cooked food (after 30 min of cooking at least 10%).
- Cooking reduces kcals by 10% in birds and 5% in land-animals
- Cooking is good for plants because it makes them easier to digest (higher kcals) and for meat because it kills bacteria.
- Body uses about 5% of kcals to convert food into glucose therefore glucose gives about the same amount of energy as same mass of sugar.
- Primarily point of glucose injection is to get energy fast.
- Tobacco and marijuana smokers eat tiny amount more.
- Alcohol doesn't increase appetite and probably just leads to higher energy intake. However, there's no clear evidence for the latter.
Water:
- 1 ml of pure alcohol removes 10 ml of water.
- Low % alcohol (beer) actually hydrates. Sure you pee more but you still keep some extra water. Also beer has minerals in it so that improves its hydration in Stalker sense.
- With normal diet 25% of water intake comes from food.
- Food doesn't dehydrate. Your mouth may dry when you eat crackers but in your whole body nothing changes or you even gain water. Think about eating cucumbers and extrapolate to sausages.
- Diarrhea increases amount of shit (normal is 100 g) from 100 to 1500 g (excess water) depending on severity.
- You pee 1.25x more with energy drinks (400 mg of caffeine).
- Some poor lady did a painful suicide by dehydration. It took about 9 days.
- Adult has about 7% of his body mass as blood.
- 2% of blood volume loss per minute is heavy bleeding.
- Usually people die when they have lost 40-50% of their blood.
Sleep:
- 400 mg of caffeine = 1 h of extra awake time on average
- If you drink coffee in the morning about 20 % of caffeine is still in your body in the evening.
- People don't feel when they have sleep debt (they get used to it) but performance is lower.
- Alcohol consumption decreases sleep quality.
Similar mods
Those mods did similar thing with different values and goals. Check them out too!
- Tkcrits' Immersive sleep - It makes too much sleep impossible. My mod needs to overwrite Immersive sleep and patch needs to overwrite my mod.
- PossuM's FAMINE - Food Economy - it balances foods and makes game harder. Unfortunately attempts similar thing from different angle so files conflict. It would require a large joint effort to combine the features of both mods.
- PossuM's TRAUMA - Health Item Rebalance - it balances medical items. In strict sense that mod isn't compatible but the only problem is that hunger, thirst and sleep scales are different (well that and my calculations about caffeine and glucose). PossuM told me not to make a patch yet.
- Arszi's Thirst overhaul - Included in this mod and patrially taken over/modified.
- TheMrDemonized's Advanced Stamina System (ASS) - modifies stamina somewhat (apply the patch).
Conflicts
I'm willing to look into conflicts and make some patches but I need your input. I won't patch the whole Moddb on my own initiative just because maybe someone wants something someday.
- Soft conflict (no crash): everything that adds new items that have hunger, thirst or sleepiness values. They are probably using the vanilla scale so eating 2 cans of (new) chilli would drain (Vanilla behavior) approximately 2 l of water from you. Just need to multiply hunger, thirst and sleepiness with appropriate constant. By default the respective constants are 0.05, 0.11174 and 0.32323.
- Soft conflict: everything that tries to modify hunger, thirst and/or sleepiness values in item_*.ltx files and actor.ltx. Problem is with different scales and balance but why would you install my mod if you plan to overwrite it?
- Conflict: everything that tries to modify actor_status*.script (* is a wildcard character) files. In case of conflict with actor_status.script (without *) merge/overwrite my changes into the other mod.
Patches/merges/already contained
- HyperionSTG's Exact satiety, hydratation and sleepiness status. Overwrite with my mod and and apply the patch.
- Bvcx's Hunger, thirst, sleepiness bars. Overwrite with my mod and you have the functionality of both. As of v0.71+ you also need to apply my patch.
- Legapon's Patch Hunger, Thirst, Sleepiness Bars. Overwrite with my mod and you have the functionality of both.
- Tkcrits' Immersive sleep. Overwrite Immersive sleep with my mod and then apply the patch! Patch includes also Food drugs & drink animations patch for Immersive sleep.
- Artifax's Outfit Attatchment Overhaul's Github newest version 1.3 (2022.01.24): Github.com. Overwrite with my mod and apply the patch.
- Arszi's Dynamic Radiation Zones and Radiation Overhaul V2.1 thirst features are included (switch on through MCM). Bleeding and movement have been incorporated properly in v3.0.
- BudBone's Food Drug & Drink Visual Accuracy Tweaks v2. Apply the patch.
- Bazingarrey's Actor Rework V1.21 (default version's Actor Rework V1.21 version). Apply the patch. Didn't merge changes to stamina drain because that would mess up my stamina calculations.
- TheMrDemonized's Advanced Stamina System (ASS). Apply the patch)
- Bvcx's Cold System 0.6. Apply the patch.
Installation
Use mod manager or drop and merge gamedata folder to Anomaly main folder. Works with old saves but needs might be initially different (different scale). You could just satisfy your needs completely before installing but not strictly necessary.
- Choose type. Pick DLTX or non-DLTX version. DLTX version requires you to install DLTX (https://www.moddb.com/mods/stalker-anomaly/addons/dltx-differential-ltx-loading) but is compatible with mods that change other aspects of the LTX files (this version merges LTX files). Non-DLTX version is an ordinary mod, it simply overwrites the files.
- Choose sub-mod. Pick which part (hunger, thirst, sleep or everything) you want. If you don't pick the "everything" version then values are changed only for the picked characteristic (hunger, thirst or sleep) and everything else remains the same as in vanilla. Meant to be played with everything and otherwise stamina might not be balanced.
- Install. Drop the picked sub-mod's gamedata folder from into Anomaly's main folder or enable it from the Mod Organizer 2. If you don't set the priority to my mod then it's pointless to install (balance will be off if something overwrites my files).
- Install standalone addons. Drop the standalone's gamedata folder into Anomaly's main folder or enable it from the Mod Organizer 2. IMPORTANT!: if you install new items you probably can't uninstall them without starting a new game.
- Add patches. Add relevant patches depending on the mods you use.
- IMPORTANT!: when updating this mod from v2 to v3 redefine variables in MCM ("default" and then "apply"). If you don't do that then previous version values are used in the new system. Some things will break.
- Uninstall. Revert the files back to previous version or delete them to revert them back to vanilla. Or just disable the mod and patches from Mod Organizer 2. Again this might result in different needs (different scale).
How did I do it?
A month of article hunting, coding and calculating. It all began from the fact that I tried to make LTX values better understandable (1 unit = 1 l of water). Then I thought that while I'm at it I could scale the values more realistically. Then I had to recalculate everything in LTX files that touched hunger, thirst or sleepiness. That grew into higher resource caps and research and so on. Eventually the mod grew into this beast.
I also tried to make hunger more universal but after digging through engine code it became too big of a hassle. I could have done it only by intercepting all communications between LUA scripts and engine code. As of v2 some hunger features are editable through MCM. I made it possible by recalculating stamina and satiety periodically.
Possibilities for improvement
- Balance item costs? I really don't know whether I broke the generic balance or not. Definitely foods and drinks cost more per day now due to increased needs.
Final words
You can modify my changes or ideas in any way you want but if your mod bases largely on my mod then please give credit. If you find problems, bugs, conflicts or generally annoying things then write them in the comments! I haven't had much time to actually play Anomaly so it's possible some bugs slipped through my testing. Finally I did get some inspiration from mentioned mods, included Arszi's thirst features here and used some of Anomaly devs' code.
Used scientific articles
I made sure that everything is accessible with at least 1 click. Nothing is behind a paywall. In non-LTX version files have comments that have those references. It's easier to read comments from files than to read all the articles here. There's an article from which I calculated the kcals of snork hand (human meat). Go on, find it, its a dare!
Nutrition:
Water:
Rest:
Changelog
v1.0:
- First release for hunger, thirst and sleep
- Didn't touch radiation, alcohol sleepiness nor health
- Stamina isn't as good as I'd like but then again it also isn't worse than before.
v2.0
- Added MCM support with most values being editable. Input type options currently don't work in MCM so these are replaced with sliders. Russian speakers can enjoy the wonders of Google Translate.
- Less hardcoded variables and some extra variables for user comfort
- Tested only the biggest things in "everything" version
- Added a patch for Artifax's Outfit Attatchment Overhaul's Github newest version 1.3 (2022.01.24): Github.com. Apply the patch and overwrite with my mod.
- Included thirst features from Arszi's Dynamic Radiation Zones and Radiation Overhaul V2.1 in the files (by default switched off). If you want the features then switch it on from the MCM menu! You can merge the mods with DLTX (items and other features) but let my mod overwrite Arszi's!
- Added a patch for Swergdach's Artefact renovation.
v2.1
- Improved patch for HyperionSTG's Exact satiety, hydratation and sleepiness status
- Fixed MCM variables resetting on game load
v2.2
- Added Spanish translation. Spanish speakers can enjoy the wonders of Google Translate.
- Fixed some cooked foodstuffs that didn't inherit correct values
- Food kcal descriptions change with MCM multiplier for satiety
- Fixed the 3 MREs' descriptions for new kcals (for default values, the text is hardcoded and won't change with MCM multiplier)
- Added a patch for Tkcrits' Immersive sleep v1.2.1 (didn't change script logic). Overwrite Immersive sleep with my mod and then apply the patch!
- Added a patch for Fillable canteens 0.4.7 (weak diarrhea from dirty water)
- Added a patch for Arszi's Campfire roasting
- Couldn't test everything (v2.1 stays as a backup)
v2.3
- Fixed a comment typo (":" instead of ";") in LTX files. dltxify-ing the files (DLTX version) added an empty section which crashed the game.
- Changed my patch for Immersive sleep so that it includes also Food drugs & drink animations patch for Immersive sleep.
- Added a patch for BudBone's Food Drug & Drink Visual Accuracy Tweaks v2
- Added a patch for Bazingarrey's Actor Rework V1.21 (default version's Actor Rework V1.21 version). Didn't merge changes to stamina drain because that would mess up my stamina calculations.
v3.0
Just in case back up your save game before applying this mod! IMPORTANT!: you need to apply default values in MCM and tweak the settings again if you have used this mod before. I don't know how old savegames behave with mod updates but I didn't get any immediate crashes.
- Took movement into account for hunger and thirst. Base needs are lower (2100 kcal/day, 2 l water per day) but movement increases needs according to movement type (extra needs: walking - 170 kcal/h and 0.15 l/h, running - 820 kcal/h and 0.3 l/h or sprinting - 1670 kcal/h and 1.7 l/h).
- Introduced water (0.5 l) and food (3000 kcal) reserve. Eg. now you can build some fat reserves and still die when lacking 20 000 kcals. If you're fat it'll take longer to die.
- Researched bunch of stuff (satiety and sleepiness from alcohol, ethanol retention in cooking, water loss from movement, bleeding amount etc).
- There's speculation but no clear evidence for long-term energy gain from alcohol. Therefore, I divided alcohol satiety gains by 2 (except for 3rd tier meats since ethanol content is lower).
- Alcohol consumption decreases sleep quality but there aren't clear numbers. Calculated sleepiness increase to be 1 h per 75 g of ethanol (3 h from a bottle of 40% vodka).
- Previous estimate for ethanol retention with cooking wasn't far off so I didn't change LTX values.
- Heavy bleeding (hit from sniper round) drains 126 ml of water per minute. Max bleeding can be 420 ml/min (do not confuse with bandage bleeding reduction, it's a different thing).
- Changed Arszi's water loss from bleeding to be correlated with bleeding amount not game difficulty. Also added an MCM variable to tweak that value.
- Reworked hunger and thirst variables from hour-based to liter-based system (movement calculations are more transparent).
- Adjusted thirst damage function to take into account MCM value changes.
- Added optional install for new 4x bigger foodstuffs (essentially copy-paste from original foodstuffs). Those are 2 tiers more rare. You probably can't uninstall this during active save unless you are prepared to start a new game.
- Tested only very basic things. You can expect some bugs.
v3.1
- Fixed MCM values resetting on game load. Problem was that I had to read MCM variables during actor_on_first_update instead of load_state callback.
- Improved my patch for HyperionSTG's Exact satiety, hydratation and sleepiness status. Now thirst amount in item descriptions isn't hardcoded to default MCM values. Added also precise sleep amount in item descriptions.
- Removed a duplicate vodka from standalone bigger foodstuffs. If you have used the standalone before then don't update the standalone unless you want to start a new game!
v3.2
- Fixed tushonka's satiety value (2.4 times more nutritious). Mistake came from misunderstanding "corned beef" meaning in kcal calculator.
- Added a patch for TheMrDemonized's Advanced Stamina System (ASS) (update 8).
- Changed utils_ui.script into a monkeypatch which is loaded last in script load order. Patches for Ishmaeel's Nitpicker's modpack - StatsDisplay and Swergdach's Artefact renovation are now redundant.
v3.3
- Made eat_satiety magnitude (multiplier that modifies cosmetic kcals) be changed on first update and after a pause. Before it was overwritten by some mod that changed stats_table on first update.
v3.4
- Fixed a crash because stats_table wasn't initialized before monkeypatching it. Luki_Hofi helped to test and fix the bug.
v3.5
- Fixed dehydration regenerating health instead of draining it. The problem was a missing minus.
- Fixed hunger calculations acting weird on sleep. Also now there's more (but also correct) hunger drain with sleep. The problem was that I didn't update last_chk_2 on sleep and didn't account for hours slept.
- Fixed fat reserve calculations being off. The problem was that I didn't account for the satiety changes that take place in the engine.
v3.6
- Fixed satiety multiplier not changing kcals amount visually.
- Fixed patch for HyperionSTG's Exact satiety, hydratation and sleepiness status. Satiety multiplier doesn't modify its shown value anymore.
v3.7
- Updated for Anomaly v1.5.2 (status indicator fix).
- Updated patches if parent mod had updated. I advise to do a clean install for them, especially for OAO patch.
v3.8
- Fixed passing out every time you drank if you were deep in red indicator range.
- Added patch for Bvcx's Cold System 0.6.
- Added patch for Bvcx's Hunger, thirst, sleepiness bars 0.71. It's not for Legapon's "Patch Hunger, Thirst, Sleepiness Bars" (patch for that is included in the script already).
After I install version 3.2 my character keep hungry and keep see hallucinations spawn around me need to back to version 2.3 now I have Nits stats display install
Wait are you talking about updating from 3.1 to 3.2? I didn't change anything that touches satiety decrease speed in the update.
In case you're talking about updating from v2 to v3 then you need to redefine the MCM values. Step 6 from installation: "IMPORTANT!: when updating this mod from v2 to v3 redefine variables in MCM ("default" and then "apply"). If you don't do that then previous version values are used in the new system. Some things will break."
Should this come before or after Hunger, Thirst Sleep UI addon in load order because I'm getting some very low values for kcal (like 20kcal for fat bacon)
My mod should be after the UI mod but that doesn't affect the kcal values.
There is probably some other mod that uses a monkeypatch to change stats_table in utils_ui.script. I can't help much more with current info. You'll have to scan the code of your installed mods for the monkeypatch. Although if you're using Nitpicker's Modpack - StatsDisplay you can try setting the "magnitude" of "eat_satiety" to 20000. I don't think it will do anything but I don't have time to test it. If that does in fact solve the issue then I removed the patch too hastily and please let me know!
Basically in your game the utils_ui.stats_table["booster"]["eat_satiety"]["magnitude"] value is the default value of 1000 instead of 20000. This kcal value multiplier is purely cosmetic so you can still play with the mods like they are.
Alright thanks for the reply, I've fixed it now after changing the load order. Wonderful mod
Did you find out what mod changed the shown values (which mod did you have to put before/after my mod)?
I also updated to v 3.3 because I got the same issue with some other mod (although load order wouldn't have mattered).
idk it's just me but food had extremely low kcal intake like just 5 or 30, but it's kinda fix itself after moving the slider on the mcm but it's like to revert back to the low intake after reloading saves, it is something with the installation or the mod priority?
I'm not an authority and so it's best to wait and hear from the author, but it may be that certain values get coded into the save files - based on your description I'm just thinking you may be reloading earlier saves from before you made the changes, hence the revert.
i thought of that too, but the weird thing is after i tooling with mcm until the kcal in the correct value, proceed by saving it, it will return to crazy low kcal value after reloading that same save file
again, I may be talking entirely out of my behind here, but since I'm assuming you're using a DLTX version, the addon doesn't actually override physical code, so it sounds like maybe there is another mod that you're using that overrides this addon. May be the load order or a setting somewhere. My three cents.
I'll try to help you and/or find out whether I've made an error.
Long story short (from what I gathered): not a problem with LTX files, food nutrition has nothing to do with save data, probably an issue with some monkeypatch in another mod or a problem with MCM installation itself.
Firstly tomatoes have 46 kcals (approx 30 kcals if you meant that) because tomatoes just have that low nutrition even in real life. You'd have to eat until your gut bursts and you still wouldn't have filled your daily needs. So I'll talk about more standard food: bread.
Bread has 411 kcals (doesn't matter which one). In case you are seeing 20x lower value (21 kcals) then it's purely cosmetic and hunger calculations are (probably) still working as intended. In that case some mod is interfering with the utils_ui.script monkeypatch (see my reply above to Nashakpd on may 18).
As for MCM settings reverting on game load I don't have a good explanation. MCM settings should be persistent between saves (tested it). Maybe you are using an old MCM version? Also I made a mistake which resulted in this kind of behavior with this mod but it was really long ago (v2.1 fixed it). So check if you have the latest versions of things. Otherwise the resetting sliders (the actual sliders in MCM menu) has to be some sort of mod conflict.
If the low satiety values are a mod conflict then this has to be script conflict (might be a sneaky one with monkeypatches) because default eat_satiety values are ca 20x lower in LTX files with my mod. So if LTX files are overwritten but script is working properly then you'd have ca 20x higher nutrition or if everything is broken then you'd have approximately vanilla values. So I'd rule out an issue with explicitly DLTX.
Just in case: are you using the latest "everything" version and have applied my patches if you use relevant other mods? In case you are using eg only "hunger" version then let me know. I might have overlooked something because my version control is **** and I just copy-paste relevant stuff from the "everything" version into others.
Now I'll give you the explanation how a satiety value is formed. First you have some value in the appropriate LTX file. This usually ranges from 0 to 1 because it's clamped like that in the engine. Now if you eat the thing then engine adds the LTX value to your satiety. My hunger script "intercepts" this calculation (more like adds/subtracts stuff after the calculation) in the function actor_status_hunger_Banjaji.actor_on_item_use(). So if you have satiety multiplier set to eg 2 then you should get 2x more kcals. My code finds the value you should get and the value you actually got and then adds the difference. When hovering your mouse over a food item it shows the LTX value multiplied with utils_ui.stats_table["booster"]["eat_satiety"]["magnitude"]. The latter is modified by my script every time you modify my satiety multiplier in MCM settings so the kcals value updates when changing MCM values.
The question now is where the satiety multiplier comes from. At first MCM reads default MCM values on game start and probably checks some file for your previous settings (haven't looked it up). Up to now MCM values have nothing to do with the actual game. At some moment my script is loaded. There are the same default MCM values that are initialized as the variables that are used in the script. In case MCM isn't installed then nothing else happens and those variables stay as they are. If MCM is installed then my script modifies the script variables into the MCM values when you load a game/start a game (I didn't do that in v2.0 and it resulted in script variables but not MCM sliders resetting on game load). Every time you modify MCM values then the script variables are overwritten with the new MCM values.
So if your MCM sliders themselves reset on game load then it has to be something interfering with MCM and it might not even be about my mod. Then it might be that MCM can't access your previous settings file or something. However, if the sliders are where they are supposed to be but the actual satiety values are different then it's more probable that there's an issue in my mod or a conflict with my mod. So in this example you set the satiety multiplier slider to 2x and bread shows 822 kcals, then load game and slider is still at 2x but bread shows 411 kcals.
Useful info would be whether the math works as intended and it's just cosmetic thing. You can do that by installing HyperionSTG's Exact satiety, hydratation and sleepiness status. Overwrite with my mod and and apply the patch. Then you can see how much satiety you actually get from eating something.
I got the bug where tushonka shows 30 kcal (20x less). I found that some mod monkeypatches stats_table on first update so my last-on-load-order script was still overwritten. The problem was indeed only cosmetic. I fixed it in v3.3.
However, in case your sliders reset after load then you still have some kind of issue.
You may remember me as the guy who friendlily criticised the "scientific real life values" approach to game modding. Just back to say you have made an absolute beast of a mod. It's fantastic, the MCM menu is something to behold and so I offer my big thanks for such gem; you did it the right way and it must have taken a while. A 10/10 friend.
EDIT: Incidentally, I seem to have noticed that since installing, my stamina seems to be pretty heroic regardless of full backpack etc. To be expected or something I should check?
I am using the DLTX version, had no issuses with conflicts of any sort otherwise and used patches for arszis radiation overhaul and campfire roasing.
-
Thanks! It took me a full month of coding and researching with little sleep.
When I did the stamina calculations I made them so that you could still barely walk (not run) when you are almost dead/passed out from hunger, thirst and sleepiness. This means that in ordinary gameplay while you have satisfied your needs you will have more stamina than in vanilla.
After I did the calculations I noticed that in vanilla settings (settings => gameplay => gameplay diff.) you also have a slider for stamina drain "stamina loss factor". That one is by default set to 0.2 or 0.4 (maybe the default value depends on game difficulty on start). This is probably why you have a lot of stamina. Set that to 1 and my calculations should be correct. That means more stamina than in vanilla and you won't get stuck in place because your stomach is growling but not quite heroic amount of stamina.
If you want the vanilla feel back then you can also tweak the "multilier for stamina gain from satiety" and "multiplier for stamina loss from thirst/sleepiness" values in my mod's MCM menu.
You're a legend. I most definitely not want the vanilla - that balance was completely out of whack and more annoying than in any way realistic or fun, in my opinion. What you said of stamina makes sense and I will experiment to see where it's best for me.
Incidentally, I took a month or so to do my one and only epic game mod ever myself. May not be your visual taste naturally, but check it out if you haven't already. There's an update with small but meaningful refinements coming very soon, ironing out some minor rough edges. It's a total weather and post conversion for anomaly called RAW: Moddb.com
Thanks for your work again, really a pleasure to see such mods in action.
Updated to v3.3. I modified the monkeypatch for utils_ui.script so that eat_satiety magnitude would be written to 20000 after a pause on first update. In short: less possibility for low (cosmetic) kcal values so less conflicts.
to clarify thirst changes in short - I gather it is expected to have water indicator last for much longer than vanilla, but also that it takes many drinks of water to fully fill it? As if the scale of it has changed, am I right?
Yes, indicator lasts longer (eg time for it to go from gray to yellow) but also you need to drink more to satiate your thirst (eg liters needed to go from yellow to gray). You can modify both in MCM. Water loss comes from "base amount of liters of water needed per day" and "extra water loss when walking/running/sprinting". Water gain comes from "multiplier for hydration from food and drink". Penalties and when indicators turn on can be controlled with "lost liters of water until..." settings.
By default gray indicator turns on when you have lost 1.5 l and yellow turns on when you have lost 3 l of water. That means you need to drink 3-1.5=1.5 l of water (1.5 full flasks a.k.a 5 sips) to go from yellow to gray. So you still need to keep drinking to keep up with your needs although indicators aren't switching fast.
Great, and yes - that's what I begun to gather, despite initial alarm of drinking multiple bottles and seeing no difference to the meter.
Is it also correct to say that there as a sort of a delay between eating/drinking and it being acknowledged by the hunger/thirst meter, or will the exact change always reflect on the meter instantaneously?
Sorry for the questions, just testing and ensuring there's no bugs and behaviours are intended. As of now I am seemingly hitting a hard wall with hunger, where I eat multiple cans of stuff and the meter won't budge.
There's no delay in the math in the background. If your satiety was 0.6 and you consume something that gives 0.2 then you will have immediately 0.8 satiety value (0.8 is 0.2 from max which means 4000 kcal lost). Another thing is whether graphical meters show this exactly like it is.
If you're using "hunger, thirst and sleepiness bars" mod (either the old or new one) then eating/drinking doesn't always show on those because they increase in steps. If you're using HyperionSTG's "Exact satiety, hydratation and sleepiness status" then the changes should reflect immediately in the numbers. Keep in mind that you need to install my patch when using the latter (see Patches/merges/already contained and installation sections on this page).
Also if you have lost eg 3.01 l of water (by default yellow indicator switches on from 3 l) and you drink then the indicator immediately switches to gray.
I am using the hunger thirst and sleepiness bars, so that would probably explain why I see no food changes after a few meals. Thanks for clarifying.
just updated to v3.3 and this happen, this also happen in the fresh installment
FATAL ERROR
[error]Expression : <no expression>
[error]Function : CScriptEngine::lua_error
[error]File : ..\xrServerEntities\script_engine.cpp
[error]Line : 191
[error]Description : fatal error
[error]Arguments : LUA error: ...a\scripts\zzzz_utils_ui_monkeypatch_satiety_scale.script:6: attempt to index field 'booster' (a nil value)
stack trace:
Wow that's weird. stats_table isn't initialized or has been deleted in utils_ui.script by the time my mod tries to modify it (after first actor update). For me it runs fine. Do you know if you have mods that change utils_ui.script somehow?
as you can see on the top, i have 2 version one is the modified one, is the one is full of mods and stuff, the second one is clean installation.
yeah both of them crash on me, had to revert back to 3.2 again
Edit: Ah, I misunderstood "clean installation". You were talking about having this as the only mod while I thought that you deleted files from previous version before installing v3.3. Now I got the same crash when having my mod as the only one that's installed. I didn't get it before because another mod on my side (Nitpickers modpack - StatsDisplay) instead prevented the crash.
Luki_Hofi contacted me and gave a solution to the crash. I tweaked the code a bit and will update the mod on Saturday or Sunday. Soda_Panic, could you test the code in the meantime and tell me if it seems to work without new bugs? For that please replace the contents of zzzz_utils_ui_monkeypatch_satiety_scale.script with the following:
-- Overwrite satiety magnitude every time inventory is opened just in case
ui_inventory.UIInventory.ResetBase = ui_inventory.UIInventory.Reset -- save the original method
ui_inventory.UIInventory.Reset = function(self, obj)
ui_inventory.UIInventory.ResetBase(self, obj) -- do the original stuff
utils_ui.stats_table["booster"]["eat_satiety"].magnitude = actor_status_hunger_Banjaji.get_max_kcals() -- overwrite the magnitude just in case
end
-- Initializes the stats_table and overwrite satiety magnitude (eg for spawn menu)
function actor_on_first_update()
utils_ui.prepare_stats_table() -- initialize stats_table if necessary
-- This function gets called on first update but after a delay
function this_is_certainly_executed_last()
utils_ui.stats_table["booster"]["eat_satiety"].magnitude = actor_status_hunger_Banjaji.get_max_kcals()
end
CreateTimeEvent("Satiety magnitude pause","pause",1,this_is_certainly_executed_last) -- pause before running the function
end
-- Registers callbacks
function on_game_start()
RegisterScriptCallback("actor_on_first_update",actor_on_first_update)
end
apologize, but i dont want to temper with this script first, also i'm not good at it.
dont worry i can wait until the next patch is drop
Updated to v3.4. Fixed the crash introduced in v3.3. The cause was that stats_table wasn't initialized before I edited it with monkeypatch. I didn't get the crash because another mod initialized it for me. Luki_Hofi helped to test and fix the bug.
I think dehydration damage is bugged. I am not taking damage at all when I am significantly dehydrated. It seems to do the reverse as a matter of fact. My health actually regenerates faster the more dehydrated I get.
Thanks! I had made a mistake and a minus was missing. I'll fix it with the next update.
You're welcome.
While doing more testing of features of the mod, I believe I found another bug, probably also pertaining to a missing minus value. It seems that sleeping for long periods of time seems to reduce hunger. This seems to occur regardless of what the "satiety loss awake to asleep ratio" setting is set to. May want to look into that one as well.
Correct again. Thanks! This time the problem was that I intercepted correctly the engine calculation for satiety loss on sleep (with actor_on_sleep()) but I didn't increment the time check for a new satiety intercept (for actor_on_update()). So actor_on_sleep() modified satiety and then actor_on_update() modified it again using a huge time increment.
There was actually another bug that I didn't multiply the sleep satiety decrease with slept hours so you always lost 1 h worth of satiety. Now sleeping depletes satiety correctly (unless there are more bugs) and being well fed is even harder.
By the way "satiety loss awake to asleep ratio" only sets how much satiety you lose while awake compared to sleeping. You'll still lose base amount of kcals per 24 h (assuming you sleep the required amount) but the previous setting simply modifies whether you'll lose more kcals during day or during sleep.
Updated to v3.5. This update brings 3 bugfixes. The most noticeable is that now sleep burns more kcals than you're used to (before it was unrealistically low or even increased your kcals).
Is it somehow possible to edit the actor.ltx to not consume stamina or at least lower stamina consumption when slow walking?
Yup. "Slow walking" is "walking", normal movement is "running" and fast running is "sprinting". You can edit that under "[actor_condition]". The variable relevant for movement are walk_power, walk_weight_power, overweight_walk_k, accel_k and sprint_k (lines 246-251 in this mod's actor.ltx).
walk_power is the stamina loss when not carrying anything,
walk_weight_power is the stamina loss when carrying max weight and overweight_walk_k is a multiplier for the stamina loss when you're overburdened. accel_k is a multiplier for running, that is multiplied with stamina loss on walking. sprint_k is a similar multiplier but for sprinting.
Do note that this has little to do with my mod since I modified stamina only to account for hunger, thirst and sleep. In other words this mod isn't oriented towards stamina.
Hello Banjaji!
I absolutely adore this mod and your dedication towards the research behind it
However, update 16 or 17 started some heavy log spam, in actor_status_hunger_banjaji.script, lines 140 to 146 and 161 to 163, there are still some uncommented printdbg which clog the console.
Unless i missed some toggle debug options somewhere?
Anyway, I find the mod the perfect spot between vanilla and the like of Famine.
Cheers!
Thanks for letting me know! I forgot to delete the lines and uploaded a new version but it's still labeled as v3.5 (no actual changes).
doi stuff and research, I see you're a man of science as well
Well, what can you do when you don't know anything about the topic.
Could you do a patch for Speed addon by Arti? Everything is compatible but I know that outfit speed should drain satiety (Theres also weight effect speed option in MCM).
Thank you in advance!
Github.com
I'll look into it eventually but it might take a few days to weeks.
I checked the code in Github and there's no line that changes satiety. Also the readme didn't say anything about satiety drain. So I'd say no patch needed because satiety drain isn't part of the Speed addon.
I cant get the satiety multiplier to work, at least not the part where its supposed to also increase kcal values in item descriptions. As far as i know It might actually apply the multiplier when eating, while not showing increased kcal counts, but I haven't tested this yet.
I've read through a lot of other comments on here and it seems like some other mod may be messing it up? I've tried deactivating and uninstalling several mods that I thought might be conflicting without success.
I'll put a google drive link with 2 screenshots of my mod list/load order in MO2 if it can be of any help. I don't expect you to go through every mod and check for conflicts. But maybe you recognize some of these as troublesome?
Screenshots: Drive.google.com
I didn't see any mods that I know of that conflict with utils_ui.script (the script that shows the cosmetic kcal values). You can try disabling all mods except for this one and try out the stuff in debug mode. If the bug is gone then some mod must have been conflicting. If you can find out which mod does (eg enabling half of the mods, testing, disabling half of those, testing...) then please let me know!
I tried disabling all mods except yours and MCM, started a new save, and I'm also using DLTX exes. These are now the only three mods i have installed.
However Im still getting some strange results. When hovering over canned tomatoes in the starting loadout UI it says 3 kcal, but in game it says 46 kcal. and the multiplier still doesn't work.
So all that remains now is to check the anomaly game files itself I guess? I'll look more into this later and update.
Ah, you found a bug relating to the starting loadout menu. Since my utils_ui monkeypatch runs at the start of the game (when everything has already been loaded so that other mods' monkeypatches wouldn't interfere) then starting loadout shows 20x smaller satiety values (old scale). I consider this a minor bug and it's a low priority one for me. Also I didn't find a quick solution to it since I'd have to find the code that runs that UI.
I confirmed the multiplier not working and it's about my mod not the engine. The system has gotten so big that my tests before releasing a new version have become superficial regarding the entire mod.
Anyways I looked into it and will upload the new version with the fix. But since it was a cosmetic thing then don't worry, you didn't lose any resources during your playthrough.
By the power of teamwork!
But for real, that's great. Thanks for both replying and fixing it so quickly. Seems like a great mod as far as I've seen, keep it up! :)
Updated to v3.6. This version brings a bugfix to visual kcals values when using a different satiety multiplier and a bugfix for a patch.
Thank you for the continued efforts in updating and revising the addon along with maintaining compatibility patches too.
With the new patch, exact satiety, hydratation and sleepiness status doesn't show my kcals going into negative values when I eat excess calories anymore but H2O still goes into the negatives.
That's normal. Satiety is run by xray engine and thirst by LUA script. That's why I could modify the thirst going into negatives but satiety is clamped between 0 and 1 in engine. My script remembers excess kcals eaten and gives them back when it can but excess kcals don't show when accessed through the engine call. Although you gave me the idea to include fat reserve in the mod's patch.
As of July 2022 I will be away from modding. I estimate the order of magnitude of my leave to be 6 months. In the mean time if something breaks then anyone proficient enough can take over/ make patch-mods.