[1.3] Children and Pregnancy - v4.1.0

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

Previous topic - Next topic

laffin

#480
Many thanks for updating this mod!
I'm starting a new game and will let you know if I come across anything odd.


spongebob

There seems to be bug involving raids with the mod. I cant get any human raids after the early game.

RibDibbington

Quote from: spongebob on September 06, 2021, 05:39:30 PM
There seems to be bug involving raids with the mod. I cant get any human raids after the early game.
What's "the early game" and how are you distinguishing it?

Canute

The first 2 or 3 raids are scripted.
When the lonely raider and then 2 more raiders arrive, with high chances to down them.
Later raids are calculated with points.

bspawnz

Yes i am getting bugs with the latest release. Tried 4.1.0 as well and then copied Bodies def file from 3.54 but still getting same errors. Errors happen when Textures are loaded in Prepare carefully, or when Raid happens. Error is def due to this mod, maybe interaction with something else like HAR. I removed Real Faction guest and still got these errors.

Below is the log. I had removed most of my mods and was adding them one by one to check which ones causing errors.
https://gist.github.com/1660219cfdfddd5b4a919a37030195c6

Failed to find any textures at Things/Pawn/Humanlike/Bodies/Naked_ while constructing Multi(initPath=Things/Pawn/Humanlike/Bodies/Naked_, color=RGBA(0.945, 0.776, 0.545, 1.000), colorTwo=RGBA(0.945, 0.776, 0.545, 1.000))
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
Verse.Graphic_Multi:Init (Verse.GraphicRequest)
Verse.GraphicDatabase:GetInner<Verse.Graphic_Multi> (Verse.GraphicRequest)
Verse.GraphicDatabase:Get (System.Type,string,UnityEngine.Shader,UnityEngine.Vector2,UnityEngine.Color,UnityEngine.Color,Verse.GraphicData,System.Collections.Generic.List`1<Verse.ShaderParameter>,string)
AlienRace.AlienPartGenerator:GetNakedGraphic (RimWorld.BodyTypeDef,UnityEngine.Shader,UnityEngine.Color,UnityEngine.Color,string,string)
AlienRace.HarmonyPatches:ResolveAllGraphicsPrefix (Verse.PawnGraphicSet)
(wrapper dynamic-method) Verse.PawnGraphicSet:Verse.PawnGraphicSet.ResolveAllGraphics_Patch3 (Verse.PawnGraphicSet)
RimWorldChildren.LifecycleComp/<>c__DisplayClass35_0:<ForceRefreshBodyType>b__0 ()
Verse.LongEventHandler:ExecuteToExecuteWhenFinished ()
Verse.LongEventHandler:ExecuteWhenFinished (System.Action)
RimWorldChildren.LifecycleComp:ForceRefreshBodyType (bool)
RimWorldChildren.LifecycleComp:GrowToStage (int)
RimWorldChildren.LifecycleComp:Initialize (bool)
RimWorldChildren.LifecycleComp:get_CurrentLifestage ()
RimWorldChildren.Patches.PawnCapacityUtilityPatches/CalculateCapacityLevel_Patch:CalculateCapacityLevel_Postfix (Verse.HediffSet,Verse.PawnCapacityDef,single&)
(wrapper dynamic-method) Verse.PawnCapacityUtility:Verse.PawnCapacityUtility.CalculateCapacityLevel_Patch1 (Verse.HediffSet,Verse.PawnCapacityDef,System.Collections.Generic.List`1<Verse.PawnCapacityUtility/CapacityImpactor>,bool)
Verse.PawnCapacitiesHandler:GetLevel (Verse.PawnCapacityDef)
Verse.PawnCapacityWorker:CalculateCapacityAndRecord (Verse.HediffSet,Verse.PawnCapacityDef,System.Collections.Generic.List`1<Verse.PawnCapacityUtility/CapacityImpactor>)
RimWorld.PawnCapacityWorker_Consciousness:CalculateCapacityLevel (Verse.HediffSet,System.Collections.Generic.List`1<Verse.PawnCapacityUtility/CapacityImpactor>)
(wrapper dynamic-method) Verse.PawnCapacityUtility:Verse.PawnCapacityUtility.CalculateCapacityLevel_Patch1 (Verse.HediffSet,Verse.PawnCapacityDef,System.Collections.Generic.List`1<Verse.PawnCapacityUtility/CapacityImpactor>,bool)
Verse.PawnCapacitiesHandler:GetLevel (Verse.PawnCapacityDef)
Verse.PawnCapacitiesHandler:CapableOf (Verse.PawnCapacityDef)
Verse.Pawn_HealthTracker:ShouldBeDeadFromRequiredCapacity ()
(wrapper dynamic-method) Verse.Pawn_HealthTracker:Verse.Pawn_HealthTracker.ShouldBeDead_Patch0 (Verse.Pawn_HealthTracker)
(wrapper dynamic-method) Verse.Pawn_HealthTracker:Verse.Pawn_HealthTracker.CheckForStateChange_Patch3 (Verse.Pawn_HealthTracker,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff)
(wrapper dynamic-method) Verse.Pawn_HealthTracker:Verse.Pawn_HealthTracker.AddHediff_Patch1 (Verse.Pawn_HealthTracker,Verse.Hediff,Verse.BodyPartRecord,System.Nullable`1<Verse.DamageInfo>,Verse.DamageWorker/DamageResult)
VanillaTraitsExpanded.SpawnSetup_Patch:AddPawn (Verse.Pawn)
VanillaTraitsExpanded.GainTrait_Patch:Postfix (Verse.Pawn)
(wrapper dynamic-method) RimWorld.TraitSet:RimWorld.TraitSet.GainTrait_Patch2 (RimWorld.TraitSet,RimWorld.Trait)
(wrapper dynamic-method) Verse.PawnGenerator:Verse.PawnGenerator.GenerateTraits_Patch1 (Verse.Pawn,Verse.PawnGenerationRequest)
(wrapper dynamic-method) Verse.PawnGenerator:Verse.PawnGenerator.TryGenerateNewPawnInternal_Patch0 (Verse.PawnGenerationRequest&,string&,bool,bool)
(wrapper dynamic-method) Verse.PawnGenerator:Verse.PawnGenerator.GenerateNewPawnInternal_Patch1 (Verse.PawnGenerationRequest&)
Verse.PawnGenerator:GenerateOrRedressPawnInternal (Verse.PawnGenerationRequest)
(wrapper dynamic-method) Verse.PawnGenerator:Verse.PawnGenerator.GeneratePawn_Patch2 (Verse.PawnGenerationRequest)
(wrapper dynamic-method) Verse.StartingPawnUtility:Verse.StartingPawnUtility.NewGeneratedStartingPawn_Patch0 ()
RimWorld.ScenPart_ConfigPage_ConfigureStartingPawns:PostIdeoChosen ()
RimWorld.Scenario:PostIdeoChosen ()
RimWorld.Page_ChooseIdeoPreset:DoClassic ()
RimWorld.Page_ChooseIdeoPreset:DoWindowContents (UnityEngine.Rect)
Verse.Window:InnerWindowOnGUI (int)
UnityEngine.GUI:CallWindowDelegate (UnityEngine.GUI/WindowFunction,int,int,UnityEngine.GUISkin,int,single,single,UnityEngine.GUIStyle)


