Description

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!

Preview
[1.5.1/1.5.2] Banjaji's Realistic bodily needs v3.8
Post comment Comments  (200 - 250 of 283)
sticknou
sticknou - - 74 comments

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

Reply Good karma Bad karma+1 vote
Banjaji Author
Banjaji - - 389 comments

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."

Reply Good karma+1 vote
nashakpd
nashakpd - - 12 comments

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)

Reply Good karma Bad karma+1 vote
Banjaji Author
Banjaji - - 389 comments

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.

Reply Good karma+2 votes
nashakpd
nashakpd - - 12 comments

Alright thanks for the reply, I've fixed it now after changing the load order. Wonderful mod

Reply Good karma Bad karma+1 vote
Banjaji Author
Banjaji - - 389 comments

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).

Reply Good karma+1 vote
Soda_Panic
Soda_Panic - - 55 comments

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?

Reply Good karma Bad karma+1 vote
RamseySparrow
RamseySparrow - - 833 comments

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.

Reply Good karma Bad karma+1 vote
Soda_Panic
Soda_Panic - - 55 comments

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

Reply Good karma Bad karma+1 vote
RamseySparrow
RamseySparrow - - 833 comments

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.

Reply Good karma Bad karma+1 vote
Banjaji Author
Banjaji - - 389 comments

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.

Reply Good karma+2 votes
Banjaji Author
Banjaji - - 389 comments

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.

Reply Good karma+1 vote
RamseySparrow
RamseySparrow - - 833 comments

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.
-

Reply Good karma Bad karma+2 votes
Banjaji Author
Banjaji - - 389 comments

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.

Reply Good karma+1 vote
RamseySparrow
RamseySparrow - - 833 comments

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.

Reply Good karma Bad karma+2 votes
Banjaji Author
Banjaji - - 389 comments

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.

Reply Good karma+1 vote
RamseySparrow
RamseySparrow - - 833 comments

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?

Reply Good karma Bad karma+1 vote
Banjaji Author
Banjaji - - 389 comments

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.

Reply Good karma+1 vote
RamseySparrow
RamseySparrow - - 833 comments

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.

Reply Good karma Bad karma+1 vote
Banjaji Author
Banjaji - - 389 comments

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.

Reply Good karma+14 votes
RamseySparrow
RamseySparrow - - 833 comments

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.

Reply Good karma Bad karma+1 vote
Soda_Panic
Soda_Panic - - 55 comments

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:

Reply Good karma Bad karma+2 votes
Banjaji Author
Banjaji - - 389 comments

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?

Reply Good karma+1 vote
Soda_Panic
Soda_Panic - - 55 comments

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

Reply Good karma Bad karma+2 votes
Banjaji Author
Banjaji - - 389 comments

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

Reply Good karma+1 vote
Soda_Panic
Soda_Panic - - 55 comments

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

Reply Good karma Bad karma+1 vote
Banjaji Author
Banjaji - - 389 comments

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.

Reply Good karma+2 votes
xxFalconArasxx
xxFalconArasxx - - 120 comments

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.

Reply Good karma Bad karma+1 vote
Banjaji Author
Banjaji - - 389 comments

Thanks! I had made a mistake and a minus was missing. I'll fix it with the next update.

Reply Good karma+1 vote
xxFalconArasxx
xxFalconArasxx - - 120 comments

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.

Reply Good karma Bad karma+1 vote
Banjaji Author
Banjaji - - 389 comments

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.

Reply Good karma+1 vote
Banjaji Author
Banjaji - - 389 comments

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).

Reply Good karma+1 vote
patrickarent
patrickarent - - 63 comments

Is it somehow possible to edit the actor.ltx to not consume stamina or at least lower stamina consumption when slow walking?

Reply Good karma Bad karma+1 vote
Banjaji Author
Banjaji - - 389 comments

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.

Reply Good karma+1 vote
Guest
Guest - - 694,021 comments

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!

Reply Good karma Bad karma+1 vote
Banjaji Author
Banjaji - - 389 comments

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).

Reply Good karma+1 vote
Wang_Laoshi
Wang_Laoshi - - 339 comments

doi stuff and research, I see you're a man of science as well

Reply Good karma Bad karma+1 vote
Banjaji Author
Banjaji - - 389 comments

Well, what can you do when you don't know anything about the topic.

Reply Good karma+1 vote
AyeBlin
AyeBlin - - 365 comments

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

Reply Good karma Bad karma+1 vote
Banjaji Author
Banjaji - - 389 comments

I'll look into it eventually but it might take a few days to weeks.

Reply Good karma+1 vote
Banjaji Author
Banjaji - - 389 comments

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.

Reply Good karma+2 votes
HoldMyDawg
HoldMyDawg - - 9 comments

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

Reply Good karma Bad karma+2 votes
Banjaji Author
Banjaji - - 389 comments

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!

Reply Good karma+2 votes
HoldMyDawg
HoldMyDawg - - 9 comments

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.

Reply Good karma Bad karma+2 votes
Banjaji Author
Banjaji - - 389 comments

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.

Reply Good karma+2 votes
HoldMyDawg
HoldMyDawg - - 9 comments

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! :)

Reply Good karma Bad karma+1 vote
Banjaji Author
Banjaji - - 389 comments

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.

Reply Good karma+3 votes
StalkerAnomalyPlayer
StalkerAnomalyPlayer - - 447 comments

Thank you for the continued efforts in updating and revising the addon along with maintaining compatibility patches too.

Reply Good karma Bad karma+1 vote
Stocke_
Stocke_ - - 19 comments

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.

Reply Good karma Bad karma+2 votes
Banjaji Author
Banjaji - - 389 comments

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.

Reply Good karma+1 vote
Banjaji Author
Banjaji - - 389 comments

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.

Reply Good karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: