[1.3] Children and Pregnancy - v4.1.0

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

Previous topic - Next topic

pumacatrun2

So I'm running RJW, Children School & Learning and now Children and Pregnancy. Before adding this, disabling children worked for CS&L to allow RJW to be the main fertility, but even with pregnancy disabled in this mod my colonist with an IUD (which drops RJW fertility to 0%) got pregnant.

GhostData

#136
Quote from: lbmaian on May 01, 2020, 03:07:31 AM
Quote from: Tragix on April 30, 2020, 09:28:10 PM
Quote from: malistaticy on April 29, 2020, 07:01:49 PM
it would be nice if babies had recreation boredom turned off so that their one (or nearly only one) option of recreation, social interacting, didnt take hours to filfill
This should be the case for social already, but we may need to consider it for recreation if that's what the new play-with-baby interaction is using.

Have you taken a look at my commits I linked weeks ago (https://ludeon.com/forums/index.php?topic=51258.msg476125#msg476125 - make sure to expand all the collapsed diffs)?

They include a note that the social joy tolerance negation hack doesn't work, and what should be done to fix it.
I've actually been referencing your comments for some parts of the code I've touched. I wasn't aware the social joy tolerance thing was busted. I'll take a look and get that fixed.
For toddlers+, I think the real solution is to add more joy sources, which is what ThirdOfFive seems to be doing. Babies are relegated to the baby box, so it's fair to remove tolerances in their case.

Edit:
So I tested the last version out, and for babies I do not see that there is any issue with the social joy tolerance. I went ahead and made some changes to the patch anyway since I was taking a look.

Quote from: pumacatrun2 on May 01, 2020, 04:45:16 AM
So I'm running RJW, Children School & Learning and now Children and Pregnancy. Before adding this, disabling children worked for CS&L to allow RJW to be the main fertility, but even with pregnancy disabled in this mod my colonist with an IUD (which drops RJW fertility to 0%) got pregnant.
As of right now, I would consider RJW a hard incompatibility due to how it handles pregnancy. It explicitly prevents this mod's pregnancy hediff from being added in favor of its own. Our hediff is essential for the full functionality of the mod to take place, as a number of things are configured in the hediff that are used post-birth. If I had to guess, at a minimum the child would be born without genetic traits, assuming the birth doesn't cause an error.

RJW copied the original source for this mod and modified it to suit their needs, which kind of makes it a complicated scenario when it comes to making the mods play together. As this mod develops, it is likely that more features will be added that cause a divergence in how the two mods handle pregnancy, birth, and childhood.
My personal take, is that a mod like RJW shouldn't be dealing with pregnancy or birth at all. It ought to be a framework for advanced lovin' interactions, and at worst use an API or another mod to handle pregnancy and children. In a perfect world, this mod would provide that API, and RJW would only need to extend our classes in order to provide the additional functionality they need. Some of my changes so far have been aimed at allowing that, though admittedly I stink at writing APIs.

I will double check disabling pregnancy in the config. It's not something I have tested since I started working on this.
edit: I wasn't able to see any problems with the pregnancy config. Are you certain it was a CNP pregnancy?
I know RJW and Babies and Children copied the code for CNP at one point, but I'm not familiar with CSL. Is it another derivative?
I saw some folks trying to uses Babies and Children alongside CNP, and I'm honestly not sure what will happen in that case. IIRC both mods have the exact same namespace, which I haven't encountered before.

GhostData

Quick QoL addition for 2.1.1: https://gitlab.com/Tragix/children-and-pregnancy-collab/-/tags/v2.1.1
Added a volume config for folks who are sick of vocal babies.

Meester

Does this work with CSL?

The author of it said regarding CP

QuoteWell it was a long tome ago, most of the stuff is still in the mod that disables my routines for humans when it is active, but it is based on the name of the mod, so I don't know if that was kept the same (when you turn on dev mode and all logs in my mod-options it would tell you if it was recognized when loading a game)

So naturally I am unsure.

lbmaian

Quote from: Tragix on May 01, 2020, 04:53:09 PM
I've actually been referencing your comments for some parts of the code I've touched. I wasn't aware the social joy tolerance thing was busted. I'll take a look and get that fixed.
For toddlers+, I think the real solution is to add more joy sources, which is what ThirdOfFive seems to be doing. Babies are relegated to the baby box, so it's fair to remove tolerances in their case.

Edit:
So I tested the last version out, and for babies I do not see that there is any issue with the social joy tolerance. I went ahead and made some changes to the patch anyway since I was taking a look.

IIRC, the bug manifested in two ways:
1) Social joy tolerance approaches but never actually reaches 0. Practically speaking, this happens quickly enough and the tolerance value becomes so close to 0, that it is effectively 0. So that patch did accomplish its goal for all intents and purposes despite doing it incorrectly.
2) Users reported a baby or toddler somehow getting bored of social joy. I don't recall exactly how this happens, but once they do become bored, that patch couldn't remove the bored flag.

