[1.3] Children and Pregnancy - v4.1.0

Started by GhostData, March 22, 2020, 04:32:51 PM

Previous topic - Next topic

furel

#45
Quote from: Geese man on April 03, 2020, 09:05:06 PM
Now as far as i know the "loving" interaction requires a double bed which i don't think is being used by a lot of people in prisons as imprisoned pairs are pretty rare i would say, most common would be a colonist pair that got arrested to stop a mental break or something but then the baby should belong to your faction already anyway. ok so I just tested 2 scenario's I had colonist couple simply arrested them and gave them a double bed to my luck they did some lovin first night and the woman got pregnant, I developer mode added the hediff "birth soon" to cut the pregnancy short. baby works as intended gets taken to a normal prisoner bed and cant move(this rules out that being a prisoner has anything to do with this, at least in my case). perhaps you could tell which mods you are using? I also tested this with the pirate faction simply spawned 2 pawns arrested them and gave them a relation ship and enabled the always do lovin option (not the case with the colonists) that baby had the issues you described(so I don't know if married pawns from other faction would do the lovin act naturally in prison), thus Tragix this will need a fix although this is not a high priority as it should be a very rare scenario in most playthroughs.

I use RimJobWorld, that why my prisoners can be pregnant.
Tragix said he change for 2.0 how the hediff works for the babies, so now maybe works, maybe don't. I found an error message appears when I force to give the hediff that forces the newborn to stay in place and I thought it was a good idea to report. Tragix already said it is something he could implement or not.

The real problem I hope is resolved in 2.0 is the "play with baby" task, that my colonist paws have with my colonist babies trying to play, but stopping and try again and don't filling the need.
Also mothers prefers give cooked food instead of breastfeeding, this is something it could save food in some scenarios with low resources.

The second thing i'm worry about is if is needed a new game for the 2.0

Geese man

Quote from: furel on April 04, 2020, 07:49:07 AM
Quote from: Geese man on April 03, 2020, 09:05:06 PM
Now as far as i know the "loving" interaction requires a double bed which i don't think is being used by a lot of people in prisons as imprisoned pairs are pretty rare i would say, most common would be a colonist pair that got arrested to stop a mental break or something but then the baby should belong to your faction already anyway. ok so I just tested 2 scenario's I had colonist couple simply arrested them and gave them a double bed to my luck they did some lovin first night and the woman got pregnant, I developer mode added the hediff "birth soon" to cut the pregnancy short. baby works as intended gets taken to a normal prisoner bed and cant move(this rules out that being a prisoner has anything to do with this, at least in my case). perhaps you could tell which mods you are using? I also tested this with the pirate faction simply spawned 2 pawns arrested them and gave them a relation ship and enabled the always do lovin option (not the case with the colonists) that baby had the issues you described(so I don't know if married pawns from other faction would do the lovin act naturally in prison), thus Tragix this will need a fix although this is not a high priority as it should be a very rare scenario in most playthroughs.

I use RimJobWorld, that why my prisoners can be pregnant.
Tragix said he change for 2.0 how the hediff works for the babies, so now maybe works, maybe don't. I found an error message appears when I force to give the hediff that forces the newborn to stay in place and I thought it was a good idea to report. Tragix already said it is something he could implement or not.

The real problem I hope is resolved in 2.0 is the "play with baby" task, that my colonist paws have with my colonist babies trying to play, but stopping and try again and don't filling the need.
Also mothers prefers give cooked food instead of breastfeeding, this is something it could save food in some scenarios with low resources.

The second thing i'm worry about is if is needed a new game for the 2.0

Thirite made the original mod for rimworld 1.0 incompatible with RJW, now he said that it would simply stop RJW from loading (since he did not like bestiality & furry stuff etc to be used with this mod). now am not exactly sure what changed with the 1.1 royalty update but it seems that with updating this mod that is removed. So in conclusion this mod was never meant to be used along side RJW, although the issues you have are the same for me and my modlist is this mod with some mods that only enhance vanilla mechanics so its not RJW directly screwing things up it just creates scenarios that otherwise would be very rare.

Now the breast feeding issue is actually quite simple to explain since breastfeeding is not a vanilla thing but feeding is pawns will simply prefer to feed meals as they are not made to breastfeed vanilla wise, just micro the breastfeeding is the only advice I can give.

and tragix already said that the 2.0 version will be game breaking so you will have to restart.

GhostData

Quote from: lbmaian on April 03, 2020, 02:50:38 AM
Oh hey, glad to see someone picked this up.

I was working on updating C&P last year, but lost my source due to a hardware failure, got demotivated and distracted by other modding projects, and only was trying to reconstruct my changes out of sense of obligation of sorts, and at a very low priority at that. I'm pretty relieved that someone's now actually working on and maintaining this "full time".

I don't know how much of my changes are still applicable, but here's the only commits I have that have actual changes (which I've just pushed to gitlab):

Given the 1.1 migration and your other code changes, these commits aren't really mergeable for you, but hopefully, they'll prove helpful. The code audit in particular points out some obvious bugs that should be addressed.

Since I've kinda lost interest in C&P, I probably won't be actively helping out or testing, but if you have any questions, you can contact me on Discord at lbmaian#4515
Definitely useful notes. I'll look into them when I get around to code cleanup, looks like there is probably several days or more of work there.

Quote from: furel on April 03, 2020, 08:28:10 AM

I have more information about this problem. When a pawn try to play with the baby, he/she start the task and immediately stops and starts again and then stops and repeat this circle, as a result the baby don't fill the recreation need and the pawn can't leave and the baby don't stop to crying, oh my god, that's the most annoying part.
Sometimes they can visit the baby as a hospitalized pawn was and fill the recreation need, which is other thing. Because it treat like a hospitalized pawn, they pick the baby from the crib, carry the baby to hospital bed, feed the baby and some times return to the crib, some times not.

I hope this information can help you.
I think I've got the issue where the caretaker shuffles the baby around during feeding resolved.
I have not been able to replicate the issue with the play with baby job. There are already checks that should prevent it from being immediately reassigned, so I can only assume one of the job fail conditions is being triggered, and then the job is reassigned for round 2+. The only fail conditions I see are if baby is no longer awake or in bed.


Quote from: Geese man on April 03, 2020, 09:05:06 PM
Now as far as i know the "loving" interaction requires a double bed which i don't think is being used by a lot of people in prisons as imprisoned pairs are pretty rare i would say, most common would be a colonist pair that got arrested to stop a mental break or something but then the baby should belong to your faction already anyway. ok so I just tested 2 scenario's I had colonist couple simply arrested them and gave them a double bed to my luck they did some lovin first night and the woman got pregnant, I developer mode added the hediff "birth soon" to cut the pregnancy short. baby works as intended gets taken to a normal prisoner bed and cant move(this rules out that being a prisoner has anything to do with this, at least in my case). perhaps you could tell which mods you are using? I also tested this with the pirate faction simply spawned 2 pawns arrested them and gave them a relation ship and enabled the always do lovin option (not the case with the colonists) that baby had the issues you described(so I don't know if married pawns from other faction would do the lovin act naturally in prison), thus Tragix this will need a fix although this is not a high priority as it should be a very rare scenario in most playthroughs.
For the time being, I will disable pregnancy from non-player factions. Definitely a short term thing, but I would like to improve stability quickly while working through compatibility and bugs.
I will possibly do something similar for prisoners for a while as well. Or perhaps forcefully delay birth until such a time that a colonist is no longer a prisoner. If the player were to leave that colonist imprisoned for years it would certainly make for a strange pregnancy, but it might be preferable to broken pawns, messed up saves, or other unnecessary bugs.

Quote from: Third_Of_Five on April 03, 2020, 10:25:46 PM
Are there multiple people developing this, or is it just you at the moment? I've been looking through your repo on gitlab and I'd be interested in helping out working on this mod if you'd like my help.

What development environment do you use? Visual Studio? Will MonoDevelop work?
Currently just myself. I use visual studio.
You are welcome to make pull requests if you like, but I don't have contribution guidelines up yet, and will probably not prioritize them until some of the larger renovations are complete.

Quote from: netenugu on April 04, 2020, 07:02:26 AM
Long-term suggestion: Is it possible, without duplicating all the items, to make children's clothing weigh less? Especially when it comes to armor. Thickness of material (and thus armor values) could stay the same, but it would still be smaller.

With the current version, even pawns capable of breastfeeding sometimes use meals to feed babies. What a waste  ;D
And if you use milkable colonists, milk fulness doesn't decrease while breastfeeding. I guess not many people use milkable colonists, so compatibility shouldn't be a high priority, but it would be neat  ;D

Is it possible to imprison babies? Like if it has inwanted traits and you don't want to feed it for years, it would be interesting to just sell it asap.
Mass is handled by XML defs, which are configured game-wide rather than per pawn instance. It might be possible to do something hokey with patching the mass get methods on ThingDef, though. It's not a bad idea for a feature.

Baby imprisonment is a hot topic right now. As a general sweeping statement, I suggest you avoid baby prisoners for the time being. Too many variables and has not been properly handled or tested yet.

My expectation of a mod like this is to provide an API for pregnancy, birth, and childhood for all non-animal pawns. It will fall on other mods to choose to support or utilize CNP. Alternatively, and perhaps preferably, an extension or patch could be made for mods like milkable colonists that allows it to interact with CNP. In no (current) case do I want to see mod support brought directly into CNP, as it causes unnecessary bloat.

Quote from: Geese man on April 04, 2020, 08:39:34 AM

Thirite made the original mod for rimworld 1.0 incompatible with RJW, now he said that it would simply stop RJW from loading (since he did not like bestiality & furry stuff etc to be used with this mod). now am not exactly sure what changed with the 1.1 royalty update but it seems that with updating this mod that is removed. So in conclusion this mod was never meant to be used along side RJW, although the issues you have are the same for me and my modlist is this mod with some mods that only enhance vanilla mechanics so its not RJW directly screwing things up it just creates scenarios that otherwise would be very rare.

Now the breast feeding issue is actually quite simple to explain since breastfeeding is not a vanilla thing but feeding is pawns will simply prefer to feed meals as they are not made to breastfeed vanilla wise, just micro the breastfeeding is the only advice I can give.

and tragix already said that the 2.0 version will be game breaking so you will have to restart.
RJW appears to have copied the original code from CNP and revised it to suit their needs. I have referenced the mod in order to identify some of the author's pain points that prompted them to override CNP. While I am probably not providing everything they need yet, steps are being taken to allow better integration between broader mods like RJW and CNP.
With that said, RJW attempts to do far to much. It missed a golden opportunity to be a generic lovin' extension framework and instead attempts to support every micro-niche fetish possible, as well as implementing it's own handler for pregnancy and birth. All of that is well and good for a mod, but modularity improves compatibility. Last I recall, RJW explicitly prevents CNP pregnancy from occurring. It should effectively be considered a hard incompatibility with CNP until that is corrected. My goal is to be able to integrate with the mod, but integration must come from the client side, not the API side.

I don't see anything in the code for CNP that disables RJW, though I do recall some measure of backlash from a couple years back, maybe. It is not for a modder or mod to dictate morality. There are only rare cases in which it is justifiable for a mod to forcefully make itself incompatible with another mod, and there is no justification for causing harm or destruction to a player's game due to personal beliefs.

Geese man

#48
to clarify colonist prisoners do not appears to give birth to "broken" babies (even whilst still imprisoned) thus you only have to worry about imprisoned pawns from other factions.

And for what I read in the original mod reply list thirite only made his mod to stop RJW from loading and the save so it would not break anything, you would just have to disable 1 of the 2 and it would work again, but that's what I understood from it you can read the whole thing starting at page 10, starting with a user asking if the mod would be made compatible with the alien framework mod.

GhostData

I've released version 2.0.0 on the gitlab releases page:
https://gitlab.com/Tragix/children-and-pregnancy-collab/-/releases/v2.0.0

As with all changes, use at your own risk and keep backups of your save files before installing any new versions.
This version is backwards incompatible. It will not work with previous save files, and requires a new game to work properly.

In the future I will try to limit save breaking changes, though they will be less necessary as the mod reaches stability.
During testing, I noticed that when a child pawn spawns in caravans or from other sources, alien races framework starts spitting out rendering errors. For me this was fixed by selecting the broken pawn. Not sure if this is a newly introduced error, as I was not testing with alien races prior to these changes. I've looked into it, but so far I have not been able to identify the issue. Both mods have transpiler patches on the same pawn rendering method, but I don't suspect that is the problem.

Geese man

#50
you forgot to update the version in the about.xml to v2.0.0,

its also keeping pawns incapacitated when they have no hediff (see screenshots)
the colonist had given birth a few days ago with the "birth soon" hediff.
the pirate was spawned using"spawn pawn" "trasher" then downed using "T: damage legs" then got captured but never showed any injuries immediately after capture. log did not show anything out of the ordinary.
Alright did a little testing:
the colonist was treated like a patient recreation wise (would be cheered up by other colonists) however she would not be fed by the doctor, this led to her starving. I added the birth soon hediff on her again to see if it would maybe fix it, and it sort of did: she miscarried due to being malnourished which also made her able to walk again.
as for the prisoner I also gave it the "birth soon" hediff and removed it which fixed the issue.
so it appears that if female pawns (don't know about about male pawns) get incapacitated they can sometimes stay stuck as incapacitated incorrectly (yes sometimes, tried with another spawned thrasher which did start walking soon after with the correct injuries)
So more testing later this incapacitated after birth long after recovering from birth hediff is gone problem is colonist only it seems, both a wild woman and a tribal gave birth and started walking after the hediff was gone without issue. Ok to prevent the incapacitation to stay simply remove ANY hediff that incapacitates before the "recovering from birth" disappears (colonist had a catatonic breakdown which I removed after I had her give birth and let the rfb go away naturally, she started walking right after)

xrogaan

Quote from: Geese man on April 04, 2020, 04:39:15 PM
you forgot to update the version in the about.xml to v2.0.0


And the topic's.

GhostData

Quote from: Geese man on April 04, 2020, 04:39:15 PM
you forgot to update the version in the about.xml to v2.0.0,

its also keeping pawns incapacitated when they have no hediff (see screenshots)
the colonist had given birth a few days ago with the "birth soon" hediff.
the pirate was spawned using"spawn pawn" "trasher" then downed using "T: damage legs" then got captured but never showed any injuries immediately after capture. log did not show anything out of the ordinary.
Alright did a little testing:
the colonist was treated like a patient recreation wise (would be cheered up by other colonists) however she would not be fed by the doctor, this led to her starving. I added the birth soon hediff on her again to see if it would maybe fix it, and it sort of did: she miscarried due to being malnourished which also made her able to walk again.
as for the prisoner I also gave it the "birth soon" hediff and removed it which fixed the issue.
so it appears that if female pawns (don't know about about male pawns) get incapacitated they can sometimes stay stuck as incapacitated incorrectly (yes sometimes, tried with another spawned thrasher which did start walking soon after with the correct injuries)
So more testing later this incapacitated after birth long after recovering from birth hediff is gone problem is colonist only it seems, both a wild woman and a tribal gave birth and started walking after the hediff was gone without issue. Ok to prevent the incapacitation to stay simply remove ANY hediff that incapacitates before the "recovering from birth" disappears (colonist had a catatonic breakdown which I removed after I had her give birth and let the rfb go away naturally, she started walking right after)
I might have forgot to build after updating the version for release. I just uploaded 2.0.1 to fix the pawn insta-heal shortly after generation. The comp I add on pawn generation did not have a check to prevent it form removing  all hediffs from a newly generated pawn, so spawning someone in while paused and then downing them would cause them to immediately heal once the comp initialized.

As for the permanently downed pawn, I saw this consistently during play testing and thought I had fixed it - I can no longer replicate it the way I had previously.
I took a female colonist, added the birth soon hediff to her, let the doctors whisk are to a bed and then let them deliver. She received the post pregnancy hediff and about 3-ish hours later it is removed and she recovers.

Geese man

Quote from: Tragix on April 04, 2020, 06:59:00 PM
Quote from: Geese man on April 04, 2020, 04:39:15 PM
you forgot to update the version in the about.xml to v2.0.0,

its also keeping pawns incapacitated when they have no hediff (see screenshots)
the colonist had given birth a few days ago with the "birth soon" hediff.
the pirate was spawned using"spawn pawn" "trasher" then downed using "T: damage legs" then got captured but never showed any injuries immediately after capture. log did not show anything out of the ordinary.
Alright did a little testing:
the colonist was treated like a patient recreation wise (would be cheered up by other colonists) however she would not be fed by the doctor, this led to her starving. I added the birth soon hediff on her again to see if it would maybe fix it, and it sort of did: she miscarried due to being malnourished which also made her able to walk again.
as for the prisoner I also gave it the "birth soon" hediff and removed it which fixed the issue.
so it appears that if female pawns (don't know about about male pawns) get incapacitated they can sometimes stay stuck as incapacitated incorrectly (yes sometimes, tried with another spawned thrasher which did start walking soon after with the correct injuries)
So more testing later this incapacitated after birth long after recovering from birth hediff is gone problem is colonist only it seems, both a wild woman and a tribal gave birth and started walking after the hediff was gone without issue. Ok to prevent the incapacitation to stay simply remove ANY hediff that incapacitates before the "recovering from birth" disappears (colonist had a catatonic breakdown which I removed after I had her give birth and let the rfb go away naturally, she started walking right after)
I might have forgot to build after updating the version for release. I just uploaded 2.0.1 to fix the pawn insta-heal shortly after generation. The comp I add on pawn generation did not have a check to prevent it form removing  all hediffs from a newly generated pawn, so spawning someone in while paused and then downing them would cause them to immediately heal once the comp initialized.

As for the permanently downed pawn, I saw this consistently during play testing and thought I had fixed it - I can no longer replicate it the way I had previously.
I took a female colonist, added the birth soon hediff to her, let the doctors whisk are to a bed and then let them deliver. She received the post pregnancy hediff and about 3-ish hours later it is removed and she recovers.
hmm strange. on the other hand the feeding bug i have complained about before can now occur and even crash my game (although with the use of the "achtung" mod force) and babies will still be taken to hospital beds and be fed by doctors in their assigned cribs when they are not injured and the doctor is not assigned to child caring, I suggest you make a entirely new state a pawn can be in that will incapacitate them but not in a way doctor will try to "tend" to them in the form of feeding (disable even "rescue" from them to avoid any doctor issues) and only make pawns able to tuck in babies (if they have no injuries ofc) now that might potentially create some minor issues if there are no cribs available but that shouldnt be to hard to fix I think.
I can provide a savefile from a game I saved just on the moment the feeding bug was happening might be of use dm me if you want it.

Third_Of_Five

Been doing some testing with the new release and it looks like the trait inheritance system is broken. I'll post screenshots and send a .rws if you want.

JMan1008

So I have a bit of a strange issue in my current save file. I updated to 2.0.1 and now all the androids from the Android Tiers mod are being flagged as children. This didn't happen in 1.0.0 so I guess something you changed for the update borked the androids (since they're all under 10 years old). For now, I have every android that enters the map getting incapacitated upon entry. Any way you guys could fix this issue would be amazing

Headshotkill

This mod conflicts with Androids mod, all androids act as babies even though some of them are biologically over a century old. This didn't happen in 1.0, atleast not this severe, back them people with childcare jobs would carry androids to cribs though.

dusiiaczek

I have a weird problem with mod not related to babies. There is some "exception ticking" error that causes when a trader arrives some pawns drop their stuff and leave the map. I don't know if this is because of a conflict with some of my other mods, but when I removed CnP this stopped occurring.
So this happened https://i.imgur.com/ttLzJP0.png and logs https://gist.github.com/HugsLibRecordKeeper/9fe91a641a0263597907156ab7ecef0c

GhostData

Quote from: dusiiaczek on April 05, 2020, 09:16:52 AM
I have a weird problem with mod not related to babies. There is some "exception ticking" error that causes when a trader arrives some pawns drop their stuff and leave the map. I don't know if this is because of a conflict with some of my other mods, but when I removed CnP this stopped occurring.
So this happened https://i.imgur.com/ttLzJP0.png and logs https://gist.github.com/HugsLibRecordKeeper/9fe91a641a0263597907156ab7ecef0c
That would be the incompatibility with Alien Races. Will work on it.
Looks like androids from Android Tiers have only one life stage, which doesn't play well with how we currently determine race life stages. I could change it to look for specific life stage defs which would fix this scenario, but would lock us in on human lifestage defs, causing any mod that rolls their own to be excluded. There will not be a way to get around this for every race without the respective authors providing a patch.

Third_Of_Five

Ok, so I've been messing around with the code and I've managed to fix a bug with the TakeBabyToBedAndFeed job driver.
The bug happens when a pawn assigned to childcare prioritizes the TakeBabyToBedAndFeed job over the FeedPatient job when feeding an infant, causing the baby to be shoved out of their crib while being fed. I changed this so that the TakeBabyToBedAndFeed job doesn't get called unless the baby is in the Toddler stage. So when a pawn needs to feed a hungry infant, it defaults to either the FeedBaby job or the FeedPatient job, and the baby doesn't get shoved out of their crib or carried to a new bed for no reason.

Would you be willing to add me as a member on gitlab so I can push my changes to a new branch for you to review? I'm a web developer IRL so I have extensive experience with using git.