Mods / HungerTweaks
Author: GraveCatalyst
Side: Server
Created: Jan 10th at 12:04 AM
Last modified: Jan 13th at 2:00 AM
Downloads: 200
Follow Unfollow 21
Recommended download (for Vintage Story 1.21.0-pre.1 - 1.21.6):
HungerTweaks-1.0.6.zip
1-click install
HungerTweaks
Server-side mod that lets you customize hunger/satiety drain for specific actions and (optionally) scale hunger to match your server’s real-time calendar settings.
SHORT VERSION FOR GENERAL PLAYERS
Installing:
- Download the .zip file
- Put it in your mods folder
- Start your world. This generates your .json file
- Exit your game
- Open:
VintagestoryData/ModConfig/hungertweaks.json -
Adjust settings as desired.
-
Restart the game/server.
Updating:
- Move your HungerTweaks.json file out of the Modconfig directory (so you don't lose your custom settings)
-
- This mod will not automatically overwrite an existing .json file, so there may be errors or ignored behavior if you don't generate a new .json with the necessary fields
2. Start the game, then exit the game to generate a new HungerTweaks.json file
3. Go into the Modconfig\HungerTweaks.json directory and update to your desired settings
What This Mod Does (by default)
-
Less hunger drain while: sitting, sleeping, walking on paths/roads, panning
-
More hunger drain while: sprinting, mining, chopping, digging, fighting/hunting, sneaking, swimming, temporal storms
Settings:
The game runs on a simple set of multiplication scalars, so changes to both GlobalMultipler and MonthLengthScaling will likely mess you up; keep it simple and focus on 1.
Find your Hours per game month (if you don't know it already) using this formula:
- Check Hours Per Day: Type
/time hoursperday(or/time hoursperday [amount]) to see how many in-game hours are in a day (default is 24). (X value) - Check Days Per Month: Use
/wc daysPerMonth(requires admin) to see the in-game month length (default is 9). (Y value)
- Check Time Speed: Type
/time speed(or/time speed [amount]) to see how fast time passes; default is 60 (meaning 1 game hour = 1 real-life minute). (Z value) - Check Calender speed multiplier: type
/time calendarspeedmul(requires admin) to see the ingame calenderspeedmultplier (default is .5). (W value)
Formula is:
- (X * Y) / (Z * W) = Real life hours per month
- Set your "MonthLengthScaling" to this value
default formula looks like: (24 * 9) / (60 * .5) = 216 / 30 = 7.2
Tweak your overall hunger scaling using GlobalMultiplier.
These are common starting points (using 7.2 hours/month as a “vanilla-ish” baseline)
recommended (real life hours per in game month → globalmultiplier value):
-
3 hours → 2.40
-
6 h → 1.20
-
9 h → 0.80
-
12 h → 0.60
-
15 h → 0.48
-
18 h → 0.40
-
20 h → 0.36
-
30 h → 0.24
-
48 h → ~0.15–0.16'
see below for custom values
Adjust the .json file as desired for individual action multipliers. You can reference my .json file at the bottom of this description
Compatibility:
There are some mods that adjust hunger as well, IF the other mod makes changes to the BaseRate (in-game character sheet percentage), that % will be calculated into this mod, and will likely make things askew (for example: Walking Stick mod).
This mod should not have any CTD issues as it simply applies a scalar to your hunger ticks
LONG VERSION FOR SERVER OWNERS
Installation
-
Place the mod
.zipinto your server’sModsfolder. -
Start the game/server once to generate the config file.
-
Exit the game/server.
-
Open:
VintagestoryData/ModConfig/hungertweaks.json -
Adjust settings as desired.
-
Restart the game/server.
Updating
- Move your HungerTweaks.json file out of the Modconfig directory (so you don't lose your custom settings)
-
- This mod will not automatically overwrite an existing .json file, so there may be errors or ignored behavior if you don't generate a new .json with the necessary fields
2. Start the game, then exit the game to generate a new HungerTweaks.json file
3. Go into the Modconfig\HungerTweaks.json directory and update to your desired settings
What this mod does (by default)
Action-based hunger multipliers
Adjust hunger drain per action so you can:
-
DECREASE drain while:
-
sitting
-
sleeping
-
walking on path/road blocks
-
panning
-
-
INCREASE drain while:
-
sprinting
-
mining
-
chopping
- digging
-
fighting/hunting
- sneaking
- being in a temporal storm
- swimming
-
Month-length scaling (optional)
If your server uses non-default “real-life hours per in-game month”, hunger can feel too punishing (or too easy). This mod can automatically scale hunger to better match your time settings—so you don’t end up eating multiple meals per in-game day unless you’re constantly sprinting.
Important notes / limitations
-
Server-only mod. The in-game character sheet “Hunger rate %” may not change and can still display the vanilla values.
-
How to verify it’s working: set debugmode: true in .json. Read debug messages in Logs/server-main.log
-
Detection limitations: the mod uses best-effort checks based on player state and held tool type. Edge cases may not be detected correctly, including:
-
Custom beds not recognized as “beds”
-
Modded tools/weapons that don’t report standard tool types
-
Mods that change sleep/time-skip rules (e.g., one-person sleep): If you use a one-person sleep mod, a player that stays up all night will take a huge hunger hit while the sleeper will be generally fine, so coordinate your sleeping with server mates, or at least give them a warning.
- modded animal mounts, furniature, and boats may not register properly
-
- These values are only recommendations, you can adjust them to your liking to fit your play style or needs.
- the change in food necessity will alter your gameplay a bit, making it so food security isn't so stressful.
- If you reduce food consuption requirements, it could make mods that increase food production over powered
- server owners:
- you could create events where something makes food consumption go crazy and you increase food needs for a period of time.
How the final drain is calculated
BaseDrain is the % in your character sheet's "Hunger Rate %", convert it to decimal, so 100% = 1, 120% = 1.2, and so on.
GlobalMultiplier recommendations (real-life hours per in-game month)
These are common starting points (using 7.2 hours/month as a “vanilla-ish” baseline)
If your real life hours per in game month equal:
-
3 hours → 2.40
-
6 h → 1.20
-
9 h → 0.80
-
12 h → 0.60
-
15 h → 0.48
-
18 h → 0.40
-
20 h → 0.36
-
30 h → 0.24
-
48 h → ~0.15–0.16'
set your global multiplier to one of these values. If you use custom X hours per ingame month, use the formula below
Custom formula
Choose:
-
BML = Baseline Month Length is what you want hunger balanced around (example: vanilla-ish is 7.2)
-
CML = Custom Month Length is your server’s real-life hours per in-game month
Examples (BML = 7.2):
-
CML = 11.5 → GM = 7.2 / 11.5 = 0.626
-
CML = 23.75 → GM = 7.2 / 23.75 = 0.303
-
CML = 48.5 → GM = 7.2 / 48.5 = 0.154
How to find your time scales:
- Check Hours Per Day: Type
/time hoursperday(or/time hoursperday [amount]) to see how many in-game hours are in a day (default is 24). (X value) - Check Days Per Month: Use
/wc daysPerMonth(requires admin) to see the in-game month length (default is 9). (Y value)
- Check Time Speed: Type
/time speed(or/time speed [amount]) to see how fast time passes; default is 60 (meaning 1 game hour = 1 real-life minute). (Z value) - Check Calender speed multiplier: type
/time calendarspeedmul(requires admin) to see the ingame calenderspeedmultplier (default is .5). (W value)
Formula is:
- (X * Y) / (Z * W) = Real life hours per month
-
- So default looks like: (24 * 9) / (60 * .5) = 216 / 30 = 7.2
MonthLengthScaling settings explained
-
ReferenceRealHoursPerMonth
-
The month length (in real-life hours) you consider “baseline”.
-
If your server is set to 20 hours/month and you set this to 20, the MonthScale becomes neutral (≈1.0).
- If your server is set to 20 hours/month and you set this to 10, the MonthScale becomes 10/20 = .5 , hunger decreased by 50% (basically half)
- If your server is set to 20 hours/month and you set this to 30, the MonthScale becomes 30/20 = 1.5 , hunger increases by 50%
-
author's note: I recommend keeping this value equating to 1 and dialing in your scaling through the GlobalMultiplier value above, this can have some significant run on effects if there is even a small miscalculation on your RL Hours per month.
Because the calculation is a simple series of multiplication, an equation like basedrain x .5 x 4 x 1 x 1 = basedrain x 1 x 2 x 1 x 1 ; so this is to say, adjust either globalmultiplier or monthlengthscale, not both, for simplicity
If you are comfortable managing the month scaling modifer and global modifier, then you can finetune your hunger rates to a higher degree.
-
UseWorldCalendar
-
If
true, the mod computes actual hours/month from the server’s world calendar settings automatically. -
Recommended if you may adjust time settings later.
-
-
OverrideActualRealHoursPerMonth
-
Only used when
UseWorldCalendarisfalse. -
Lets you hard-code the “actual” month length the mod should use (ignoring world settings).
-
-
MinMultiplier / MaxMultiplier
-
Clamps MonthScale to prevent extreme values.
-
Example based on my config settings **I'm still tweaking my settings**
"PanningPendingMaxMs": 30000
Future update ideas
- skinning an animal
- digging with hands
- currently, only 1 action counts during hunger tick, (most recent action taken); make actions stack (sitting + panning, sprinting + weapon swing)
- wetness factor
- see if its possble to make a patch for the carryon mod
- while spinnig the quern
- starting a fire
(feel free to add suggestions in the comments)
Free Use notification
| Mod Version | Mod Identifier | For Game version | Downloads | Released | Changelog | Download | 1-click mod install* |
|---|---|---|---|---|---|---|---|
| 1.0.6 | hungertweaks | 85 | Jan 13th at 2:00 AM | HungerTweaks-1.0.6.zip | 1-click install | ||
|
-Digging use to fall under the default weapon swing, but I figured since the ax and picks got their own modifier, why not the shovel.
Fixed: -- Panning logic has been refactored and now works per panning attempt rather than for a duration -The original thought process was to change the scaling inside a window (the animation) but there were too many issues with this, so its been changed so that the next hunger check will after activating panning will be a panning actionmultiplier. -- Weapon swing logic is now more consistant | |||||||
| 1.0.5 | hungertweaks | 27 | Jan 12th at 4:33 AM | HungerTweaks-1.0.5.zip | 1-click install | ||
|
Change Log:
-- Added swimming
| |||||||
| 1.0.4 | hungertweaks | 33 | Jan 11th at 6:15 AM | HungerTweaks-1.0.4.zip | 1-click install | ||
|
Sorry for so many updates, bugs are a pain Change log -- Fixed a bug where sometimes multipliers would stack on ticks instead of remaining on their assiged value | |||||||
| 1.0.3 | hungertweaks | 8 | Jan 11th at 3:53 AM | HungerTweaks-1.0.3.zip | 1-click install | ||
|
--Fixed Temporal storm logic | |||||||
| 1.0.2 | hungertweaks | 6 | Jan 11th at 1:50 AM | HungerTweaks-1.0.2.zip | 1-click install | ||
|
Changelog: | |||||||
| 1.0.1 | hungertweaks | 24 | Jan 10th at 1:56 PM | HungerTweaks-1.0.1.zip | 1-click install | ||
|
Changelog: Changed weapon swing behavior
---Added panning: checks for requirements to pan and on right mouse button click, will start a timer and modifies hunger inside that timer window, resetting the timer on a new mouse button click | |||||||
| 1.0.0 | hungertweaks | 17 | Jan 10th at 12:09 AM | HungerTweaks.zip | 1-click install | ||
|
Initial Release | |||||||
Hyomoto I just check compatibility with Walking Sticks mod and it is compatible with my mod, but my mod may not be compatiable (mechanically) with theirs.
Firstly, because my mod does not change ingame hunger rate percetage of the player's character sheet, which is considered the BaseDrain. Walking sticks add a negative modifier to the character's BaseDrain.
Secondly, my mod doesn't register walking as an action, simply standing is the action; the assumption is that walking and standing is similar enough that they might as well be equal (I may revisit this in the future). His mod ONLY changes hunger rates while walking. The only compaitbility issue may be that my mod uses the BaseDrain in its calculation, and the walking stick gives a static -x% to basedrain while holding a stick; this would inturn cause all calculated values in my mod to be slightly lower.
Again, my mod is an after-the-fact multipler on the hunger rate. It is called whenever the game itself calls its "ReduceSaturation" function and (with calculated values) applies the multiplier, which the game does every 2 seconds. I'm going to assume that, due to hunger rate simplicity in changing, that other mods that affect hunger rates will also apply their own multiplier to the hunger rates. Now this could have stacking issues, for example:
HungerTweaks: BaseDrain (1) * .5 * 1 * 1 * 2.75 (sprinting) * 1 = 1.375
HungerTweaks + walking sticks: BaseDrain(.95) * .5 * 1 * 2.75 * 1 = 1.30625
As you can see, walking sticks is not intended to change hunger rates while sprinting, but my mod does force a change. Both mods are server authoritative, so even though walking sticks is meant to prevent that feature, my mod would push it through anyway.
Other mods might work the same way.
That's kind of what I meant. If a mod reduces hunger rate, does it interact with the mod or does yours just completely override them? For example, walking sticks reduces your hunger rate. There are CAN jewels that do the same. I think there might be an xskill skill that does, etc... so if you just wholesale replace it that's an important distinction versus expanding it. Basically it's a compatability question.
Thank you for explaining that. I think I got it dailed in. Great work!
gNecrOz
Its really just a little bit of math
change your player hunger speed to 1 for simplicity
60 minutes X 12 day months = 720 minutes in a month / 60 minutes in an hour = 12 hours per month
7.2 / 12 = .6
Your globalmultiplier should be .6
set ReferenceRealHoursPerMonth to 12
adjust the action multipliers to your prefrence, and use the formula in the description to see what they will be
for example, Baserate x .6 x 1 x 2.75 (sprinting) = 1.65, so a 65% increase in hunger while sprinting or
Baserate x .6 x 1 x .45 (sleeping) = .27, so a 73% decrease in hunger while sleeping
I feel like I need whole ass TEDtalk around hunger drain after trying to read this.
I love it, but I feel my brain is too dumb to comprehend sometimes haha.
"playerHungerSpeed": "0.83",
Months = 12 days
Days = 24 hrs // 60 RLM
I would love to use this mod to help manage what feels "natural". So any guidacne there is appreciated.
MiraLeaps your calenderspeedmul makes real life hours correspond to a day length in game. Mine is set to .25 which gives me roughly 97 minutes for a 24-hr period. I'm not sure what a CSM of .1 make it, but there is where the calculations comes in to play. You should do this math:
IRL minutes per in-game 24-hr period x 28 = number of minutes for an in-game month ( rename this value to Z).
Z / 60 = hours in an in-game month (we will call this value K). [Thats how I get 48.5 for my .json file.]
7.2 / K = your GlobalMultiplier
ReferenceRealHoursPerMonth should = K
If you feel like your food rate is not fast enough, increase your globalmultiplier by a little bit.
I'm a little confused....our /time csm is .1 and our days per month is 28...what should I put where?
Thank you Hyomoto for your comment. This mod works behind the scenes outside the client, so mods that change or alter food consumption, food timers, or satiety factors do not interact with this mod. This mod only affects the hunger rate calculations done by the server based on the factors specified in the json file. The mod looks for player tags like "mounted to bed" or "holding X item" or "standing in water" or "left/right mouse button click/hold". So mods that alter those types of tags may register or misregister depending on how tags are used. This mod is only multipliers on hunger rates; so if other mods also use multipliers for hunger rate changes, then it could make things out of wack.
You know, a lot of attempts have been made to make the hunger in this game less ass and I want to say that as a low-cost drop in solution for the largest benefits: aka, the smallest amount of complexity for the largest gain, I think you nailed it. The problem with hunger is deep, varied and complex. But ultimately I think the most visible issue is that a Seraph sitting completely motionless will starve to death in twenty minutes. Even if we assume as large animals they metabolize like jet engines, large animals like elephants do not starve to death within ten minutes of missing a meal. Hunger has to mean something, and fixing that is a whole other can of worms. So while I don't think this fixes everything, it provides a gradient that simply tweaking the hunger rate does not and so I think this will be a popular mod barring any unexpected errors. I'm happy to add it to my list.
That said, I am curious how it will interact with other mods that affect hunger rates like CAN.
You should sit if you afk to reduce hunger consumption. Standing is basically a placeholder, and It was the default that I based the other actions on.
Thank you, it always surprised me how no one made a mod that actually makes sitting consume less stamina, until now at least. Is the behavior where your hunger rate got reduced if you were AFK listed as "Standing" now?