BTW, in response to your comment "Why is this patch necessary?" regarding the next patch "WGWDF_FAIRT_Patch"...
This patch was added in commit "Fixed bug where wardens would not deliver food to child prisoners": https://gitlab.com/Thirite/children-and-pregnancy-collab/-/commit/73126fc71afaffbe2451058d37ff08d92ba65009
Hence my TODO note: https://gitlab.com/lbmaian/children-and-pregnancy-collab/-/commit/24592bbe79ea70db0e753055b03f8ce4f2f6e77f#ce9fdf96a8e5eb90865b472cdca808d6109d7fa7_432_520

Third_Of_Five

Quote from: Chezzprinn on April 28, 2020, 10:41:01 PM
Thanks for the permission, mate!

I've uploaded it to the workshop.

Do you want me to add you as a contributor?

Can I be added as a contributer? My steam username is ThirdOfFive.

Third_Of_Five

Quote from: lbmaian on May 03, 2020, 04:12:13 AM
IIRC, the bug manifested in two ways:
1) Social joy tolerance approaches but never actually reaches 0. Practically speaking, this happens quickly enough and the tolerance value becomes so close to 0, that it is effectively 0. So that patch did accomplish its goal for all intents and purposes despite doing it incorrectly.
2) Users reported a baby or toddler somehow getting bored of social joy. I don't recall exactly how this happens, but once they do become bored, that patch couldn't remove the bored flag.

I created an issue (https://gitlab.com/Tragix/children-and-pregnancy-collab/-/issues/4) in gitlab to address the lack of recreation variety for toddlers. I'm currently working on feature updates for this, once they are added I'll remove the patch which removes tolerance for social joy as it will no longer be needed once toddlers have additional options for recreation.

Geese man

#142
Could there be looked into the issue that imprisoned infants and toddlers wont sleep after reaching the -6 drowsy debuff, they will start sleeping when they hit the -12 but will wake up immediately after going back to -6 drowsy. children don't have this issue. (this is a tad problematic for when the toddler is wild and you want to tame but they will always sleep before the tame is finished, that happens after a pregnant colonist runs wild and gives birth soon after)

wild toddlers will also constantly leave the crib whilst trying to sleep making it impossible to operate on them without bashing them into a painshock.

Perhaps make tame rate for wild toddlers 100% as they are toddlers I don't see a reason why he/she wouldn't just be "adopted", maybe add a Adoption action for infants and toddlers?.


And maybe remove the possibility that toddlers start a prison break (or join one) as they should be too young to even understand how a door lock works, and they die way too easily making them well not very likely to escape or even survive for that matter.
and perhaps remove the possibility of a toddler going berserk cause that 17 melee tribal Berserker in the cell is not gonna go easy on it.

I forgot to mention that wardens with childcare job will take imprisoned toddlers to a colonist crib (or bed when there is non) to feed them instead of feeding them in their prison cribs.

Chezzprinn

Quote from: Third_Of_Five on May 04, 2020, 10:31:40 AM
Quote from: lbmaian on May 03, 2020, 04:12:13 AM
IIRC, the bug manifested in two ways:
1) Social joy tolerance approaches but never actually reaches 0. Practically speaking, this happens quickly enough and the tolerance value becomes so close to 0, that it is effectively 0. So that patch did accomplish its goal for all intents and purposes despite doing it incorrectly.
2) Users reported a baby or toddler somehow getting bored of social joy. I don't recall exactly how this happens, but once they do become bored, that patch couldn't remove the bored flag.