Error rendering pawn portrait: System.NullReferenceException: Object reference not set to an instance of an object
  at Verse.GenDraw.DrawMeshNowOrLater (UnityEngine.Mesh mesh, UnityEngine.Vector3 loc, UnityEngine.Quaternion quat, UnityEngine.Material mat, System.Boolean drawNow) [0x00004] in <b64badbf3c3d41018b3ca5d3e8c77771>:0
  at (wrapper dynamic-method) Verse.PawnRenderer.Verse.PawnRenderer.DrawPawnBody_Patch0(Verse.PawnRenderer,UnityEngine.Vector3,single,Verse.Rot4,Verse.RotDrawMode,Verse.PawnRenderFlags,UnityEngine.Mesh&)
  at (wrapper dynamic-method) Verse.PawnRenderer.Verse.PawnRenderer.RenderPawnInternal_Patch1(Verse.PawnRenderer,UnityEngine.Vector3,single,bool,Verse.Rot4,Verse.RotDrawMode,Verse.PawnRenderFlags)
  at Verse.PawnRenderer.RenderCache (Verse.Rot4 rotation, System.Single angle, UnityEngine.Vector3 positionOffset, System.Boolean renderHead, System.Boolean renderBody, System.Boolean portrait, System.Boolean renderHeadgear, System.Boolean renderClothes, System.Collections.Generic.Dictionary`2[TKey,TValue] overrideApparelColor, System.Nullable`1[T] overrideHairColor, System.Boolean stylingStation) [0x00138] in <b64badbf3c3d41018b3ca5d3e8c77771>:0
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
Verse.PawnRenderer:RenderCache (Verse.Rot4,single,UnityEngine.Vector3,bool,bool,bool,bool,bool,System.Collections.Generic.Dictionary`2<RimWorld.Apparel, UnityEngine.Color>,System.Nullable`1<UnityEngine.Color>,bool)
RimWorld.PawnCacheRenderer:OnPostRender ()
(wrapper dynamic-method) RimWorld.PawnCacheRenderer:RimWorld.PawnCacheRenderer.RenderPawn_Patch1 (RimWorld.PawnCacheRenderer,Verse.Pawn,UnityEngine.RenderTexture,UnityEngine.Vector3,single,single,Verse.Rot4,bool,bool,bool,bool,bool,UnityEngine.Vector3,System.Collections.Generic.Dictionary`2<RimWorld.Apparel, UnityEngine.Color>,System.Nullable`1<UnityEngine.Color>,bool)
RimWorld.PortraitsCache:RenderPortrait (Verse.Pawn,UnityEngine.RenderTexture,UnityEngine.Vector3,single,Verse.Rot4,bool,bool,System.Collections.Generic.Dictionary`2<RimWorld.Apparel, UnityEngine.Color>,System.Nullable`1<UnityEngine.Color>,bool)
RimWorld.PortraitsCache:Get (Verse.Pawn,UnityEngine.Vector2,Verse.Rot4,UnityEngine.Vector3,single,bool,bool,bool,bool,System.Collections.Generic.Dictionary`2<RimWorld.Apparel, UnityEngine.Color>,System.Nullable`1<UnityEngine.Color>,bool)
RimWorld.Page_ConfigureStartingPawns:DrawPawnList (UnityEngine.Rect)
(wrapper dynamic-method) RimWorld.Page_ConfigureStartingPawns:RimWorld.Page_ConfigureStartingPawns.DoWindowContents_Patch1 (RimWorld.Page_ConfigureStartingPawns,UnityEngine.Rect)
Verse.Window:InnerWindowOnGUI (int)
UnityEngine.GUI:CallWindowDelegate (UnityEngine.GUI/WindowFunction,int,int,UnityEngine.GUISkin,int,single,single,UnityEngine.GUIStyle)

