Ludeon Forums

RimWorld => Releases => Mods => Outdated => Topic started by: Duncan on April 05, 2017, 04:50:50 PM

Title: [B18] Realistic Starvation
Post by: Duncan on April 05, 2017, 04:50:50 PM
Download Link (http://www.gametheatre.org/RealisticStarvationMod.zip)
Steam link: http://steamcommunity.com/sharedfiles/filedetails/?id=899134090

More realistic starvation numbers. Basically pawns will eat the same amount as usual when food is there, but when they are starving they will starve much more slowly, and suffer severe performance penalties.

I felt that the colonists starve far too fast in the vanilla game. In real life a person can survive 3 weeks without food. This goes up significantly if the person has a lot of body fat. I think the record with vitamin supplements is over a year. Additionally starvation is a crippling illness and the effects should reflect this.   
The hunger/starvation times are as follows (based on default starting hunger, not full) in hours (vanilla/this mod):
hungry - 8/10
very hungry - 12/17
starving(trivial) - 19/32
Minor starvation - 28/70
Moderate - 37/104
Severe - 46/116
Extreme(Unconscious) - 31/176
Death - 64/199

This means a colonist will now die after a bit over 8 days without food, instead of the vanilla 3.

Additional changes
-pawns recover from starvation slower
-pawns recover faster from starvation the more food they get (based on hunger level)
-starvation now comes with severe reductions to disease resistance, move speed and work speed (manipulation)

Update 2017.04.09
-Fixed an issue where food need was not initialised or could become uninitialised, resulting in pawns that were unable to eat and would eventually starve. The issue was rare but seemed to occur more frequently when mod was used with the SK-Hardcore pack

Update 2017.05.22
-Rewrote the mod using the harmony framework eliminating all known compatibility issues with other mods

Update 2017.07.07
-Updated mod to handle faction leaders frozen needs
Title: Re: [A16] Realistic Starvation
Post by: XeoNovaDan on April 05, 2017, 05:27:42 PM
Could you please do a manual installation version? Maybe something like Dropbox
Title: Re: [A16] Realistic Starvation
Post by: Dr_Zhivago on April 05, 2017, 05:31:24 PM
Quote from: XeoNovaDan on April 05, 2017, 05:27:42 PM
Could you please do a manual installation version? Maybe something like Dropbox

Click the link called "Download Link"
Title: Re: [A16] Realistic Starvation
Post by: XeoNovaDan on April 05, 2017, 05:33:06 PM
Oh, thanks xD
Having one of them moments :P
Title: Re: [A16] Realistic Starvation
Post by: skyarkhangel on April 05, 2017, 07:32:43 PM
In Rimworld, starvation system combines different needs. If human can survive 3-5 weeks or more without food, but without water for no more than three-five days. So to be more precise, the colonists in Rimwold die of dehydration.
Title: Re: [A16] Realistic Starvation
Post by: Duncan on April 06, 2017, 04:51:03 AM
Good point skyarkhangel. I didn't think of that. And I was going to ask you to put this in your modpack, but I guess you aren't keen.

Well I still prefer it this way. Until thirst is implemented as a proper need it is possible to starve to death on a high rainfall map next to a lake. I really would like to see thirst and water in the game but that is much more effort to implement. This mod was just an evening's work.
Title: Re: [A16] Realistic Starvation
Post by: Birdy on April 08, 2017, 06:39:28 AM
I like it, seems fun!
Title: Re: [A16] Realistic Starvation
Post by: Razzoriel on April 09, 2017, 08:41:48 AM
Quote from: Duncan on April 06, 2017, 04:51:03 AM
Good point skyarkhangel. I didn't think of that. And I was going to ask you to put this in your modpack, but I guess you aren't keen.

Well I still prefer it this way. Until thirst is implemented as a proper need it is possible to starve to death on a high rainfall map next to a lake. I really would like to see thirst and water in the game but that is much more effort to implement. This mod was just an evening's work.

Makes complete sense, which is why im gonna ask if i can use the mod and incorporate it into Outer Galaxies, a mod compilation+game overhaul under development. Very interesting changes.
Title: Re: [A16] Realistic Starvation
Post by: Duncan on April 09, 2017, 02:26:35 PM
Feel free Razzoriel. The source for the assembly is included in the mod if you need to modify anything.

Make sure you download the mod again if you already downloaded it, there was an intermittent issue with the first version which has now been fixed.
Title: Re: [A16] Realistic Starvation
Post by: deshara218 on April 14, 2017, 02:18:35 AM
I just spent all week doing permutations through my 60 mods to figure out the source of my "pawns eventually refuse to eat" bug only to find, upon figuring out which combo it is that does it, that when I googled ur mod to find this forum post (smf has garbage search algorithms sue me) and out of curiosity I checked ur steam workshop page you already found & fixed this problem and I missed the tiny announcement at the bottom of your post when I checked for it on Monday ;_;
Title: Re: [A16] Realistic Starvation
Post by: Fightera100 on April 19, 2017, 09:40:12 AM
Is there a way to deactive the mod on an existing colony? Keeps throwing errors at me and could be the source of lag...
Is there like a line in the savefile where I can put the needs to standard again?

Edit: I just managed to delete the mod from the savefile and it seems that my performance got better.
In case anyone wants to do it too first you will need to deactive the mod in Rimworld and then follow these steps:
1. Go to your savefile folder and open the savefile with preferably Notepad++(needs a replace all function or you need to replace a ton of entries by yourself which can take a half hour)
1.1. JUST IN CASE BACK UP YOUR SAVEFILE
2. In Notepad++ press CTRL + H
3. Search for:
<li Class="RealisticStarvation.Realistic_Need_Food">
and replace all with the vanilla one:
<li Class="Need_Food">

It could be true that the mod works fine but it seems that it clashes with one of my other mods
Title: Re: [A16] Realistic Starvation
Post by: Modo44 on April 20, 2017, 05:54:36 AM
This mod generates a constant "animal starvation" alert. I thought it was some conflict, but after removing all other mods, and starting a fresh colony, it still does that. This makes it very tedious to keep track of larger animal farms.
Title: Re: [A16] Realistic Starvation
Post by: Duncan on May 05, 2017, 06:40:53 PM
Updated mod:

-fixed starving animals alert
-removed debug message for pawns with no hunger need (mechanoids)
-Haplo's Misc. Robots compatibility: robots no longer get hungry

Sorry you went to so much trouble deshara218, I sympathise and regret being the cause. In my defence food is really hard coded in rimworld and most of these bugs are caused by the vanilla code referencing things which bypass the mod, usually bad coding practices. I believe I have fixed all the major examples of that now, the last one being that the the animals starving alert references the variable Pawn.needs.food.TicksStarving which is completely locked down and not accessible to any mod, and is initalised to a massive minus value. The colonist starving alert on the other hand checks Pawn.needs.food.Starving which actually tests if the creature is currently starving. The specific problem you had with the colonists not eating was caused by the weird method that the game uses to assign the food need. It actually checks all of the pawns needs to see if any of the are of the type Need_Food and the assigns the variable when it finds one. Assigning variables based on type checks is bad practice. This means you can override the class and then add it to all the pawns in xml and but it will never get added to their actual food need which is what all other classes access. This means that although they have a food need, they cant eat or starve or be hungry.

All my mod actually does is change some variables, it should have taken 5 minutes to make and been completely bug free on the first try. I guess I shouldn't complain too hard though, this is still an alpha.
Title: Re: [A16] Realistic Starvation
Post by: marvin__ on May 05, 2017, 10:53:33 PM
Quote from: Duncan on May 05, 2017, 06:40:53 PM
Updated mod:

-fixed starving animals alert
-removed debug message for pawns with no hunger need (mechanoids)
-Haplo's Misc. Robots compatibility: robots no longer get hungry

Sorry you went to so much trouble deshara218, I sympathise and regret being the cause. In my defence food is really hard coded in rimworld and most of these bugs are caused by the vanilla code referencing things which bypass the mod, usually bad coding practices. I believe I have fixed all the major examples of that now, the last one being that the the animals starving alert references the variable Pawn.needs.food.TicksStarving which is completely locked down and not accessible to any mod, and is initalised to a massive minus value. The colonist starving alert on the other hand checks Pawn.needs.food.Starving which actually tests if the creature is currently starving. The specific problem you had with the colonists not eating was caused by the weird method that the game uses to assign the food need. It actually checks all of the pawns needs to see if any of the are of the type Need_Food and the assigns the variable when it finds one. Assigning variables based on type checks is bad practice. This means you can override the class and then add it to all the pawns in xml and but it will never get added to their actual food need which is what all other classes access. This means that although they have a food need, they cant eat or starve or be hungry.

All my mod actually does is change some variables, it should have taken 5 minutes to make and been completely bug free on the first try. I guess I shouldn't complain too hard though, this is still an alpha.
Can this be loaded anywhere on the mod list or is it dependent on a specific order?
Title: Re: [A16] Realistic Starvation
Post by: Modo44 on May 06, 2017, 09:41:02 AM
Quote from: Duncan on May 05, 2017, 06:40:53 PM
I guess I shouldn't complain too hard though, this is still an alpha.
You should complain, since you found potential serious bug sources, which your mod illustrated. Stuff like that never gets fixed otherwise.
Title: Re: [A16] Realistic Starvation
Post by: Duncan on May 22, 2017, 11:44:09 AM
So I rewrote the mod using the Harmony framework (https://github.com/pardeike/Harmony). This should make the mod much more stable and remove any compatibility issues with other mods.

***

@Modo44 I agree but Rimworld actually has a lot of those, and I am still waiting for fixes for the first ones I complained about. In terms of priorities I am hoping first for fixes to the problems that have direct effects even in the vanilla version. Hopefully one day refactoring to facilitate easier modding will get done too.
Title: Re: [A17] Realistic Starvation
Post by: Duncan on July 06, 2017, 06:06:32 PM
I missed that faction leaders needs are handled differently than normal pawns. This has now been fixed in the current version. Enjoy.
Title: Re: [A17] Realistic Starvation
Post by: tigg on August 06, 2017, 08:43:58 AM
Could you post a link to the A16 version please?
Title: Re: [A17] Realistic Starvation
Post by: VON2901 on November 26, 2017, 11:14:08 AM
Please update it to B18, I love this mod
Title: Re: [A18] Realistic Starvation
Post by: Duncan on December 02, 2017, 03:13:28 PM
Updated
Title: Re: [B18] Realistic Starvation
Post by: dvegit0 on September 22, 2018, 01:32:37 AM
i really miss this mod, did anyone updated it to b19 ?
Title: Re: [B18] Realistic Starvation
Post by: Soupy Delicious on October 25, 2018, 09:13:11 AM
Brilliant mod; couldn't play without it back in da day
Title: Re: [B18] Realistic Starvation
Post by: ambivalence on December 26, 2018, 12:32:51 PM
steam version seems to be updated late in october, so I guess it works fine in 1.0.