I created an issue (https://gitlab.com/Tragix/children-and-pregnancy-collab/-/issues/4) in gitlab to address the lack of recreation variety for toddlers. I'm currently working on feature updates for this, once they are added I'll remove the patch which removes tolerance for social joy as it will no longer be needed once toddlers have additional options for recreation.

Sure, couldn't find you on Steam, but you can add me: Engadine Maccas, 1997

Third_Of_Five

#144
Working on some graphics for new baby toys, let me know what you guys think

StatikMilk30

Seems like there is a bug where androids from Androids Tiers can be treated as children and ya cant rescue or oporate on them. On one particular case the pop-up menu to rscue them just flickered and wouldnt allow any input.

Geese man

Quote from: Third_Of_Five on May 05, 2020, 11:18:30 AM
Working on some graphics for new baby toys, let me know what you guys think
I would add some numbers or letters on the cubes as they feel a little empty.
If you are working on toys perhaps make a few different toys which toddlers can learn skills from to a certain level, 7 maybe?

And found a tiny "bug": a child with under grounder trait will still have the -8 scared of the dark debuff.

Third_Of_Five

#147
Added the item ingame to see how it looks. Texture needs more detailing, but it looks pretty good otherwise.

GhostData

#148
Quote from: Geese man on May 04, 2020, 03:55:31 PM
Could there be looked into the issue that imprisoned infants and toddlers wont sleep after reaching the -6 drowsy debuff, they will start sleeping when they hit the -12 but will wake up immediately after going back to -6 drowsy. children don't have this issue. (this is a tad problematic for when the toddler is wild and you want to tame but they will always sleep before the tame is finished, that happens after a pregnant colonist runs wild and gives birth soon after)

wild toddlers will also constantly leave the crib whilst trying to sleep making it impossible to operate on them without bashing them into a painshock.

Perhaps make tame rate for wild toddlers 100% as they are toddlers I don't see a reason why he/she wouldn't just be "adopted", maybe add a Adoption action for infants and toddlers?.


And maybe remove the possibility that toddlers start a prison break (or join one) as they should be too young to even understand how a door lock works, and they die way too easily making them well not very likely to escape or even survive for that matter.
and perhaps remove the possibility of a toddler going berserk cause that 17 melee tribal Berserker in the cell is not gonna go easy on it.

I forgot to mention that wardens with childcare job will take imprisoned toddlers to a colonist crib (or bed when there is non) to feed them instead of feeding them in their prison cribs.
I've created a backlog issue to address the problems we have with children and birth in prison. Not sure what all we will need to fix yet, as it is kind of an untouched topic up to now. Right now my thinking is that we will attempt to make some common sense changes such as prisoners being able to give birth and babies being able to be adopted/captured more easily. We will need rules for certain prison interactions (maybe) based on age stage of a child. I agree that a toddler probably has no need to escape, though that may be beyond my ability to patch depending on how it's implemented in the RW source.
We will not make changes that reward a certain play style. For example, if a player chooses to have a toddler be the cellmate of a psychotic cannibal, that's on them. We won't try to patch out  or prevent scenarios that lead to baby death due to the player's questionable judgement.

Quote from: StatikMilk30 on May 05, 2020, 12:53:16 PM
Seems like there is a bug where androids from Androids Tiers can be treated as children and ya cant rescue or oporate on them. On one particular case the pop-up menu to rscue them just flickered and wouldnt allow any input.
Are you using the latest version? I was fairly certain this was addressed previously, as we no longer apply the component on non humans.
Either way, I will revisit this as I work on the alien race support.

Quote from: lbmaian on May 03, 2020, 04:12:13 AM
IIRC, the bug manifested in two ways:
1) Social joy tolerance approaches but never actually reaches 0. Practically speaking, this happens quickly enough and the tolerance value becomes so close to 0, that it is effectively 0. So that patch did accomplish its goal for all intents and purposes despite doing it incorrectly.
2) Users reported a baby or toddler somehow getting bored of social joy. I don't recall exactly how this happens, but once they do become bored, that patch couldn't remove the bored flag.
I was never able to replicate this, but I modified the patch anyway to update the tolerance and boredom fields directly. I think the new patch should cover these cases if it ever crops up.

As an aside, looking through the code and some of your comments, I'd be interested in hearing what you think about the decision to override numerous rendering methods instead of providing new body types that are already adjusted with appropriate graphics and scales. My first guess is that the author didn't want to have to deal with changing back to the generated/adult body type when no longer rendering the pawn as a child.
As part of alien races support, I want to provide a way for the developer to provide an override for the graphics we render at each life stage, but the more I look at it, it seems it would make more sense to just make a custom body type that contains all of these graphics.

I haven't looked in depth how body types are actually used in the RW source, so maybe there are other reasons changing body type is a bad idea.

Geese man

With my current mods I am able to capture infants (ill try testing all mods that might make it possible later)

I think the easiest way for supporting prisoners giving birth is that there is a small chance for female pawns to be 1 day early stage pregnant,
and if they leave the map with the random chance pregnancy it will simply be removed to prevent them from returning and randomly giving birth.
now as for sieges if they are besieging for 44 days then I don't see a reason why a spawned pregnant pawn can't give birth as 44 day long sieges are quite rare to say the least as far as my experience goes.

Now to make this somewhat more doable perhaps add a second pregnancy hediff which will be used for non player faction pawns generating on a tile with the same properties as the normal pregnancy hediff except it always start at 1 day early stage (forced 1 day to prevent pregnancies that are further) but will disappear if the pawn leaves the tile, now to make it a bit more "realistic" the pregnancy should always be from a current spouse or lover if they are with them (generating at same event) but never from the spouse or lover if they are either a colonist or prisoner as they would not have been able to love, the pregnancy should however not be removed if it reached middle stage whilst on the tile usually from being rescued or imprisoned now since injuries will usually cause a miscarriage this should be rare anyway so maybe just ignore that part.

Now for the toddler imprisonment issues if they have a certain amount of recruitment chance (high %) they should not ever start a prison break at the very least I could be wrong but I saw a will never prison break on a pawn before, should also eliminate the recruit/adopt issue, still keeps the issue with wild toddlers, however without mods like human farming they should be very rare to come by tho so maybe that can be put aside for a while.

hope all that makes sense.