Could not execute post-long-event action. Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at AlienRace.HarmonyPatches.ResolveAllGraphicsPrefix (Verse.PawnGraphicSet __instance) [0x00338] in <7a7300e6015848b5bccd02355978078b>:0
  at (wrapper dynamic-method) Verse.PawnGraphicSet.Verse.PawnGraphicSet.ResolveAllGraphics_Patch3(Verse.PawnGraphicSet)
  at RimWorldChildren.LifecycleComp+<>c__DisplayClass35_0.<ForceRefreshBodyType>b__0 () [0x0000c] in <604b1e7039684fc9bb9cb77b4d3ccf7e>:0
  at Verse.LongEventHandler.ExecuteToExecuteWhenFinished () [0x0007c] in <b64badbf3c3d41018b3ca5d3e8c77771>:0
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
Verse.LongEventHandler:ExecuteToExecuteWhenFinished ()
Verse.LongEventHandler:ExecuteWhenFinished (System.Action)
RimWorldChildren.LifecycleComp:ForceRefreshBodyType (bool)
RimWorldChildren.LifecycleComp:GrowToStage (int)
RimWorldChildren.LifecycleComp:Initialize (bool)
RimWorldChildren.LifecycleComp:get_CurrentLifestage ()
RimWorldChildren.Patches.PawnCapacityUtilityPatches/CalculateCapacityLevel_Patch:CalculateCapacityLevel_Postfix (Verse.HediffSet,Verse.PawnCapacityDef,single&)
(wrapper dynamic-method) Verse.PawnCapacityUtility:Verse.PawnCapacityUtility.CalculateCapacityLevel_Patch1 (Verse.HediffSet,Verse.PawnCapacityDef,System.Collections.Generic.List`1<Verse.PawnCapacityUtility/CapacityImpactor>,bool)
Verse.PawnCapacitiesHandler:GetLevel (Verse.PawnCapacityDef)
Verse.PawnCapacityWorker:CalculateCapacityAndRecord (Verse.HediffSet,Verse.PawnCapacityDef,System.Collections.Generic.List`1<Verse.PawnCapacityUtility/CapacityImpactor>)
RimWorld.PawnCapacityWorker_Consciousness:CalculateCapacityLevel (Verse.HediffSet,System.Collections.Generic.List`1<Verse.PawnCapacityUtility/CapacityImpactor>)
(wrapper dynamic-method) Verse.PawnCapacityUtility:Verse.PawnCapacityUtility.CalculateCapacityLevel_Patch1 (Verse.HediffSet,Verse.PawnCapacityDef,System.Collections.Generic.List`1<Verse.PawnCapacityUtility/CapacityImpactor>,bool)
Verse.PawnCapacitiesHandler:GetLevel (Verse.PawnCapacityDef)
Verse.PawnCapacitiesHandler:CapableOf (Verse.PawnCapacityDef)
Verse.Pawn_HealthTracker:ShouldBeDeadFromRequiredCapacity ()
(wrapper dynamic-method) Verse.Pawn_HealthTracker:Verse.Pawn_HealthTracker.ShouldBeDead_Patch0 (Verse.Pawn_HealthTracker)
(wrapper dynamic-method) Verse.Pawn_HealthTracker:Verse.Pawn_HealthTracker.CheckForStateChange_Patch3 (Verse.Pawn_HealthTracker,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff)
(wrapper dynamic-method) Verse.Pawn_HealthTracker:Verse.Pawn_HealthTracker.AddHediff_Patch1 (Verse.Pawn_HealthTracker,Verse.Hediff,Verse.BodyPartRecord,System.Nullable`1<Verse.DamageInfo>,Verse.DamageWorker/DamageResult)
VanillaTraitsExpanded.SpawnSetup_Patch:AddPawn (Verse.Pawn)
VanillaTraitsExpanded.GainTrait_Patch:Postfix (Verse.Pawn)
(wrapper dynamic-method) RimWorld.TraitSet:RimWorld.TraitSet.GainTrait_Patch2 (RimWorld.TraitSet,RimWorld.Trait)
(wrapper dynamic-method) Verse.PawnGenerator:Verse.PawnGenerator.GenerateTraits_Patch1 (Verse.Pawn,Verse.PawnGenerationRequest)
(wrapper dynamic-method) Verse.PawnGenerator:Verse.PawnGenerator.TryGenerateNewPawnInternal_Patch0 (Verse.PawnGenerationRequest&,string&,bool,bool)
(wrapper dynamic-method) Verse.PawnGenerator:Verse.PawnGenerator.GenerateNewPawnInternal_Patch1 (Verse.PawnGenerationRequest&)
Verse.PawnGenerator:GenerateOrRedressPawnInternal (Verse.PawnGenerationRequest)
(wrapper dynamic-method) Verse.PawnGenerator:Verse.PawnGenerator.GeneratePawn_Patch2 (Verse.PawnGenerationRequest)
(wrapper dynamic-method) Verse.StartingPawnUtility:Verse.StartingPawnUtility.NewGeneratedStartingPawn_Patch0 ()
RimWorld.ScenPart_ConfigPage_ConfigureStartingPawns:PostIdeoChosen ()
RimWorld.Scenario:PostIdeoChosen ()
RimWorld.Page_ChooseIdeoPreset:DoClassic ()
RimWorld.Page_ChooseIdeoPreset:DoWindowContents (UnityEngine.Rect)
Verse.Window:InnerWindowOnGUI (int)
UnityEngine.GUI:CallWindowDelegate (UnityEngine.GUI/WindowFunction,int,int,UnityEngine.GUISkin,int,single,single,UnityEngine.GUIStyle)

GhostData

I honestly don't know what you expect mixing and matching files from incompatible versions. If I have time today I will test how CNP interacts with Prepare Carefully, but the report itself is useless as it is using an undefined set of parameters that I cannot replicate and that would fail no matter what modlist you run.

bspawnz

The crash log is from the latest version of the mod. I was mixing files after to test  and try to fix the issue after the crash (with my absolute lack of knowledge in modding). Anyways spent 4 hours last night fixing my mod list and order. Will spend some more time today to try to isolate which mod interaction with this mod is causing the issue.

GhostData

What is the age and race of the pawn you were having troubles with? Looks like something CNP is expecting to be initialized is missing.

bspawnz

#489
I didnt check the age/race. Race is humans as i dont have any race mods.

The issue appears to happen when pawns are being loaded/dawn in character selection screen, or if you load a raid with Tribals.

I did the following two mod-list and didnt get same error. Got a different error with one of vanilla expanded clothing not found.
https://gist.github.com/2ce25a50cd2a27369495cca72da9b893
Cloth Load error
https://gist.github.com/bf57f5a154cadbdd692f49b38dbbe632
Cloth Load error


Then i tried to recreate original error and below 3 mod lists all caused it. The mod lists are ordered by more mods to less mods as i was whittling them down.

https://gist.github.com/fa43c054968bf932a752d32a4600095e
Yes ERROR

https://gist.github.com/c31bede0598da824d13e31b529075012
YEs ERROR

https://gist.github.com/1c88ce0a3deaedde985b16afd4709821
YES Error

After the last attempt, i thought it would be one of the trait mods, so i removed vanilla expanded traits and Vanilla expanded framework and that didnt cause the same error. Dont have the error log as GitHub isnt letting me upload.

So i thought it would be vanilla expanded traits (since mod list with Vanilla Expanded Frame work and Vanilla Factions expanded Settlers hadnt thrown this errors), so went to my original mod list and removed just that (leaving all other vanilla expanded mods in) but i am still getting error. So it could be the vanilla expanded mods on how they interact with texture loading/C&P?

Below are the two mod lists to compare with minimal mods;
Didnt throw this error: https://gist.github.com/bf57f5a154cadbdd692f49b38dbbe632
This one had error: https://gist.github.com/1c88ce0a3deaedde985b16afd4709821

I have finished my full mod list without C&P and its stable. Log below. But as soon as i add C&P it has errors with pawn generation/textures. I could actually live with missing textures/invisible pawns on raids, but when raid happens with C&P and all my other mods, when i zoom into/close enough to raid for textures to load the entire game crashes immediately. Would appreciate you fixing this as i consider C&P an essential mod in my playthroughs as it adds significant difficulty with pregnancy and managing children and offsets the easiness of lategame.
https://gist.github.com/2b36fef6e9c3c53fb5a5b645a24e4da6

Thanks,

GhostData

#490
I am able to replicate readily with the following order:

HAR
Vanilla Expanded Framework
Vanilla Expanded Traits
CNP

The result is that upon loading the character creation menu, a NPE occurs in HAR's code, most likely as part of CNP's own patching. The error is replicable without HAR installed as well, but obviously manifests differently. The result is not replicable without CNP.
The error is caused by the pawn.story.bodyType being set to null prior to entering CNP's code. The very first thing we do on pawn generation is initialize the CNP comp and print the body type - at this point it is already null. The best I can suspect is that one of the VEF components is interacting with the bodytype in such a way that it no longer exists by the time we enter CNP's code, which is correctly assuming the bodytype will exist after pawn generation.

The only problem with that theory is that I don't really see anything obvious that could cause the bodytype alone to be null at this point in the processing. MFVC does something I can't identify regarding the scale of graphics and references bodytype as well, but even there it doesn't appear as though this would cause the bodytype to be null.

As an additional test, I disabled each patch until I narrowed it down to a single patch.
CalculateCapacityLevel is a patch wherein we disabled or modify pawn capacities based on the def. With this patch disabled, the body is no longer null on pawn generation.
With the majority of the logic of this method stripped, I can still replicate the error, which makes me suspect this is more of a timing issue than anything, as there is absolutely nothing in this stack path that could possibly set bodyType to null.

I will update again when I have another chance to look into it.

bspawnz

Thanks! Really appreciate you looking into this. Have a good one!

GhostData

4.1.2 released

https://gitlab.com/Tragix/children-and-pregnancy-collab/-/releases/v4.1.2

The bug discussed above is utterly incomprehensible. I have no idea how it's possible or where it's coming from. Somehow the interactions between CNP and Vanilla Expanded cause the bodytype of a pawn to be set to null, despite neither mod explicitly doing so. Delaying the first call to CNP's code fixed 75% of such cases, but caused more problems than it solved.
This is not a root cause fix, it's a bandaid that will regenerate the body type if CNP ever starts initialization and finds that the body type is null.
This seems to fix the exact issue, but will almost certainly introduce more. I'm going to consider Vanilla Expanded to be a soft incompatibility from here on, at least until I or someone else can identify the root cause of the init issue. It will probably work, but use both mods at your own risk.

bspawnz

#493
Hey Thanks for updating but it didn't solve the issue for me, as the game still crashes with raids when you zoom in and textures load (same crash doesn't happen with all other mods). Attached is the crash log if it helps. But at this point i am going to try to find alternative mods to bring the difficulty this mod brings.

Player-Prev.log is log with C&P with crash
Player.log is log without C&P, the only red lines were a Disease headif error from Disease+ and Horse draw error from giddyup which didnt cause any actual issues/crash.

Thanks,

Anri442

For some reason the option to sterilize animals disappears when I`m using C&P. It reappears when I disable the mod.